npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

molstar-react

v0.5.2

Published

Molstar as a react component

Downloads

290

Readme

Molstar React

Npm Version downloads license Twitter Follow

A react component for adding the Molstar Macromolecular Visualiser to your app.

Installation

With npm:

npm install molstar-react

Basic Use

To use:

import Molstar from "molstar-react";

export const App = () => {

  return (
    <div>
      <Molstar pdbId="1LOL" />
    </div>
  );
}

export default App;

This will render a full page Molstar plugin, with the structure 1LOL loaded.

Props

pdbId

You can pre-load an official PDB structure by supplying its 4 letter ID as a prop.

url

You can also pre-load a structure by passing in the URL of the file - as long as it is a file type that Molstar supports.

file

Thirdly, you can provide a file object, which should have a filestring property and a type property ("pdb", "mmcif" etc. - anything that molstar itself natively supports).

dimensions

By default the molstar plugin will take up the full screen. If you want it to act as just a normal div, you can provide a [width, height] array instead.

className

A class name to apply to the outer parent element.

useInterface

If true, the full Molstar interface will be used around the core canvas.

showControls

If true and useInterface is true, the controls will be shown around the sides of the interface. Only recommended for large sizes.

showAxes

If true, axes will appear in the bottom left corner.

Changelog

Release 0.5.2

13 May 2024

  • Fixed 'Invalid data cell' issue.
  • Fixed duplicate-fetch issue.

Release 0.5.1

26 April 2022

  • Fixed issue where ?key=value params in URLs would break extension parsing.

Release 0.5.0

4 March 2022

  • Added option to provide filestring directly.
  • Added option to toggle axes in bottom left corner.

Release 0.4.0

29 January 2022

  • Now uses Plugin and PluginUI directly instead of Viewer.
  • Class name prop.
  • Plugin now clears first when pdbID/URL prop changes.

Release 0.3.0

3 August 2021

  • Added ability to control dimensions rather than always being full-screen.
  • Removed distinction between viewer and non-viewer.

Release 0.2.1

16 July 2021

  • Fixed re-render initialising.
  • Component now disposes of viewer when removed.

Release 0.2.0

13 July 2021

  • Made distinction between Molstar Viewer and Molstar Core.
  • Enabled custom viewer options.
  • Added option to load structure from URL.
  • Made pre-loading structure optional.

Release 0.1.0

3 July 2021

  • Basic full screen Molstar.
  • Added fetching by PDB ID.