NGL@0.10.4 Home Manual Reference Source GalleryRepository
import StructureComponent from 'ngl/src/component/structure-component.js'
public class | source

StructureComponent

Extends:

Component → StructureComponent

Component wrapping a Structure object

Example:

// get a structure component by loading a structure file into the stage
stage.loadFile( "rcsb://4opj" ).then( function( structureComponent ){
    structureComponent.addRepresentation( "cartoon" );
    structureComponent.autoView();
} );

Constructor Summary

Public Constructor
public

constructor(stage: Stage, structure: Structure, params: ComponentParameters)

Create structure component

Member Summary

Public Members
public

Events emitted by the component

public

The wrapped structure

public
public get

Component type

Method Summary

Public Methods
public

Add a new structure representation to the component

public

Add a new trajectory component to the structure

public

autoView(sele: String | Integer, duration: Integer): undefined

Automatically center and zoom the component

public

Rebuild all representations

public

Rebuild all trajectories

public

Set the default assembly

public

Inherited Summary

From class Component
public

Events emitted by the component

public

addAnnotation(position: Vector3, content: String | Element, params: Object): Annotation

Add an anotation object

public

Add a new representation to the component

public

autoView(duration: Integer): undefined

Automatically center and zoom the component

public
public abstract
public
public

Remove all annotations from the component

public

Removes all representation components

public

Remove the give annotation from the component

public

Removes a representation component

public

Set position transform

public

Set rotation transform

public

Set scale transform

public

Set general transform.

public

Set the visibility of the component, including added representations

Public Constructors

public constructor(stage: Stage, structure: Structure, params: ComponentParameters) source

Create structure component

Override:

Component#constructor

Params:

NameTypeAttributeDescription
stage Stage

stage object the component belongs to

structure Structure

structure object to wrap

params ComponentParameters

component parameters

Public Members

public signals: StructureComponentSignals source

Events emitted by the component

Override:

Component#signals

public structure: Structure source

The wrapped structure

public structureView: StructureView source

View on StructureComponent#structure. Change its selection via StructureComponent#setSelection.

public get type: String source

Component type

Public Methods

public addRepresentation(type: String, params: StructureRepresentationParameters): RepresentationComponent source

Add a new structure representation to the component

Override:

Component#addRepresentation

Params:

NameTypeAttributeDescription
type String

the name of the representation, one of: axes, backbone, ball+stick, base, cartoon, contact, distance, helixorient, hyperball, label, licorice, line surface, ribbon, rocket, rope, spacefill, trace, tube, unitcell.

params StructureRepresentationParameters

representation parameters

Return:

RepresentationComponent

the created representation wrapped into a representation component object

public addTrajectory(trajPath: String | Frames, params: TrajectoryComponentParameters | TrajectoryParameters): TrajectoryComponent source

Add a new trajectory component to the structure

Params:

NameTypeAttributeDescription
trajPath String | Frames

path or frames object

params TrajectoryComponentParameters | TrajectoryParameters

parameters

Return:

TrajectoryComponent

the created trajectory component object

public autoView(sele: String | Integer, duration: Integer): undefined source

Automatically center and zoom the component

Override:

Component#autoView

Params:

NameTypeAttributeDescription
sele String | Integer
  • optional

selection string or duration if integer

duration Integer
  • optional

duration of the animation, defaults to 0

Return:

undefined

public rebuildRepresentations(): undefined source

Rebuild all representations

Return:

undefined

public rebuildTrajectories(): undefined source

Rebuild all trajectories

Return:

undefined

public setDefaultAssembly(value: String): undefined source

Set the default assembly

Params:

NameTypeAttributeDescription
value String

assembly name

Return:

undefined

public setSelection(string: String): StructureComponent source

Set selection of StructureComponent#structureView

Params:

NameTypeAttributeDescription
string String

selection string

Return:

StructureComponent

this object