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

@chartwerk/core

v0.6.26

Published

Chartwerk core

Downloads

177

Readme

Chartwerk Core

Repo contains the core code of chartwerk project: abstract classes, rendering system, basic components. See ChartwerkPod to see what is parent for all chartwerk pods and get involved into development. Everything can be overwritted.

Plugin contains:

  • SVG container.
  • Series and Options models with defaults.
  • State model to control charts changes.
  • Overlay container to handle all events.
  • Zoom events controller.
  • Axes, with ticks and labels.
  • Grid, with separate behavior from axis.
  • Legend, which can hide metrics.
  • Crosshair.

Declare

const pod = new ChartwerkPod(
  document.getElementById('chart-div'),
  series,
  options,
);
pod.render();

Series

Series is a list of metrics with datapoints and specific config working for each serie. series = Serie[]

  • datapoints - metric data for rendering.
datapoints = [number, number][]; // 0 index for X, 1 index for Y 
  • target - id of metric. Required param, should be unique.
target: string;

Options:

Options is a config working for whole chart and metrics. All options are optional.

  • margin — chart container positioning;
margin = {
  top: number,
  right: number,
  bottom: number,
  left: number,
}
  • colors: array of metrics colors (should be equal or greater than series length);
['red', 'blue', 'green']
  • labelFormat: labels for axes.
{
  xAxis: string;
  yAxis: string;
}

for example:

{
  xAxis: 'Time';
  yAxis: 'Value';
}
  • bounds: specify which metrics should be rendered as confidence. (TODO: move to @chartwerk/line-chart) $__metric_name macro can be used here. It will be replaced with each metric's name to find it's bound.
{
  upper: string;
  lower: string;
}

for example: metric names: 'serie', 'serie upper_bound', 'serie lower_bound'

bounds={
  upper: '$__metric_name upper_bound';
  lower: '$__metric_name lower_bound';
}

'serie upper_bound', 'serie lower_bound' metrics will be rendered as serie metric confidence;

  • timeRange: time range in timestamps
{
  from: number;
  to: number;
}

for example:

{
  from: 1582770000000;
  to: 1582810000000;
}
  • eventsCallbacks: event callbacks
{
  zoomIn: (range: [number, number]) => void,
  zoomOut: (center: number) => void,
  mouseMove: (evt: any) => void,
  mouseOut: () => void,
  onLegendClick: (idx: number) => void
}