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

litefold-ligand-env

v1.0.1

Published

LiteFold Ligand Environment - A web component for visualizing protein-ligand interactions with fallback example data

Readme

LiteFold Ligand Environment

A web component for visualizing protein-ligand interactions with automatic fallback to example data when APIs are unavailable.

Features

  • 🧬 Protein-Ligand Visualization: Interactive 2D visualization of molecular interactions
  • 🔄 Automatic Fallback: Loads example data when PDBe API is unavailable
  • 🎨 Rich Interactions: Displays hydrogen bonds, hydrophobic interactions, π-stacking, metal coordination
  • 📱 Web Component: Easy integration into any web application
  • 🎯 Multiple Modes: Ligand interactions, bound molecules, and chemical components

Installation

npm install litefold-ligand-env

Usage

As a Web Component

<!DOCTYPE html>
<html>
<head>
    <!-- Required dependencies -->
    <script src="https://d3js.org/d3.v5.min.js"></script>
    <link rel="stylesheet" href="node_modules/litefold-ligand-env/build/pdb-ligand-env.css" />
    <script src="node_modules/litefold-ligand-env/build/pdb-ligand-env-component-1.0.0-min.js"></script>
</head>
<body>
    <!-- Ligand interactions -->
    <pdb-ligand-env pdb-id="1cbs" pdb-res-id="200" pdb-chain-id="A"></pdb-ligand-env>
    
    <!-- Bound molecule interactions -->
    <pdb-ligand-env pdb-id="3d12" bound-molecule-id="bm1"></pdb-ligand-env>
    
    <!-- Chemical component only -->
    <pdb-ligand-env pdb-res-name="HEM" zoom-on></pdb-ligand-env>
</body>
</html>

As a JavaScript Plugin

<!DOCTYPE html>
<html>
<head>
    <script src="https://d3js.org/d3.v5.min.js"></script>
    <link rel="stylesheet" href="node_modules/litefold-ligand-env/build/pdb-ligand-env.css" />
    <script src="node_modules/litefold-ligand-env/build/pdb-ligand-env-plugin.js"></script>
</head>
<body>
    <div id="ligand-container" style="width: 600px; height: 500px;"></div>
    
    <script>
        const container = document.getElementById('ligand-container');
        const visualization = new Visualization(container);
        
        // Will automatically fallback to example data if API fails
        visualization.initLigandInteractions('1cbs', 200, 'A');
    </script>
</body>
</html>

With Module Bundlers

// Import the component
import 'litefold-ligand-env/build/pdb-ligand-env-component-1.0.0-min.js';
import 'litefold-ligand-env/build/pdb-ligand-env.css';

// Use in your HTML
// <pdb-ligand-env pdb-id="1cbs" pdb-res-id="200" pdb-chain-id="A"></pdb-ligand-env>

API Reference

Web Component Attributes

| Attribute | Type | Description | |-----------|------|-------------| | pdb-id | string | PDB identifier (e.g., "1cbs") | | pdb-res-id | number | Residue number | | pdb-chain-id | string | Chain identifier | | bound-molecule-id | string | Bound molecule ID (e.g., "bm1") | | pdb-res-name | string | Chemical component name (e.g., "HEM") | | zoom-on | boolean | Enable zoom functionality | | names-on | boolean | Show atom names | | environment | string | API environment: "production", "development", "internal" |

JavaScript API

const visualization = new Visualization(element, uiParameters, environment);

// Methods
visualization.initLigandInteractions(pdbId, resId, chainId);
visualization.initBoundMoleculeInteractions(pdbId, bmId);
visualization.initLigandDisplay(ligandId);
visualization.centerScene();
visualization.saveSvg();

Fallback Data

When the PDBe API is unavailable, the component automatically loads example data:

  • HEM (Heme): Shows metal coordination, hydrophobic interactions, hydrogen bonds, and π-stacking
  • ADP: Displays nucleotide interactions with various amino acids
  • Realistic Examples: All fallback data represents scientifically accurate molecular interactions

Interaction Types

The visualization supports various interaction types with distinct visual styling:

  • 🔗 Hydrogen Bonds: Dashed lines
  • 🌊 Hydrophobic: Solid lines
  • Electrostatic: Blue dashed lines
  • 🔥 Aromatic/π-stacking: Purple dashed lines
  • ⚙️ Metal Coordination: Teal solid lines
  • 💥 Van der Waals: Brown dashed lines
  • ⚠️ Clashes: Red dashed lines with clash markers

Browser Support

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

Dependencies

  • D3.js v5.x
  • LitElement 2.x
  • Modern browser with Web Components support

License

Apache-2.0

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Changelog

See CHANGELOG.md for details.

Issues

Report issues at: https://github.com/your-username/litefold-ligand-env/issues