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

@servicetitan/carto-charts-react

v0.1.0

Published

Carto web chart host: a declarative <Chart> over echarts-for-react with the SVG renderer, rendering the platform-neutral option specs and theme from @servicetitan/carto-charts-core.

Readme

@servicetitan/carto-charts-react

Web chart host for Carto: a thin declarative <Chart> over echarts-for-react with the SVG renderer, rendering the platform-neutral option specs and theme from @servicetitan/carto-charts-core.

Status: early release. Charts have no overlay component yet (ANV-5332).

import { Chart } from "@servicetitan/carto-charts-react";
import "@servicetitan/carto-charts-react/styles.css";
import type { EChartsOption } from "echarts";

// Consumer-authored option — chart type + data live in your app, not the DS.
const option: EChartsOption = {
  xAxis: { type: "category", data: ["North", "South", "East", "West"] },
  yAxis: { type: "value" },
  series: [{ type: "bar", data: [1200, 980, 1450, 1100] }],
};

<Chart option={option} width={480} height={300} />;

Note what that option does not contain: no colors, borders, patterns, marker shapes or corner radii. Those come from variant, which defaults to "monochrome". You should not be hand-authoring per-series styling to get Carto's look — if you find yourself doing that, something is missing here.

Props

  • option — an ECharts option spec (the same object works on React Native).

  • variant — "monochrome" (default) or "categorical". The whole treatment, not just a color list: palette, monochrome's borders and pattern fills, line marker shapes, bar corner radius. Monochrome has four designed steps and is scoped to 4 variables or fewer; categorical is for 5+, and is what line charts use at any count. Anything your option specifies wins over it.

  • appearance — "light" (default) or "dark". Charts don't detect this: this package doesn't depend on the kits, so no CartoTheme is in reach. Inside one, read it with carto-react-kit's useCartoTheme and pass it through.

  • width / height — explicit pixel dimensions, the same props the React Native host takes, so sizing code reads the same on both platforms. Optional here: unlike native, a web chart has a container to fill.

  • className — for sizing pixels can't express (percentages, container queries, aspect ratios). There is no style prop.

  • renderTooltip — renders the tooltip's content. Omit it and the chart has no tooltip; there's no built-in content, since formatting a value is a product decision. Content only — the chart tracks the pointer and keeps the tooltip inside the plot. Wrap it in TooltipSurface from @servicetitan/carto-react-kit for the Carto pill:

    renderTooltip={({ name, points }) => (
      <TooltipSurface content={`${name}: ${points[0]?.value}`} />
    )}

    points is one entry for a bar, slice or marked line. An area or marker-less line has nothing to hover, so it reports every series at the category instead.

  • theme — escape hatch. A registered theme name or inline theme object, for a genuinely custom theme; it replaces what appearance/variant would build. Note it replaces only the theme half of a variant — the per-index treatment still follows variant.

Sizing precedence is width/height → className → fluid default. Passing the props wins over a class, since asking for a pixel size is explicit; omitting them leaves the chart filling its container, which a class can then override.

Semantic status colors

variant covers the two index-cycled palettes. Semantic status colors are chosen by meaning and urgency rather than by series index, so you compose them yourself from chartPalette(appearance, "semantic") and chartStepItemStyle — see @servicetitan/carto-charts-core and the @servicetitan/carto-charts-react/Semantic stories in carto-react-kit's Storybook.

Setup

styles.css is a required import, the same contract @servicetitan/carto-react-kit/styles.css has: the styles compile to their own artifact, so importing only the component leaves the container unstyled.

echarts and react are peer dependencies. The SVG renderer is fixed for the accessibility posture — real SVG nodes plus the option's aria description, which this host enables by default.