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

@antadesign/plot

v0.1.4

Published

Canvas charts for React, Preact, and browser custom elements. Create scatter, line, bar, area, rectangle, and rule series, or draw custom marks. `Plot` handles sizing, rendering, tooltips, zooming, and panning.

Readme

@antadesign/plot

Canvas charts for React, Preact, and browser custom elements. Create scatter, line, bar, area, rectangle, and rule series, or draw custom marks. Plot handles sizing, rendering, tooltips, zooming, and panning.

Install

Install the package and its peer dependencies:

npm install @antadesign/plot

The package requires Anta ^0.3.30, React ^19.0.0, and a bundler that supports ES modules and CSS imports. Preact applications can use their React compatibility aliases. The root component imports shown below require 0.1.3 or later.

Use in React

Import the component, register its browser elements, and load an Anta theme:

import { Plot, scatter } from '@antadesign/plot'
import '@antadesign/plot/elements/a-plot-surface'
import '@antadesign/anta/elements/a-tooltip'
import '@antadesign/anta/theme-antune.css'

const series = [
  scatter({
    data: [{ x: 1, y: 2 }, { x: 2, y: 5 }, { x: 3, y: 4 }],
    tooltip: true,
  }),
]

export function Chart() {
  return <Plot plotArgs={{ height: 300, series }} />
}

Set plotArgs.height or give the parent a height. The plot fills the available space unless you provide explicit dimensions. Replace plotArgs to update the chart. Pass onError to handle rendering and configuration failures.

Plot uses Anta's configured renderer and hooks. Custom JSX runtimes can supply hooks through Anta's configure() API.

Use as a browser element

Register <a-plot> and assign its configuration through the plotArgs property:

import { scatter, type APlotElement } from '@antadesign/plot/browser'
import '@antadesign/plot/elements/a-plot'
import '@antadesign/anta/theme-antune.css'

const plot = document.createElement('a-plot') as APlotElement
plot.plotArgs = {
  height: 300,
  series: [
    scatter({
      data: [{ x: 1, y: 2 }, { x: 2, y: 5 }, { x: 3, y: 4 }],
      tooltip: true,
    }),
  ],
}
document.body.append(plot)

The registration import includes the surface and tooltip elements. To register programmatically, import and await definePlotElement() from @antadesign/plot/browser instead.

Customize a chart

The package exports scatter, line, bar, area, rect, rule, and custom series factories, along with their TypeScript argument types. Combine series in plotArgs.series and configure axes through plotArgs.axis.

Set a series' tooltip to true for the default tooltip, or provide a callback for custom content. JSX plots accept React-compatible content; browser element factories accept DOM nodes. Browser elements also expose tooltipRenderer for applications that need to manage the tooltip's contents directly.

Custom series support renderer, hit_test, and highlight_renderer callbacks. PlotSurface is exported as a low-level JSX wrapper. Use Plot for a complete chart; controllers and drawing lifecycle helpers remain internal.

Imports

| Import | Provides | | --- | --- | | @antadesign/plot | Plot, PlotSurface, series factories, and public types | | @antadesign/plot/browser | Series factories for DOM tooltips, browser element types, and definePlotElement() | | @antadesign/plot/elements/a-plot | Registers the standalone chart and its dependencies | | @antadesign/plot/elements/a-plot-surface | Registers the surface used by the JSX components | | @antadesign/plot/elements | Registers both plot elements |

Importing the root does not register browser elements. Base element styles are installed automatically; load your application's Anta theme separately.

For compatibility, /auto registers both elements, and /plot.css supplies the standalone layout stylesheet. A separate /plot.css import is not needed for the examples above.