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

@synapxlab/atlas

v0.1.0

Published

Zero-dependency SVG world map — pan, zoom, markers. Designed as a building block for ChronoMap (historical atlas).

Downloads

61

Readme

@synapxlab/atlas

Zero-dependency SVG world map — pan, zoom, markers, level-of-detail. TypeScript + SCSS.

🇫🇷 Lire en français

Atlas renders any GeoJSON FeatureCollection as an interactive SVG world map. It handles pan (drag), zoom (wheel + pinch), markers (lat/lng points with click callbacks) and LOD (auto-swap between multiple geometry resolutions based on the current zoom). No D3, no Leaflet, no MapLibre — just SVG and vanilla TS.

Designed as a building block for ChronoMap (historical atlas) but usable standalone for any geo-visualisation.

Install

npm install @synapxlab/atlas

Quick start

import { Atlas } from '@synapxlab/atlas';
import '@synapxlab/atlas/style';

const atlas = new Atlas({
  container: document.getElementById('atlas')!,
  world:     myGeoJSON,          // optional
  markers: [
    { lat: 48.85, lng:   2.35, label: 'Paris',    color: '#dc2626' },
    { lat: 35.68, lng: 139.69, label: 'Tokyo',    color: '#16a34a' },
  ],
  onMarkerClick: m => console.log('clicked', m),
  onView:        v => console.log('view', v),     // fired on pan/zoom
});

Features

Level of Detail (LOD)

Pass multiple geometry sources sorted by minZoom. Atlas auto-swaps to the highest-resolution source whose threshold is reached.

new Atlas({
  container,
  worlds: [
    { minZoom: 1, data: world110m },  // always active
    { minZoom: 3, data: world50m  },  // swaps in at zoom ≥ 3
    { minZoom: 6, data: world10m  },  // swaps in at zoom ≥ 6
  ],
});

// Later — replace LOD set entirely
atlas.setWorlds([{ minZoom: 1, data: customGeoJSON }]);

Projections

Currently supported: equirectangular (default, linear lng/lat → x/y) and mercator (Web Mercator, clipped at ±85° latitude).

new Atlas({ container, projection: 'mercator' });

Pan & zoom

  • Drag = pan (mouse, touch, pen via Pointer Events)
  • Mouse wheel = zoom in/out
  • Two-finger pinch = zoom on touch
  • atlas.setView({ center: [lng, lat], zoom }) for programmatic moves

Markers

atlas.setMarkers([{ lat, lng, label, color, id, radius }]);
atlas.addMarker({ lat, lng, label, id: 'tambora' });
atlas.removeMarker('tambora');
atlas.getMarkers();

Click emits both the onMarkerClick(m) callback and a bubbling CustomEvent('markerclick', { detail: m }) on the container.

Theme

'light' (default), 'dark', or 'auto' (follows prefers-color-scheme).

API

class Atlas {
  constructor(options: AtlasOptions);

  // Pan/zoom
  setView(view: Partial<AtlasView>): void;
  setCenter(center: LngLat): void;
  setZoom(zoom: number): void;
  getView(): AtlasView;

  // Geometry
  setWorld(world: GeoJSONFeatureCollection | null): void;
  setWorlds(worlds: AtlasWorldSource[]): void;

  // Markers
  setMarkers(markers: AtlasMarker[]): void;
  addMarker(m: AtlasMarker): void;
  removeMarker(id: string): void;
  getMarkers(): AtlasMarker[];

  // Lifecycle
  render(): void;
  destroy(): void;
}

Where to get world data

Atlas is geometry-agnostic. Common sources:

TopoJSON can be converted to GeoJSON using topojson-client — Atlas expects GeoJSON.

Status

Early release — public API may evolve. Markers stable, pan/zoom stable, LOD stable. Time-varying geometries (borders that change over a date cursor) are planned for v0.3.

License

MIT © synapxLab