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

@photonviz/map

v0.3.2

Published

Web Mercator vector-tile basemap for Photon — zero-dependency, self-hosted (MVT / PMTiles)

Readme

@photonviz/map

A Web Mercator vector basemap for Photon, rendered from scratch on WebGL2.

MVT decoding, ear-clipping triangulation, thick miter-join lines, tile math and rendering are all in this package — no Mapbox / MapLibre / Leaflet. Plots in world coordinates on a normal Photon Plot, so your data overlays it directly.

npm i @photonviz/core @photonviz/map

Quick start

import { Plot } from "@photonviz/core";
import { addMap, xyzVectorSource, lonLatToWorld } from "@photonviz/map";

const plot = new Plot(el, { equalAspect: true, boundedPan: true }); // world coords

addMap(plot, {
  source: xyzVectorSource({
    url: "https://api.maptiler.com/tiles/v3/{z}/{x}/{y}.pbf?key=YOUR_KEY",
    attribution: "© OpenStreetMap contributors © MapTiler",
    maxZoom: 14,
  }),
});

// overlay data by projecting lon/lat → world
const [x, y] = lonLatToWorld(28.98, 41.01);
plot.addScatter({ x: [x], y: [y], size: 8, color: "#f472b6" });

Tile sources

xyzVectorSource({ url, attribution })          // any XYZ .pbf endpoint
pmtilesSource({ url })                          // a single PMTiles archive (HTTP range)
pmtilesSource({ blob: file })                   // a local .pmtiles File — fully offline
pmtilesSource({ data: arrayBuffer })            // in-memory / bundled asset

GeoJSON — a whole map from one file

import { addGeoJson } from "@photonviz/map";
addGeoJson(plot, { geojson, layer: "admin" });  // no tiles, no server, no key

Or use the embedded Natural Earth 10m world (opt-in subpath, keeps the main entry small):

import { worldCountries } from "@photonviz/map/world";
addGeoJson(plot, { geojson: worldCountries, layer: "admin" });

More

  • Feature pickingmap.pickFeature(worldX, worldY){ layer, properties }.
  • StylingdefaultStyle / protomapsStyle / defaultGeoJsonStyle, or your own MapStyle (per tile-layer + properties).
  • Offline — the blob source reads byte ranges via Blob.slice(); bundle a region .pmtiles for a fully offline desktop/mobile map.
  • Framework wrappers<Map> / <GeoJson> in React & Vue, { type: "map" } series in Svelte.

License

MIT. Map data is provided by you (or the embedded Natural Earth set, public domain) — display the source's attribution.