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

fused-canvas

v0.1.25

Published

<h1 align="center">fused-canvas</h1> <p align="center">an easy to use framework agnostic graph canvas library</p>

Readme

image

Installation

npm install fused-canvas

Usage

import { FusedCanvas, createFusedCanvas } from 'fused-canvas';

/*
<!-- You need to provide the viewport and canvas to the createFusedCanvas function. You don't need these specific id's (or any id's at all) just two divs one in the other-->
<div id="viewport">
    <div id="canvas">
        <!-- To add a box to the graph you add a div with the class fused-canvas-component. Providing an id is optional -->
        <!-- Boxes, edges and clusters can be added before and after the initialization of the canvas -->
        <div id="box1" class="fused-canvas-component">Basic box 1</div>
        <div id="box2" class="fused-canvas-component">Basic box 2</div>
        <!-- To add an edge between boxes you provide and edge element with from and to containing id's -->
        <edge data-from="box1" data-to="box2"></edge>
        <!-- You can also create clusters which are group of nodes. The children are defined by a list of id separated by "," -->
        <cluster id="cluster1" data-children="box1,box2"></cluster>
    </div>
</div>
*/

const fusedCanvas = createFusedCanvas({
    viewport: document.getElementById('viewport'), // Viewport and canvas are mendatory
    canvas: document.getElementById('canvas'),
    mouseDown0Action: undefined, // mouseDownActions right now only support "pan". 0, 1 and 2 are the mouse buttons
    mouseDown1Action: "pan",
    mouseDown2Action: "pan",
    scrollAction: "scroll", // Can be scroll or zoom
    scrollCtrlAction: "zoom", // Can be scroll or zoom
    fitToScreen: true, // If true the canvas will fit to the screen on init
    yScaling: 1, // The scaling of the y axis, is used to compress the y axis when using dagre layout
    arrowLength: 7, // The length of the arrow head edges
    arrowPitch: 30,
    // possible values are "TB", "BT", "LR", "RL" or null
    // null will do no automatic layouting. TB means top to bottom, BT means bottom to top, LR means left to right and RL means right to left
    dagre: null,
});

// Elements can be added after the initialization of the canvas like this
const box3 = document.createElement('div');
box3.classList.add('fused-canvas-component');
box3.textContent = 'Basic box 3';
fusedCanvas.container.appendChild(box3);

/*
createFusedCanvas returns an object with the following properties:

interface FusedCanvas {
    container: HTMLElement; // This is the viewport element
    view: {
        panX: number;
        panY: number;
        zoom: number;
    };
    fitToScreen: () => void; // When called will fit the graph to the viewport
}
*/