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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-protein-network-visualizer

v1.0.2

Published

A Vue 3 component for interactive protein residue network visualization with D3.js

Downloads

16

Readme

🧬 Vue Protein Network Visualizer

A Vue 3 component for building interactive protein residue network visualizations powered by D3.js.
This library helps you render and explore protein residue interaction networks through a responsive, dynamic, and customizable visualization.


✨ Features

  • ⚡ Built with Vue 3 (Composition API) and D3.js
  • 🔍 Interactive graph with zoom, drag, and hover tooltips
  • 🎨 Customizable layout, colors, and node sizes
  • 🧩 Lightweight and easy to integrate into any Vue app
  • 🧠 Perfect for bioinformatics and scientific visualization projects

📦 Installation

Install via npm:

npm install vue-protein-network-visualizer

🚀 Quick Start

Here’s how to use the component inside your Vue 3 project:

<script setup>
import { ref, onMounted } from "vue";
import ProteinNetwork from "vue-protein-network-visualizer";

const nodes = ref([]);
const edges = ref([]);
const loading = ref(true);

async function loadData() {
  const [n, e] = await Promise.all([
    fetch("/data/nodes.json").then((r) => r.json()),
    fetch("/data/edges.json").then((r) => r.json()),
  ]);
  nodes.value = n;
  edges.value = e;
  loading.value = false;
}

onMounted(loadData);
</script>

<template>
  <div class="p-4">
    <ProteinNetwork v-if="!loading" :nodes="nodes" :edges="edges" />
    <p v-else>Loading data...</p>
  </div>
</template>

⚙️ Props

| Prop | Type | Required | Default | Description | | ------------- | -------- | -------- | ----------------------------------- | --------------------------------------------------- | | nodes | Array | ✅ Yes | [] | Array of node objects (protein residues). | | edges | Array | ✅ Yes | [] | Array of edge objects defining residue connections. | | width | Number | ❌ No | 600 | Width of the SVG canvas. | | height | Number | ❌ No | 600 | Height of the SVG canvas. | | colorScheme | Array | ❌ No | ['#1f77b4', '#ff7f0e', '#2ca02c'] | Custom color palette for nodes or edges. | | charge | Number | ❌ No | -300 | Force charge between nodes (controls spacing). |


🧠 Data Format

Example nodes.json

[
  { "id": 1, "name": "ALA", "group": "hydrophobic" },
  { "id": 2, "name": "GLY", "group": "polar" },
  { "id": 3, "name": "SER", "group": "polar" }
]

Example edges.json

[
  { "source": 1, "target": 2 },
  { "source": 2, "target": 3 }
]

🧪 Live Demo / Example App

You can explore and interact with a live example here:
👉 View Sample App

This sample app demonstrates:

  • How to load JSON data dynamically
  • Customize visual parameters
  • Interact with the network (zoom, drag, and highlight)

🧰 Development Setup

If you want to work on the library locally or modify it:

# Clone the repository
git clone https://github.com/yusufshehu/protein-d3-representation.git

# Navigate into the package directory
cd vue-protein-network-visualizer

# Install dependencies
npm install

# Build the library
npm run build

To test the component locally with a sample app:

# In the library directory
npm run build

# In your sample Vue app directory
npm install ../vue-protein-network-visualizer
npm run dev

📦 Publishing to npm

When ready to publish your library publicly:

  1. Make sure you’re logged in to npm:

    npm login
  2. Update your version in package.json:

    npm version patch
  3. Publish:

    npm publish --access public

📄 License

MIT License © 2025 Yusuf Shehu

You are free to use, modify, and distribute this project as long as proper attribution is given.


💡 Built With


👨🏽‍💻 Author

Yusuf Shehu
Full-Stack Developer • Vue.js | Laravel | D3.js

🌐 GitHub
💼 LinkedIn
🐦 Portfolio


“Bridging science and software — one protein at a time.”