Components/Charts

Charts

@talex-touch/tuffex-charts overview: a kumo-shaped API surface, Vue-rendered SVG, no echarts.

VerifiedSince 0.1.0

Charts

Install & Import

The chart family lives in the standalone @talex-touch/tuffex-charts package. Its API surface mirrors Cloudflare kumo's chart family, but the renderer is Vue-emitted SVG — no echarts and no chart framework; math comes from tree-shakeable d3 micro-modules only (d3-scale / d3-shape / d3-sankey / d3-geo).

pnpm add @talex-touch/tuffex-charts
import { TxTimeseriesChart } from '@talex-touch/tuffex-charts'
import '@talex-touch/tuffex-charts/style.css'

Available Charts

ComponentSectionDescription
TxTimeseriesChartTimeseriesTime-series lines / stacked bars with markers, thresholds, brushing and tooltips.
TxBubbleMap / TxChoroplethMapMapsGeoJSON maps: proportional bubbles and shaded regions.
TxSankeyChartSankeyFlow diagrams.
TxChart + series primitivesCustom ChartThe composable escape hatch: line/area/bar/scatter/donut, freely combined.
ChartPalette / CSS variablesColorsCategorical, semantic, sequential and map palettes, auto light/dark.

Groups at a Glance

Every component in the suite, grouped by category. The list is read from each doc's category frontmatter, so new components appear on their own.

Legend

TxChartLegendItem ships two legend layouts: small inline rows (multi-series legends) and large stacked metrics (dashboard cards). loading renders skeleton placeholders; with a click listener attached it renders as a native button, so Enter/Space work out of the box.

Legend items

Small / Large / Loading

Click the first item to toggle the second one's inactive state.

Loading demo...

API

ChartLegendItem Props

PropTypeDefaultDescription
variant'small' | 'large''small'Inline row / stacked metric layout.
namestringSeries name. Optional while loading.
colorstringIndicator dot color; any CSS color including var().
valuestringPre-formatted value text.
unitstringUnit label after the value (large only).
inactivebooleanfalseRenders at half opacity for a deselected state.
loadingbooleanfalseSkeleton placeholders (aria-hidden, not focusable).

Differences from kumo

  • No echarts instance prop — the renderer is built in; consumers neither need nor can pass echarts.
  • No isDarkMode prop — every color reads --tx-chart-* CSS variables and follows the host's .dark / [data-theme='dark'] automatically.
  • Every HTML-string formatter became a slot (VNodes), so there is no XSS-escaping surface.