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

@tylix/charts

v2.4.3

Published

SVG charts for Tylix .tyx pages, React, Vue, Svelte or plain JS: line, area, bar, pie, donut, scatter/bubble, gauge, calendar heatmap and sparklines, with time axes, tooltips and accessible output. No dependencies.

Readme

@tylix/charts

SVG charts with no dependencies. Use them as .tyx components in Tylix pages, as React, Vue or Svelte components, or as plain functions that return SVG strings or geometry.

| Chart | Function | .tyx component | | --- | --- | --- | | Line (optionally filled) | lineChart / lineChartSvg | <LineChart> | | Area, stacked area | areaChart / areaChartSvg | <AreaChart> | | Bar: grouped, stacked, horizontal | barChart / barChartSvg | <BarChart> | | Pie, donut | pieChart, donutChart / …Svg | <PieChart>, <Donut> | | Scatter, bubble | scatterChart / scatterChartSvg | <ScatterChart> | | Gauge | gauge / gaugeSvg | <Gauge> | | Calendar heatmap | calendarHeatmap / calendarHeatmapSvg | <Heatmap> | | Sparkline | sparkline / sparklineSvg | <Sparkline> |

All of them come with:

  • Time axes: give points a Date as x and the axis ticks on whole hours, days, weeks, months or years. Labels and tooltips are formatted to match (UTC by default; timeZone, locale).
  • Tooltips: an interactive crosshair for line and area charts (pointer and arrow keys), hover tooltips on scatter points and heatmap days, and <title> tooltips in the plain SVG output.
  • Legends: shown automatically for two or more series. legend: false hides them.
  • Accessibility: every SVG has a <title> and a plain-language <desc> ("1 series over 12 points. CPU: 10 to 80, last 64."). The components also include a visually hidden data table, and the gauge uses role="meter".
  • Theming: series colors come from --tylix-chart-1 … --tylix-chart-5. Text and gridlines use currentColor, and --tylix-chart-bg sets the surface color.
npm install @tylix/charts

In Tylix pages

page Dashboard

import { LineChart, BarChart, Gauge, Heatmap, ScatterChart } from "@tylix/charts"

state
  visits: [{ name: "Visits", data: [] }]
  cpu: 62

template
  <LineChart label="Visits" series="{{ visits }}" height="{{ 260 }}" />
  <Gauge value="{{ cpu }}" caption="CPU" needle="{{ true }}"
         thresholds="{{ [{ value: 0, color: '#16a34a' }, { value: 80, color: '#dc2626' }] }}" />
  <Heatmap label="Commits" data="{{ commits }}" />

The components load the chart geometry from /_tylix/charts/ (served by tylix dev / tylix start) and render with Tailwind-aware dark mode.

React

import { LineChart, Gauge, Chart } from '@tylix/charts/react'

<LineChart series={series} height={260} formatY={(v) => `${v}%`} />
<Gauge value={72} caption="CPU" needle />
<Chart type="heatmap" data={days} />

Vue

<script setup>
import { LineChart, BarChart } from '@tylix/charts/vue'
</script>

<template>
  <LineChart :series="series" :height="260" />
  <BarChart :series="sales" :categories="['Q1', 'Q2', 'Q3']" stacked />
</template>

Svelte 5

<script>
  import { Chart } from '@tylix/charts/svelte'
</script>

<Chart type="scatter" series={points} height={300} />

All three wrappers render the same SVG on the server and in the browser. SVG ids come from the framework's own id helper, so hydration matches. Line and area charts get the interactive crosshair once mounted. Chart options can be passed as props or all together as options={...}.

Angular and anything else

renderChart(type, data, options) returns an SVG string:

import { renderChart } from '@tylix/charts'

this.svg = this.sanitizer.bypassSecurityTrustHtml(
  renderChart('bar', this.series, { categories: this.quarters }),
)
// <div [innerHTML]="svg"></div>

For the line/area crosshair, call attachCrosshair(svgElement, chartGeometry(type, data, options)).

Data shapes

// line, area, bar
[{ name: 'CPU', color?: '#2563eb', data: [10, 40, null, 25] }]       // x = index, null = gap
[{ name: 'Visits', data: [{ x: new Date('2024-05-01'), y: 120 }] }]  // time axis

// scatter / bubble (size makes bubbles; radius grows with the square root)
[{ name: 'Plans', data: [{ x: 12, y: 40, size: 300, label: 'Pro' }] }]

// pie, donut
[{ label: 'Direct', value: 40 }, { label: 'Search', value: 25 }]

// gauge
gaugeSvg(72, { min: 0, max: 100, thresholds: [{ value: 0, color: 'green' }, { value: 80, color: 'red' }], bands: true, needle: true })

// calendar heatmap: an array or an object keyed by date
[{ date: '2024-05-01', value: 3 }]   or   { '2024-05-01': 3 }
calendarHeatmapSvg(days, { to: '2024-12-31', weekStart: 1, levels: 5 })

Geometry only

Every …Chart() function returns plain geometry: paths, ticks, the plot area and the points with their pixel positions. Render it however you like, for example with {{#each}} in a template, in a canvas, or in a PDF. The building blocks are exported too: linearScale, bandScale, niceTicks, extent, linePath, areaPath, arcPath, timeAxis, timeTicks, nearestPoints, nearestScatterPoint, describeSeries and dataTable.

License

MIT