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

@weasel-js/minimap

v1.14.0

Published

A minimap for a weasel canvas: a read-only overview with a viewport indicator you drag to pan, fit math, and a linked crosshair between surfaces.

Readme

@weasel-js/minimap

A minimap with linked cursors, in two forms that share one set of actions.

Part of weasel, a domain-agnostic 2D scene-graph canvas kit for React. See the API reference.

npm install @weasel-js/minimap

| Form | Where it paints | Install | |---|---|---| | createMinimapContribution({ rect, fit }) | A <CanvasView> on the main canvas's own surface | One ambient entry | | <MinimapCanvas> | A canvas of its own | A component beside the main canvas |

The contribution

It is the worked example of a SurfaceContribution that uses every role:

| Role | What it holds | |---|---| | views | The minimap: a <CanvasView> at rect, its camera a fit over the scene | | actions | minimap.center (press) and minimap.pan (drag), which move rootView | | bindings | pointerDown and drag, scoped with views: [id] so they outrank the active tool inside the minimap and never fire outside it | | overlay | The visible-rect indicator, painted only in the minimap; the linked crosshair, painted in whichever view the pointer is not over | | attach | Reads the scene and pointer deps, and repaints while the crosshair shows |

Build it once (useMemo, or module scope): each instance keeps the live state its layers read, and attach runs once per instance.

The detached form

<MinimapCanvas> runs the same two actions on a dispatcher of its own, bound unscoped since that dispatcher routes no views, with rootView answering the mainView / onMainViewChange props. Put one <PointerContextProvider> around it and the main canvas, and give the main canvas createLinkedCursorContribution(), for crosshairs in both directions.

Why rootView

Inside the minimap's view, the view dep answers the minimap's camera — that is what lets every other action work in a view. An action there that must move the main camera reads rootView, never view; viewport.dragPan reads view and so pans whichever view the drag lands in.