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

@samizdata/mozaic

v0.11.0

Published

Chart components for the web and print, built on Svelte 5 and d3, and the mozaic CLI (export embeds to SVG, PDF and PNG; eject recipes).

Readme

mozaic

Chart components for the web and print, built on Svelte 5 and d3, and the mozaic command for exporting and ejecting.

pnpm add @samizdata/mozaic d3-scale d3-array d3-shape
<script lang="ts">
	import { scaleBand, scaleLinear } from 'd3-scale';
	import { Chart, Header, Title } from '@samizdata/mozaic/frame';
	import { Plot, Svg } from '@samizdata/mozaic/core';
	import { Bars } from '@samizdata/mozaic/marks';
	import { AxisX, AxisY } from '@samizdata/mozaic/guides';
	import { theme } from '../lib/theme'; // your house style: a Theme from extendTheme()
</script>

<Chart style={theme} locale="en" alt="…">
	<Header><Title>…</Title></Header>
	<Plot x={scaleLinear().domain([0, 100])} y={scaleBand().domain(['a', 'b'])} height={80}>
		<Svg><AxisX /><AxisY /><Bars data={rows} x={(d) => d.value} y={(d) => d.name} /></Svg>
	</Plot>
</Chart>

Modules

| Import | Contents | | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | @samizdata/mozaic/core | Plot, Svg, Html, Canvas, Facets, usePlot, useChart, useTheme, useLocale, scaled, position, mm, pt | | @samizdata/mozaic/frame | Chart, Header, Title, Subtitle, Footer, Source, Notes, Byline, Logo, DataTable, DataDownload | | @samizdata/mozaic/marks | Bars, Line, Area, Points, Rects, Arcs, Text, Rules, GeoPath, Voronoi, LineEndLabels, Treemap, Waffle, Dumbbell, Arrows, Slope, Beeswarm, Hemicycle, Intervals | | @samizdata/mozaic/guides | AxisX, AxisY, GridX, GridY, Legend, ColorRamp, SizeLegend, Key | | @samizdata/mozaic/annotations | Callout, Arrow, Label, RefLine, RefBand | | @samizdata/mozaic/interactive | PointerArea, Tooltip, ButtonGroup, Scroller | | @samizdata/mozaic/table | Table, Sparkline, toCSV | | @samizdata/mozaic/transforms | stack, bin, groupBy, rollup, indexTo, dodge, treemapLayout, avoidOverlap, hemicycleLayout, kernelSmooth, loess | | @samizdata/mozaic/styles | base, extendTheme, checkTheme, rampSteps, contrastRatio (house styles live with each brand) | | @samizdata/mozaic/locale | createLocale (en, ro, ru) | | @samizdata/mozaic/embed | Embed, useEmbedParams, embedCode, hostScript, observeHeight | | @samizdata/mozaic/export | figureToSvg, downloadSvg, downloadPng, figureToPng | | @samizdata/mozaic/recipes | BarChart, ColumnChart, LineChart, ScatterChart, ArrowChart, BarDotChart, StackedBarChart, MosaicChart, PercentileChart |

CLI

The package installs a mozaic command (Node 22.17+):

mozaic export [dir]   # export every embed in a built site (default: build) to SVG, PDF and PNG
mozaic eject <recipe> # copy a recipe's source into your project (default: src/lib/recipes) to edit it
mozaic --help

export reads embed/manifest.json from the built site, serves the folder locally and renders each embed in headless Chromium:

  • web.png (2×) and web.svg at --web-width (default 640 px)
  • print-<width>.svg and print-<width>.pdf for each print width in the manifest

Options: --out <dir> (default exports), --only <slug,…>, --formats svg,pdf,png, --web-width <px>, --browser <path>.

Chromium lookup: --browser, $MOZAIC_BROWSER, Playwright's download (pnpm dlx playwright install chromium), any Chromium in Playwright's cache, then common system locations. Each is tried until one starts.

Requires Svelte 5.57+. The full guides, API reference and gallery are in the repository's docs site.