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

@jabbla/graph

v1.2.4

Published

javascript svg graph library

Readme

Graph

npm version

demo

Changelog

v1.2.3

  1. add node toolTip config

Basic Usage

install

You can install the library via npm

npm install @jabbla/graph
import Graph from '@jabbla/graph'

or via CDN

<script src="https://cdn.jsdelivr.net/npm/@jabbla/graph/dist/graph.min.js"></script>
var Graph = window.Graph

init

var renderer = Graph.init(options)

options.el

root element of graph

var options = {el: '#container'};

options.width options.height

specify svg width and height

var options = {el: '#container', width: 200, height: 200};
//output: <svg width="200" height="200"></svg>

options.backgroundColor

backgroundColor of svg element

var options = {
    backgroundColor: '#F6F9FB'
}

options.toolBox

show toolBox

var options = {
    toolBox: true //default true
}

var options = {
    toolBox: {
        zIndex: '100'   //specify toolBox z-index
    }
}

options.svgPanZoomConfig

use library svg-pan-zoom.js, you can customize behaviors on you own

default configurations below, or you can cover it.

var options = {
    svgPanZoomConfig: {
        controlIconsEnabled: true //default true
    }
};

click ariutta/svg-pan-zoom for more infomation

render

render svg with renderOptions

renderer.render(renderOptions)

renderOptions.nodes

graph nodes of current render-frame

{
    nodes: [
        {
            id: 'a',
            name: 'a'
        },
        {
            id: 'b',
            name: 'b'
        }
    ]
}

node.id:id for single node,this field must be unique.

node.name:name for single node.

node.classList:classList for single node,default 'node' class will be applied on node.

renderOptions.links

graph links for current-frame

{
    links: [
        {
            source: 'a',
            target: 'b'
        }
    ]
}

link.source:source-node(node.id)

link.target:target-node(node.id)

renderOptions.linkConfig

global link config

line or curve

{
    linkConfig: {
        lineType: 'curve' //curve(default),line
    }
}

renderOptions.rowConfig

row config

you can specify row gap、height

{
    rowConfig: {
        gap: 100, //default 100
        height: 35 //default 
    }
}

renderOptions.columnConfig

column config

specify column gap

{
    columnConfig: {
        gap: 20 //default 20
    }
}

renderOptions.node

global node config

single node config will cover renderOptions.node

node.formatter

default formatter will return node.name

{
    node: {
        formatter(node){
            return node.name; //default
        }
    }
}

node.tooltip

node tooltip config

{
    node: {
        tooltip: {
            visible: true, //default true
            formatter(nodeOptions){
                return nodeOptions.name;    //you can also return HTML Text
            }
        }
    }
}

node.icon

specify icon which locate at the left of node-text

there are several built-in icons: sql_icon,spark_icon

{
    node: {
        icon: {
            id: 'sql_icon', //icon id
            color: 'red'    //color for icon
        } 
    }
}

destroy

removeChild from container

renderer.destroy();