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

@zakkster/lite-chartforge

v1.0.0

Published

Data-viz palette designer. Perceptually linear, CVD-safe, APCA-annotated sequential, diverging and categorical ramps.

Readme

@zakkster/lite-chartforge

npm version Zero-GC sponsor npm bundle size npm downloads npm total downloads lite-signal peer TypeScript Dependencies License: MIT

A data-viz palette designer built bottom-up in OKLCh. Reactive ramp construction, perceptual audits (CVD, APCA, gamut coverage, monotonicity), repair kernels (linearize L, equalize deltaE, chroma-only gamut compression), export adapters for d3 / Plotly / ECharts / Highcharts / matplotlib, and reactive value-to-color scales — all with zero-GC hot paths.

Single-file ESM per subpath, tree-shakeable, peers on @zakkster/lite-signal and @zakkster/lite-ease.

npm install @zakkster/lite-chartforge @zakkster/lite-signal @zakkster/lite-ease

The pipeline

Chartforge is designed around a four-stage pipeline. Each stage lives at its own subpath and can be used independently.

  design  ->  audit  ->  repair  ->  export
  ------      -----      ------      ------
  core        core       ./repair    ./vendor/{d3,plotly,echarts,...}
                                     ./scale

Design a ramp reactively:

import { createSequentialRamp } from '@zakkster/lite-chartforge';
import { easeInOutQuad } from '@zakkster/lite-ease';

const ramp = createSequentialRamp({
  from:    { l: 0.20, c: 0.10, h: 280 },
  to:      { l: 0.90, c: 0.18, h: 100 },
  curve:   easeInOutQuad,
  huePath: 'short',
  steps:   256
});

Audit for perceptual issues:

import { auditRamp } from '@zakkster/lite-chartforge';

const report = auditRamp(ramp);
// {
//   monotonic: { passed: true, deltaE_cv: 0.046, ... },
//   gamut:     { srgb: 0.47, p3: 0.63, rec2020: 1.0, violations: [...] },
//   cvd:       { protanopia: true, deuteranopia: true, tritanopia: true, ... },
//   apca:      { adjacent: [...], violations: [] }
// }

Repair issues perceptually (never by naive RGB clipping):

import { compressGamut, equalizeDeltaE } from '@zakkster/lite-chartforge/repair';

// Reduce chroma at constant L and h until every stop fits sRGB.
const compressed = compressGamut(ramp, 'srgb');

// Then rebalance for uniform adjacent deltaEok.
const final = equalizeDeltaE(compressed);

Export to your chart library of choice:

import { toPlotlyColorscale } from '@zakkster/lite-chartforge/vendor/plotly';
import { toD3ColorArray }     from '@zakkster/lite-chartforge/vendor/d3';
import { toMatplotlibPython } from '@zakkster/lite-chartforge/vendor/matplotlib';

Plotly.newPlot(el, [{
  z: data, type: 'heatmap',
  colorscale: toPlotlyColorscale(final)
}]);

Or scale values to colors reactively:

import { createSequentialScale } from '@zakkster/lite-chartforge/scale';
import { effect }                from '@zakkster/lite-signal';

const { scale, setDomain } = createSequentialScale(ramp, { domain: [0, 100] });

effect(() => {
  const fn = scale();                  // subscribes to ramp + domain changes
  for (const point of data) {
    point.color = fn(point.value);     // fast, no signal reads in the loop
  }
  renderChart(data);
});

Subpaths

| Import path | What it gives you | | --------------------------------------------------- | ---------------------------------------------------- | | @zakkster/lite-chartforge | Ramps, palettes, audits — the core. | | @zakkster/lite-chartforge/repair | linearizeLightness, equalizeDeltaE, compressGamut, and per-arm diverging variants. | | @zakkster/lite-chartforge/scale | Reactive value-to-color scale primitives. | | @zakkster/lite-chartforge/vendor | Generic shape utilities (hex array, stops, RGB tuples, oklch strings). | | @zakkster/lite-chartforge/vendor/d3 | d3-shape adapters. | | @zakkster/lite-chartforge/vendor/plotly | Plotly colorscale + colorway. | | @zakkster/lite-chartforge/vendor/echarts | ECharts visualMap. | | @zakkster/lite-chartforge/vendor/highcharts | Highcharts colorAxis. | | @zakkster/lite-chartforge/vendor/matplotlib | JSON payload + Python source for ListedColormap. |

The zero-GC contract

The core sample, at, and swatches paths write into caller-owned storage without allocation. Reactive ramps own a stable-identity Float64Array(3 * steps) LUT slab that is rebuilt in place when inputs change.

For reactive repair callers, every kernel accepts caller-owned scratch buffers:

const outSlab      = new Float64Array(3 * 256);
const cumBuffer    = new Float64Array(256);
const scratchLabA  = new Float64Array(3);
const scratchLabB  = new Float64Array(3);

effect(() => {
  equalizeDeltaE(ramp, { outSlab, cumBuffer, scratchLabA, scratchLabB });
  renderPalette(outSlab);
});

With all opts provided, the entire equalize path allocates zero bytes on subsequent reactive ticks — verified over 5000 calls in the test suite.

Live references warning

lut(), colors(), and swatches() return LIVE references into internal storage. Do not store their results in React/Vue/Solid state directly: shallow equality will silently miss updates, and cached snapshots will mutate out from under you. Instead:

  • Snapshot for framework state: swatches().map(c => ({ ...c }))
  • Or read reactively: subscribe via swatches.subscribe(fn), or read inside an effect(...) from @zakkster/lite-signal.

Peer dependencies

  • @zakkster/lite-signal ^1.3.0 — reactive core
  • @zakkster/lite-ease ^1.1.0 — curve functions

Ecosystem-compatible curve sources also work as curve params: @zakkster/lite-ease-params (tunable Back/Elastic/Bounce factories) and @zakkster/lite-cubic-bezier (CSS-compatible bezier runtime).

Related

Chartforge is one of the @zakkster/lite-* micro-libraries built for allocation-sensitive JavaScript: reactive signals, DOM bindings, color tooling, UI headless primitives, charts, netcode.

License

MIT (c) Zahary Shinikchiev