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

@tanstack/charts-scales

v0.18.0

Published

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/api/readme/charts.png?title=TanStack%20Charts%20Scales&theme=dark" /> <source media="(prefers-color-scheme: light)"

Readme

@tanstack/charts-scales

This compatibility package remains supported for existing applications. New applications can install only @tanstack/charts and use its exact scale subpaths.

pnpm add @tanstack/charts

Import only the required family:

import { scaleLinear } from '@tanstack/charts/scales/linear'
import { scaleBand } from '@tanstack/charts/scales/band'
import { scalePoint } from '@tanstack/charts/scales/point'
import { scaleOrdinal } from '@tanstack/charts/scales/ordinal'

Common chart

Pass a factory when Charts should infer the domain from mark channels:

import { barY, defineChart } from '@tanstack/charts'
import { scaleBand } from '@tanstack/charts/scales/band'
import { scaleLinear } from '@tanstack/charts/scales/linear'

const revenue = [
  { month: 'Jan', value: 42 },
  { month: 'Feb', value: 58 },
  { month: 'Mar', value: 76 },
]

const chart = defineChart({
  marks: [barY(revenue, { x: 'month', y: 'value' })],
  scales: {
    x: { scale: () => scaleBand<string>().padding(0.2) },
    y: { scale: scaleLinear, nice: true, grid: true },
  },
})

Pass an instance when the domain is application state:

const normalized = scaleLinear().domain([0, 1])

TanStack Charts copies the scale before assigning its responsive positional range. The source instance is not mutated.

Included families

| Entry | Use | Main methods | | ---------- | -------------------------------------------------------- | --------------------------------------------------------------------------- | | /linear | Numeric line, area, scatter, rule, and quantitative axes | domain, range, invert, clamp, ticks, tickFormat, nice, copy | | /band | Bars, cells, and categorical intervals | padding, paddingInner, paddingOuter, align, round, bandwidth | | /point | Categorical line and dot positions | padding, align, round, step, zero bandwidth, copy | | /ordinal | Categorical colors or other discrete outputs | Explicit or implicit domains, cyclic ranges, unknown, copy |

Each entry also exports its matching LinearScale, BandScale, PointScale, or OrdinalScale type.

Band, point, and ordinal domains accept strings, numbers, and dates as discrete values. Equal date timestamps and duplicate primitives share one domain entry. Linear domains and ranges are numeric, finite, and two-stop. Its formatter is deliberately basic; pass an axis formatter when Intl.NumberFormat is enough.

Upgrade one scale to D3

Keep the compact scales until a chart needs semantics they do not provide. Add d3-scale for:

  • continuous local-time or UTC axes;
  • log, power, square-root, symlog, or radial mappings;
  • sequential, diverging, quantile, quantize, or threshold color;
  • piecewise domains, nonnumeric ranges, or custom interpolation;
  • D3 format specifiers and locale-aware scale formatting.

Compact and D3 scales share the callable, domain, range, and copy contract used by Charts, so they can be mixed:

import { scaleLinear } from '@tanstack/charts/scales/linear'
import { scaleUtc } from 'd3-scale'

const axes = {
  x: { scale: scaleUtc, nice: true },
  y: { scale: scaleLinear, nice: true },
}

Application source importing d3-scale must declare it and @types/d3-scale directly. Unsupported D3 methods do not warn or fall back at runtime; select D3 before authoring against a method outside this documented subset.