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

@macrostrat/d3-timescale

v3.0.0

Published

Interactive ICS geological timescale

Downloads

172

Readme

geo-timescale

npm version

An interactive, zoomable geologic time scale built with D3.js, showing the International Chronostratigraphic Chart — eons down to stages, with the ratified boundary ages.

Installing

npm install @macrostrat/d3-timescale

Usage

import { geoTimescale } from "@macrostrat/d3-timescale";

geoTimescale("#timescale-container", config);

The optional config object can contain the following properties:

| Property | Default | Description | | --------------- | -------------------- | ------------------------------------------------------------------ | | width | 960 | Width of the SVG in pixels | | height | 400 | Height of the SVG in pixels | | tickLength | 10 | Length of the age ticks on the scale bar | | neighborWidth | 25 | Width reserved for neighboring intervals on zoom | | fontSize | 12 | Label font size in pixels | | intervals | bundled English data | Interval tree to display, e.g. a localized one (see Data) |

Click an interval to zoom to it; click the focused interval to zoom back out.

The chart is keyboard accessible: Tab focuses it, the arrow keys move between intervals (Left/Right along a row, Up to the parent, Down into the children), and Enter or Space zooms like a click.

geoTimescale returns an object with the currently focused interval node (focus) and, while hovering, the ancestor path of the hovered interval (sequence).

Demo

The demo (index.html) runs straight from src/ (d3 is loaded from a CDN), so a fresh clone needs no install or build — just a static file server:

npm run demo # runs npx serve; any static file server works

and open the printed URL.

Data

The interval data in src/intervals.json is generated from the ICS chart linked-data published by the International Commission on Stratigraphy, and currently reflects chart version 2026/06. It replaces the Paleobiology Database snapshot used by earlier versions of this package.

To regenerate it (for example when the ICS publishes a chart revision):

npm run build:data

The build script can also produce the interval names in any language present in the ICS data (en, nl, nl-be, de, fr, es, zh, ...):

node scripts/build-intervals.js --lang=nl   # writes src/intervals.nl.json

The subseries names follow the geochronologic (units of time) convention by default: "Early Jurassic", Dutch "Vroeg-Jura". Pass --convention=stratigraphic for the chronostratigraphic (units of rock) qualifiers instead: "Lower Jurassic", Dutch "Onder-Jura" — the two column heading options on the ICS chart.

Two names are not part of the ICS data and are composed by the script itself: the root node ("Geologic Time") and the subseries qualifiers above. For languages without a LOCALE entry in the script these fall back to English, with a warning. To fully localize a new language, add an entry to LOCALE in scripts/build-intervals.js with the root name, the qualifiers for both conventions, and how a qualifier joins the base name (a space in English, a hyphen in Dutch). Pass the generated file to the intervals config option to display it.

See the header comment in scripts/build-intervals.js for details on the data format and the few documented corrections applied to the upstream data.

The generated files ship with the npm package, for use with the intervals config option:

import dutchIntervals from "@macrostrat/d3-timescale/intervals.nl.json" with { type: "json" };

geoTimescale("#timescale-container", { intervals: dutchIntervals });

Releasing

Releases are automated with release-it. With a clean working tree, an npm login, and a GITHUB_TOKEN environment variable (e.g. export GITHUB_TOKEN=`gh auth token` ):

npm run release

This lints and builds, bumps the version, turns the changelog's Unreleased section into a dated release section, commits, tags, publishes to npm, and creates the GitHub release. To release the version already in package.json (like the first 3.0.0), run npm run release -- --no-increment.

Funding

Development of first version supported by NSF EAR-0949416.