visyn_component_protein_viewer
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Molstar React Component

A React wrapper for the well known Molstar viewer (https://github.com/molstar/molstar). Additionally it has inbuilt functionality to focus on specific residues (and chains) and to retrieve the surroundings of the focused structures.

Usage

Provide a 4-letter pdb id and a residue id (additionally a chain can be supplied) to focus. The component will load the structure and then automatically focus on the residue. Note that the parent element of this component needs to be positioned 'absolute' to correctly work. Also the css needs to be imported for the controls to be displayed correctly. See below for a minimal working example:

export function MolstarTest() {
    return <div>
      <div style={{
        // Make the parent element have position: absolute
        position: 'absolute',
        width: 500,
        height: 500
      }}>
        <MolstarReact
          // 4 letter pdb id
          pdbId="7bv2"

          // Residue id to focus
          ligandName="F86"

          // Optional chain id
          chainName="P"

          // Callback when residues get queried
          onFocusLigand={(residues) => {
            console.log(residues)
          }}
        ></MolstarReact>
      </div>
  </div>
}

Build Instructions

Readme

Keywords

none

Package Sidebar

Install

npm i visyn_component_protein_viewer

Weekly Downloads

0

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

26.3 MB

Total Files

38

Last publish

Collaborators

  • datavisyn