Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NGLComponent<SS>

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

canvas

canvas: HTMLElement | null = null

context

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
see

https://reactjs.org/docs/context.html

prevCanvas

prevCanvas: HTMLElement | null = null

props

props: Readonly<INGLComponentProps> & Readonly<object>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: NGLComponentState = initialNGLState

Static Optional contextType

contextType: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
  static contextType = Ctx
  context!: React.ContextType<typeof Ctx>
  render () {
    return <>My context's value: {this.context}</>;
  }
}
see

https://reactjs.org/docs/context.html#classcontexttype

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<INGLComponentProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

Protected addNewHoveredResidue

Protected addStructureToStage

Protected canvasRefCallback

  • canvasRefCallback(el: HTMLDivElement): void
  • Callback for when the canvas element is mounted. This is needed to ensure the NGL camera preserves orientation if the DOM node is re-mounted, like for full-page mode.

    Parameters

    • el: HTMLDivElement

      The canvas element.

    Returns void

Protected centerCamera

  • centerCamera(): void

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void

componentDidUpdate

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<INGLComponentProps>, nextContext: any): void

componentWillUnmount

  • componentWillUnmount(): void

Optional componentWillUpdate

Protected deriveActiveRepresentations

forceUpdate

  • forceUpdate(callback?: undefined | function): void
  • Parameters

    • Optional callback: undefined | function

    Returns void

Protected generateStage

Protected getClearSelectionDockItem

Protected getDistanceRepForResidues

Protected getDockItems

Protected getRepresentationConfigs

  • getRepresentationConfigs(): object

Protected getSettingsConfigurations

  • getSettingsConfigurations(): object

Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

Protected handleAtomClick

Protected handleBothSuperposition

  • handleBothSuperposition(stage: Stage): void

Protected handleClickHover

  • handleClickHover(structureComponent: Component): void

Protected handleClickPick

Protected handleHoveredDistances

  • handleHoveredDistances(residueIndex: number, structureComponent: Component): void

Protected handleRepresentationUpdate

  • handleRepresentationUpdate(stage: Stage): object
  • Parameters

    Returns object

    • experimental: object
      • reps: RepresentationElement[]
      • structType: "rocket" | "angle" | "axes" | "backbone" | "ball+stick" | "base" | "cartoon" | "contact" | "default" | "dihedral" | "distance" | "helixorient" | "hyperball" | "label" | "licorice" | "line" | "surface" | "ribbon" | "rope" | "spacefill" | "trace" | "tube" | "unitcell"
    • predicted: object
      • reps: RepresentationElement[]
      • structType: "rocket" | "angle" | "axes" | "backbone" | "ball+stick" | "base" | "cartoon" | "contact" | "default" | "dihedral" | "distance" | "helixorient" | "hyperball" | "label" | "licorice" | "line" | "surface" | "ribbon" | "rope" | "spacefill" | "trace" | "tube" | "unitcell"

Protected handleStructureClick

Protected handleSuperposition

Protected highlightCandidateResidues

Protected highlightLockedDistancePairs

Protected highlightSecondaryStructures

Protected initData

Protected isExperimentalStructure

  • isExperimentalStructure(structureComponent: Component): boolean

Protected isHighlightUpdateNeeded

Protected measuredProximityHandler

  • measuredProximityHandler(value: number): void

Protected onCanvasLeave

  • onCanvasLeave(): void

Protected onClick

Protected onHover

Protected onKeyDown

  • onKeyDown(event: KeyboardEvent): void

Protected onResizeHandler

  • onResizeHandler(event?: UIEvent): void

Protected onSuperpositionToggle

  • onSuperpositionToggle(event?: React.MouseEvent): void

render

  • render(): Element
  • Renders the NGL canvas.

    Because we are working with WebGL via the canvas, updating this visualization happens through the canvas reference.

    Returns Element

    The NGL Component

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof NGLComponentState

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

Protected switchCameraType

  • switchCameraType(): void

Protected toggleDistRep

  • toggleDistRep(event?: React.MouseEvent): void

Protected toggleMovePick

  • toggleMovePick(event?: React.MouseEvent): void

Protected updateRepresentation

Object literals

Static defaultProps

defaultProps: object

addCandidateResidues

addCandidateResidues: EMPTY_FUNCTION = EMPTY_FUNCTION

addHoveredResidues

addHoveredResidues: EMPTY_FUNCTION = EMPTY_FUNCTION

addLockedResiduePair

addLockedResiduePair: EMPTY_FUNCTION = EMPTY_FUNCTION

backgroundColor

backgroundColor: string = "#ffffff"

cameraFov

cameraFov: number = 65

cameraType

cameraType: string = "perspective"

candidateResidues

candidateResidues: never[] = []

cardProps

cardProps: object

Type declaration

experimentalProteins

experimentalProteins: never[] = []

height

height: string = "92%"

hoveredResidues

hoveredResidues: never[] = []

hoveredSecondaryStructures

hoveredSecondaryStructures: never[] = []

isDataLoading

isDataLoading: boolean = false

lockedResiduePairs

lockedResiduePairs: object

Type declaration

measuredProximity

measuredProximity: CONTACT_DISTANCE_PROXIMITY = CONTACT_DISTANCE_PROXIMITY.C_ALPHA

menuItems

menuItems: never[] = []

onMeasuredProximityChange

onMeasuredProximityChange: EMPTY_FUNCTION = EMPTY_FUNCTION

onResidueClick

onResidueClick: EMPTY_FUNCTION = EMPTY_FUNCTION

onResize

onResize: EMPTY_FUNCTION = EMPTY_FUNCTION

predictedProteins

predictedProteins: never[] = []

removeAllLockedResiduePairs

removeAllLockedResiduePairs: EMPTY_FUNCTION = EMPTY_FUNCTION

removeAllSelectedSecondaryStructures

removeAllSelectedSecondaryStructures: EMPTY_FUNCTION = EMPTY_FUNCTION

removeCandidateResidues

removeCandidateResidues: EMPTY_FUNCTION = EMPTY_FUNCTION

removeHoveredResidues

removeHoveredResidues: EMPTY_FUNCTION = EMPTY_FUNCTION

removeLockedResiduePair

removeLockedResiduePair: EMPTY_FUNCTION = EMPTY_FUNCTION

removeNonLockedResidues

removeNonLockedResidues: EMPTY_FUNCTION = EMPTY_FUNCTION

selectedSecondaryStructures

selectedSecondaryStructures: never[] = []

width

width: string = "100%"

hoveredResidueTooltipTextCb

Generated using TypeDoc