Git Product home page Git Product logo

viztein's Introduction

Viztein

Viztein is a React library component for visualizing proteins and other macromolecules. The code is a light wrapper around NGL which uses WebGL for rendering graphics.

npm version License: MIT

Quickstart

$ npm install [email protected]
import Viztein from 'viztein';

class Example extends React.Component {
  render() {
    return (
      <Viztein data={{ filename: "https://files.rcsb.org/download/4hhb.pdb" }} />
    );
  }
};

JSFiddle

Examples

Default with Custom Viewport Style

Ball and Stick

Ball and Stick Custom Ratio

Custom Color

Installation

NPM

# latest stable
$ npm install viztein

Component Properties

Data (Object) Required

The macromolecule source and display config data.

Requires a filename key which can be a file path or url path to the source data. Supported file types are mmCIF, PDB, PQR, GRO, SDF, MOL2, and MMTF. A config key can also be passed in to change the display options. Each config option contains a type and input. The type is the name of the NGL function to use and the input are the arguments to pass in. A list of display functions is found in the NGL molecular display documentation.

data Prop Example:

{
  filename: 'https://files.rcsb.org/download/4hhb.pdb',
  config: [
    {
      type: 'addRepresentation',
      input: ['ball+stick', { color: 'orange' }]
    }
  ]
}

ViewportId (string) optional

Id of the div element to render the graphic inside. When rendering multiple Viztein components on the same page, pass in an unique viewportId prop to each Viztein component.

viewportId Default

'viztein-viewport'

ViewportStyle (object) optional

CSS style of the viewport.

viewportStyle Default

{
  backgroundColor: 'black',
  width: '500px',
  height: '500px'
}

Dev Build

$ git clone https://github.com/mcmenemy/viztein.git
$ cd viztein
$ npm install
$ npm start

viztein's People

Contributors

thetechnocrat-dev avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

viztein's Issues

Issues with the component

Hi McMenemy!

Your example looks very good and I was trying to use your viztein tool, I essentially copy&pasted your example, but it only showed "example component" on my page, would it be convenient for you to look at what may the problem be?

My code:
<Viztein
data={{ filename: "https://files.rcsb.org/download/4hhb.pdb" }}
/>

Outcome:
image

The produced div in the dev tool:
image

Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.