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

massive-sprites

v0.1.0

Published

Plots and traces a lot of sprite images onto logical branch graph

Readme

massive-sprites

A WebGL / WASM library for rendering, moving, and updating large numbers of sprites, text labels, and polylines at high frequency

massive-sprites

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. License: MIT


(Japanese language is here/日本語はこちら)

What is this?

(Documents under constructing!)

You may want to place large numbers of images and labels on top of a logical coordinate system. You may want to move them smoothly, swap them, fade them, and combine them with polylines. And you may want a rendering foundation that does not fall apart even when add / update / remove is repeated at high frequency.

That is what massive-sprites is built for.

massive-sprites can handle the following on an arbitrary 2.5D logical coordinate system:

  • Sprite images
  • Text labels
  • Polylines
  • Layered draw ordering
  • Cameras and camera auto-tracking
  • Picking objects from coordinates
  • Easing-based interpolation for almost all parameters
  • Distance-based pseudo LOD and scaling
  • High-level route modeling through the logical-graph API

Internally, the library uses WebGL and WASM, with a strong focus on cases where a large number of objects must be updated continuously.

Rendering, animation, and interaction logic are separated from the drawing target implementation, so it can also be integrated into other systems that manage WebGL objects directly. The standard package also includes a wrapper that renders into an HTML Canvas and supports mouse interaction, so it can be integrated into ordinary web pages as well.

The logical-graph API is a high-level computation layer that manages route graphs with explicit topology and lets you place moving entities on top of them. You define a physical topology in world coordinates, then describe positions as ratios between route endpoints and place or move sprites accordingly.

It can be used for route maps, facility diagrams, topology views, transport systems, traffic flow visualizations, logical graphs, and game-like UI layouts in arbitrary coordinate spaces. The following is the smallest example that places one sprite on an HTML Canvas:

import {
  createObjectCanvasRenderer,
  loadWasmModule,
} from 'massive-sprites';

// Get the existing HTML Canvas element
const canvas = document.getElementById('main-canvas')!;

// Load the WASM module and create the renderer
const wasmModule = await loadWasmModule('/assets/massive-sprites/compute.wasm');
const renderer = createObjectCanvasRenderer(canvas, wasmModule);

// Start the renderer
renderer.start();

// Helper for loading image files by URL
const loadBitmap = async (url: string) =>
  createImageBitmap(await (await fetch(url)).blob());

// Initialize the renderer
await renderer.initializeScope(async () => {
  // Create a texture atlas
  const atlasId = renderer.allocateAtlas();
  // Register an image to render
  const carBitmap = await loadBitmap('/assets/car.png');
  await renderer.registerImage(atlasId, 'car', carBitmap);

  // Wait until the sprite has been added
  await renderer.addSprite(
    {
      sx: { value: 0 },  // World-space position
      sy: { value: 0 },
      elements: [        // Image elements inside the sprite
        {
          imageId: 'car',          // Registered image ID
          scale: { value: 0.25 },  // Image scale
        },
      ],
    },
    true  // Awaitable
  );

  // Automatically move the camera so the sprite fits in view
  renderer.adjustCameraPosition({ interpolation: null });
});

The demos show combinations of sprites, text, polylines, tracking, and logical-graph:

Playground demo

logical-graph demo

Key Features

  • Can place, update, and remove large numbers of sprites (>10000).
  • Can combine multiple images, text labels, borders, and leader lines in a single sprite.
  • Supports surface, billboard, and billboard_perspective render modes per element.
  • Supports interpolation for movement, rotation, offset, opacity, and scale.
  • Can add polylines as independent objects.
  • Supports picking, camera events, and HTML Canvas coordinate helpers.
  • Supports automatic camera tracking for sprite swarms and distance-based scaling control.
  • The logical-graph API enables high-level route search, route rendering, and movement on routes.
  • Uses WebGL and WASM to keep rendering fast.

Requirements

  • A modern browser with WebGL support
  • A runtime environment with WASM (WebAssembly) support

Installation

The library is available as an npm package:

npm install massive-sprites

Documentation

For detailed documentation and advanced features, please visit our GitHub repository.

License

MIT License.