Interface

SurfaceStyleSpec

SurfaceStyleSpec

View Source GLViewer.ts, line 6154

Example

var setStyles = function(volumedata){
 var data = new $3Dmol.VolumeData(volumedata, "cube");
 viewer.addSurface("VDW", {opacity:0.85, voldata: data, volscheme: new $3Dmol.Gradient.RWB(-10,10)},{chain:'A'});
 viewer.mapAtomProperties($3Dmol.applyPartialCharges);
 viewer.addSurface($3Dmol.SurfaceType.SAS, {map:{prop:'partialCharge',scheme:new $3Dmol.Gradient.RWB(-.05,.05)}, opacity:1.0},{chain:'B'});
 viewer.addSurface($3Dmol.SurfaceType.VDW, {opacity:0.85,voldata: data, color:'red'},{chain:'C'});
 viewer.addSurface($3Dmol.SurfaceType.SAS, {opacity:0.85,voldata: data, colorscheme:'greenCarbon'},{chain:'D'});
 viewer.render();
};
$3Dmol.download("pdb:4DLN",viewer,{},function(){
  $.get("data/1fas.cube",setStyles);
});

Members

ColorSpec

# color Optional

fixed coloring, overrides colorscheme

View Source GLViewer.ts, line 6180

ColorschemeSpec

# colorscheme Optional

element based coloring

View Source GLViewer.ts, line 6175

number

# opacity Optional

sets the transparency: 0 to hide, 1 for fully opaque

View Source GLViewer.ts, line 6170

VolumeData

# voldata Optional

volumetric data for vertex coloring, can be VolumeData object or raw data if volformat is specified

View Source GLViewer.ts, line 6185

string

# volformat Optional

format of voldata if not a {VolumeData} object

View Source GLViewer.ts, line 6195

Gradient

# volscheme Optional

coloring scheme for mapping volumetric data to vertex color, if not a Gradient object, show describe a builtin gradient one by providing an object with gradient, min, max, and (optionally) mid fields.

View Source GLViewer.ts, line 6190