Changelog
Newest first. Follow by feed.
0.2.1
Patch Changes
The README stated three bundle sizes and all three had drifted, the React one by 2 kB in the flattering direction, because nothing measured them. They are corrected — 8.3 kB for the core, 12.5 kB with the React components, 14.8 kB with comparison, 17.1 kB with the heatmap as well — and
pnpm checknow fails on a figure the package no longer has, or on an entry point the README never mentions.Accessibility covers the heatmap too: it always carries
role="img"and a generatedaria-label, where an unlabelled sparkline marks itselfaria-hidden, andcellTitlesis explained along with why it is on in the component and off inheatmapSvg.No runtime code changed, so the published bundles are identical to 0.2.0.
0.2.0
Minor Changes
A calendar heatmap: one square per day, one column per week, from a new
/heatmapentry.<PackageHeatmap>in React,heatmapSvg()for a string, andheatmapGeometry()for the squares as data — all three drawing from one computation, so a server render and the client agree square for square.It shows the two things a sparkline averages away: where in the year a quiet stretch fell, and the weekday rhythm. Across react's last year Wednesday averages 20.6M against Saturday's 11.3M.
The ramp is opacity over
currentColor, so lightness alone carries the value: it inherits the surrounding text colour, inverts on a dark ground with no second palette, and survives monochrome.emptyColorgives the quietest level a colour of its own for GitHub's two-tone look.scaledefaults to"linear"spanning zero, because"quantile"fills the ramp evenly and so draws a year that doubled and a year that never moved identically. Days npm reported nothing for are hatched rather than shaded, since a solid square would state a number nobody measured.
Patch Changes
computeTrend,compareandanalyseall answered nonsense for a range with no points. The first two threw a rawTypeError, and a throw inside a React render takes the whole tree with it — on a server that is the page, not the chart.analysewas quieter and worse: NaN formeanandmedian, andundefinedforpeakandtroughbehind a type promising aDownloadPoint.All three now throw
PackageTrendsErrorwith the package named, and the hooks route a failed derivation into theerrorstate they already had, sorenderErrorhandles it like any other failure. Renderers are unchanged:sparklineandheatmapGeometrycan honestly draw nothing, and<PackageHeatmap>now shows its fallback rather than a zero-sized<svg>.svgPropsis typed to accept thedata-*attributes its own documentation promised; the type had been rejecting them.
0.1.0
Minor Changes
Column charts, a fixed
domainso two charts can be compared, point marks, settable up/down colours, andanalyse()for writing about a series programmatically.Adds a
stylesobject for weight, display and spacing;numberFormatandpercentFormattakingIntl.NumberFormatoptions;interactivefor pointer and keyboard inspection;aggregate: "month";between()for an explicit date range; abandchart of each period's low, mean and high; CSS lengths forwidthandheightso a chart can scale with its text;curvefor smooth, stepped or straight lines;strokeDasharray,pathPropsandfillPatternfor patterned charts; andsvgPropsfor anything else the<svg>should carry.Also repairs the zeros npm reports for days it has no data for. Taken literally they understate the mean by a quarter and invert the weekday profile; they are now interpolated, and listed in
gapDays.Compare several packages at once, from a new
/compareentry:<PackageComparison>as an overlaid chart or a row each,compare()andindexSeries()in the core, andfetchManyso a page asks for each distinct name only once.scale="indexed"restates each series against its own start, which is the only honest way to put packages of very different sizes on one chart.First release. npm download trends as a sparkline, a line of text or a KPI block, with a framework-agnostic core and a React entry. Pass
datafrom a server-sidefetchDownloadsto render without a request per visitor.