NGL@0.10.4 Home Manual Reference Source GalleryRepository
import DistanceRepresentation from 'ngl/src/representation/distance-representation.js'
public class | source

DistanceRepresentation

Extends:

RepresentationStructureRepresentation → DistanceRepresentation

Distance representation

Constructor Summary

Public Constructor
public

Create Distance representation object

Inherited Summary

From class Representation
public

tasks: *

Counter that keeps track of tasks related to the creation of the representation, including surface calculations.

public

viewer: *

public

Set the visibility of the representation

public

setVisibility(value: Boolean, noRenderRequest: Boolean): Representation

Set the visibility of the representation

From class StructureRepresentation
public
public
public

Set representation parameters

public

Set representation parameters

Public Constructors

public constructor(structure: Structure, viewer: Viewer, params: DistanceRepresentationParameters) source

Create Distance representation object

Override:

StructureRepresentation#constructor

Params:

NameTypeAttributeDescription
structure Structure

the structure to be represented

viewer Viewer

a viewer object

params DistanceRepresentationParameters

distance representation parameters

Example:

stage.loadFile( "rcsb://1crn" ).then( function( o ){
    o.addRepresentation( "cartoon" );
    // either give selections (uses first selected atom) ...
    var atomPair = [ [ "1.CA", "4.CA" ], [ "7.CA", "13.CA" ] ];
    // or atom indices
    var atomPair = [ [ 8, 28 ], [ 173, 121 ] ];
    o.addRepresentation( "distance", { atomPair: atomPair } );
    stage.autoView();
} );