everburstSun / dash-molstar

The molstar plugin for plotly dash framework
GNU Lesser General Public License v2.1
15 stars 3 forks source link

dash-molstar

Introduction

dash-molstar is a Dash component library that integrate Molstar Viewer into Dash framework. Molstar is a modern, web-based software framework for molecular visualization and analysis. With Dash, one can use pure python code to control some basic operations of molstar and easily embed this plugin into their web page.

Installation

This library can be easily installed with pip:

pip install dash-molstar

Usage

Import dash_molstar and then you can add it to your layout as you did to other components:

import dash_molstar
from dash import Dash, html

app = Dash(__name__)
app.layout = html.Div(
    dash_molstar.MolstarViewer(
        id='viewer', style={'width': '500px', 'height':'500px'}
    ),
)

if __name__ == '__main__':
    app.run_server(debug=True)

Clone the repository to your local directory and run the following command to see the demo:

python usage.py

Documentation

To see the detailed introduction of parameters and callbacks, check out the Documentation.