Autodesk / notebook-molecular-visualization

2D and 3D molecular visualization in Jupyter notebooks using 3DMol.js and D3.js
http://moldesign.bionano.autodesk.com
Apache License 2.0
75 stars 20 forks source link

Nbmolviz2d/3d to React #22

Closed justinmc closed 8 years ago

justinmc commented 8 years ago

nbmolviz2d and 3d are being moved to React instead of Backbone for greater reusability. This PR will make this able to use the React version.

Waiting on https://github.com/Autodesk/notebook-molecular-visualization/pull/21.

justinmc commented 8 years ago

Currently waiting on the React versions of nbmolviz2d and 3d to be published before merging:

https://github.com/Autodesk/nbmolviz2d/pull/12 https://github.com/Autodesk/nbmolviz3d/pull/8

justinmc commented 8 years ago

This is achieved by wrapping nbmolviz2d/3d each in a light React component and Backbone view.

So for example, nbmolviz2d exports a React component that's ready to be used in any web app. We use it in this project (that sadly must use Backbone) by wrapping it in a React component (nbmolviz_2d_component.jsx) that just has the Backbone model as its state, so it rerenders whenever the model changes. Then a Backbone view required by ipywidgets wraps that (nbmolviz_2d_view.js).

justinmc commented 8 years ago

The new React versions of nbmolviz2d/3d are live:

https://github.com/Autodesk/molecule-2d-for-react https://github.com/Autodesk/molecule-3d-for-react

And this appears to be working with them directly off of npm. Merging!