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 🙏

© 2026 – Pkg Stats / Ryan Hefner

molecular-visualizer

v1.2.0

Published

SMILES to 3D Molecular Visualizer - Web-based molecule visualization with measurement tools, PubChem search, and dark mode

Downloads

90

Readme

Molecular Visualizer

SMILES to 3D Molecular Visualizer - A powerful web-based tool for visualizing molecular structures.

npm version License: MIT

Features

  • SMILES Input - Enter SMILES strings to generate 3D molecular structures
  • File Upload - Import XYZ and PDB files
  • Multiple Styles - Stick, Sphere, Ball+Stick, Line, Cross, Cartoon, Surface
  • Measurements - Distance, Angle, and Dihedral angle measurements
  • PubChem Search - Search compounds by name or CID
  • Export - Save as PNG or SVG images
  • Dark Mode - Easy on the eyes for long sessions
  • Molecular Properties - MW, H-bond donors/acceptors, atom counts
  • Presets - Quick configuration for different use cases
  • Keyboard Shortcuts - Efficient navigation

Installation

npm

npm install molecular-visualizer

Download

Download the standalone package from Releases

Usage

Method 1: Standalone HTML

Copy index.html and the lib/ folder to your project:

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="css/styles.css">
</head>
<body>
    <div id="viewer-container"></div>
    
    <script src="lib/3Dmol-min.js"></script>
    <script src="lib/openbabel.js"></script>
    <script src="lib/openbabel.wasm"></script>
    <script src="lib/openbabel.data"></script>
    <script src="js/app.js"></script>
</body>
</html>

Method 2: As npm Dependency

// Import styles
import 'molecular-visualizer/css/styles.css';

// The app auto-initializes when loaded
// Just include the HTML element:
/*
<div id="viewer-container"></div>
<div class="controls">
    <input type="text" id="smiles-input" placeholder="SMILES...">
    <button id="visualize-btn">Visualize</button>
</div>
*/

Method 3: Local Development

# Install dependencies
npm install

# Start development server
npm start

# Open http://localhost:8080

Method 4: Python Server (included)

# If installed via pip (see Python package)
pip install molecular-visualizer
molecular-visualizer

Quick Start

// Visualize a molecule
const smiles = "CCO"; // Ethanol
document.getElementById('smiles-input').value = smiles;
document.getElementById('visualize-btn').click();

API

Configuration Options

// Style options: 'stick', 'sphere', 'ball+stick', 'line', 'cross', 'cartoon', 'surface'
viewer.setStyle({}, { stick: { radius: 0.2 } });

// Background colors
viewer.setBackgroundColor('white'); // or 'black', 'lightgray', 'transparent'

Keyboard Shortcuts

| Key | Action | |-----|--------| | R | Reset view | | +/- | Zoom in/out | | ↑↓←→ | Rotate molecule | | Space | Toggle auto-rotation | | H | Show shortcuts | | Esc | Clear selection |

Examples

See example.html for embedding examples.

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 11+
  • Edge 79+

Dependencies

Development

# Clone the repository
git clone https://github.com/你的用户名/molecular-visualizer.git
cd molecular-visualizer

# Install dependencies
npm install

# Run tests
npm test

# Start dev server
npm run dev

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Changelog

See CHANGELOG.md for version history.