A React data visualization library designed for AI-assisted development and streaming data.
Install
npm install semiotic
Requires React 18.1+ or React 19.
First Chart
import { LineChart } from "semiotic/xy"
const signups = [
{ week: 1, signups: 120 },
{ week: 2, signups: 180 },
{ week: 3, signups: 150 },
{ week: 4, signups: 240 },
{ week: 5, signups: 310 },
]
export default function SignupsChart() {
return (
<LineChart
data={signups}
xAccessor="week"
yAccessor="signups"
xLabel="Week"
yLabel="Signups"
title="Weekly signups"
/>
)
}
xAccessor and yAccessor name the fields to plot, and title gives the
chart its accessible name. LineChart needs numeric x values (numbers or
timestamps); for named categories such as month names, use BarChart with
categoryAccessor. More complete examples follow under
Quick Examples.
Start with a small chart component. Add network graphs, streaming data and
coordinated views when the task needs them. Structured schemas, diagnostics
and rendering evidence help coding assistants implement, check and repair
chart configurations.
Work through a complete task: check category totals,
maintain a live chart, or
correct a published chart.
The source task packets identify their build and
evidence scope; source availability does not establish installed or deployed parity.
Quick Examples
Each example is a complete component. Examples that use one chart family
import from that family's entry; the coordination examples import from
semiotic, which exports LinkedCharts and ChartContainer alongside the
charts.
Standard Charts
Line, bar, scatter, and area charts share the same accessor-driven API:
import { LineChart } from "semiotic/xy"
import { BarChart } from "semiotic/ordinal"
const revenue = [
{ month: 1, revenue: 4200 },
{ month: 2, revenue: 5100 },
{ month: 3, revenue: 6800 },
{ month: 4, revenue: 5900 },
]
const departments = [
{ department: "Design", region: "East", sales: 12 },
{ department: "Sales", region: "West", sales: 30 },
{ department: "Support", region: "East", sales: 18 },
]
export function StandardCharts() {
return (
<>
<LineChart
data={revenue}
xAccessor="month" yAccessor="revenue"
curve="monotoneX" showPoints
title="Monthly revenue"
/>
<BarChart
data={departments}
categoryAccessor="department" valueAccessor="sales"
orientation="horizontal" colorBy="region"
title="Sales by department"
/>
</>
)
}
Coordinated Dashboard
Hover one chart and highlight the same data in another through a shared selection:
import { LinkedCharts, Scatterplot, BarChart } from "semiotic"
const people = [
{ age: 31, income: 52, region: "East" },
{ age: 44, income: 78, region: "West" },
{ age: 38, income: 61, region: "East" },
{ age: 52, income: 90, region: "West" },
]
const totals = [
{ region: "East", total: 113 },
{ region: "West", total: 168 },
]
export function RegionDashboard() {
return (
<LinkedCharts>
<Scatterplot
data={people} xAccessor="age" yAccessor="income" colorBy="region"
linkedHover={{ name: "hl", fields: ["region"] }}
selection={{ name: "hl" }}
title="Income by age"
/>
<BarChart
data={totals} categoryAccessor="region" valueAccessor="total"
selection={{ name: "hl" }}
title="Total income by region"
/>
</LinkedCharts>
)
}
Streaming Metrics with Decay
Live data fades old points, flashes new ones, flags stale feeds. Omit data
and push through a ref from an effect, an event handler, or a socket callback:
import { useEffect, useRef } from "react"
import { RealtimeLineChart } from "semiotic/realtime"
export function CpuMonitor() {
const chartRef = useRef(null)
useEffect(() => {
// Replace the timer with your metrics source.
const timer = setInterval(() => {
chartRef.current?.push({ time: Date.now(), value: 40 + Math.random() * 20 })
}, 250)
return () => clearInterval(timer)
}, [])
return (
<RealtimeLineChart
ref={chartRef}
timeAccessor="time"
valueAccessor="value"
decay={{ type: "exponential", halfLife: 100 }}
staleness={{ threshold: 5000, showBadge: true }}
title="CPU load"
/>
)
}
Network Graphs
Force-directed graphs and Sankey diagrams — same API as LineChart:
import { ForceDirectedGraph, SankeyDiagram } from "semiotic/network"
const people = [
{ id: "Ada", team: "Platform" },
{ id: "Lin", team: "Design" },
{ id: "Sam", team: "Platform" },
]
const friendships = [
{ source: "Ada", target: "Lin" },
{ source: "Lin", target: "Sam" },
]
const budgetFlows = [
{ from: "Budget", to: "Design", amount: 40 },
{ from: "Budget", to: "Engineering", amount: 60 },
{ from: "Engineering", to: "Platform", amount: 35 },
]
export function Networks() {
return (
<>
<ForceDirectedGraph
nodes={people} edges={friendships}
colorBy="team" nodeSize={8} showLabels
title="Who works with whom"
/>
<SankeyDiagram
edges={budgetFlows}
sourceAccessor="from" targetAccessor="to" valueAccessor="amount"
title="Where the budget goes"
/>
</>
)
}
Geographic Visualization
Choropleth maps, flow maps, and distance cartograms with canvas rendering,
zoom/pan, tile basemaps, and animated particles. This example joins your rows
to the bundled world-110m geography, which needs the optional world-atlas
peer dependency (npm install world-atlas):
import { useEffect, useState } from "react"
import { ChoroplethMap, mergeData, resolveReferenceGeography } from "semiotic/geo"
const gdpByCountry = [
{ country: "United States of America", gdp: 27.4 },
{ country: "China", gdp: 17.8 },
{ country: "Germany", gdp: 4.5 },
]
export function WorldGdpMap() {
const [areas, setAreas] = useState([])
useEffect(() => {
let cancelled = false
resolveReferenceGeography("world-110m").then((world) => {
if (cancelled) return
setAreas(
mergeData(world, gdpByCountry, { featureKey: "properties.name", dataKey: "country" })
)
})
return () => {
cancelled = true
}
}, [])
return (
<ChoroplethMap
areas={areas}
valueAccessor={(feature) => feature.properties.gdp}
colorScheme="viridis" projection="equalEarth" zoomable tooltip
title="GDP by country"
/>
)
}
FlowMap and DistanceCartogram follow the same accessor pattern. In this
sketch airports, routes, and cities stand for your own arrays:
import { FlowMap, DistanceCartogram } from "semiotic/geo"
<FlowMap
nodes={airports} flows={routes} valueAccessor="passengers"
showParticles particleStyle={{ color: "source", speedMultiplier: 1.5 }}
/>
<DistanceCartogram
points={cities} center="rome" costAccessor="travelDays"
showRings costLabel="days" lines={routes}
/>
Streaming System Monitor
Live service topology with threshold alerting and click-to-inspect:
import { useEffect, useRef } from "react"
import { StreamNetworkFrame, ChartContainer, DetailsPanel, LinkedCharts } from "semiotic"
export function SystemMonitor() {
const chartRef = useRef(null)
useEffect(() => {
// Replace the timer with your request stream.
const timer = setInterval(() => {
chartRef.current?.push({ source: "API", target: "Orders", value: 15 })
}, 500)
return () => clearInterval(timer)
}, [])
return (
<LinkedCharts>
<ChartContainer title="System Monitor" status="live"
detailsPanel={
<DetailsPanel position="right" trigger="click">
{(datum) => <div>{datum.id}: {datum.value} req/s</div>}
</DetailsPanel>
}>
<StreamNetworkFrame ref={chartRef} chartType="sankey"
showParticles particleStyle={{ proportionalSpeed: true }}
thresholds={{ metric: n => n.value, warning: 100, critical: 250 }}
/>
</ChartContainer>
</LinkedCharts>
)
}
All Chart Components
| Category |
Components |
| XY |
LineChart AreaChart DifferenceChart StackedAreaChart BumpChart Scatterplot ConnectedScatterplot BubbleChart Heatmap QuadrantChart MultiAxisLineChart MinimapChart CandlestickChart WaterfallChart ScatterplotMatrix |
| Categorical |
BarChart StackedBarChart GroupedBarChart LikertChart SwimlaneChart FunnelChart SwarmPlot BoxPlot Histogram ViolinPlot RidgelinePlot DotPlot PieChart DonutChart GaugeChart RadarChart |
| Network |
ForceDirectedGraph ChordDiagram SankeyDiagram ProcessSankey TreeDiagram Treemap CirclePack OrbitDiagram |
Geo (semiotic/geo) |
ChoroplethMap ProportionalSymbolMap FlowMap DistanceCartogram |
| Realtime |
RealtimeLineChart RealtimeHistogram TemporalHistogram RealtimeSwarmChart RealtimeWaterfallChart RealtimeHeatmap |
Physics (semiotic/physics) |
GaltonBoardChart EventDropChart UnitPileChart CollisionSwarmChart GauntletChart CrucibleChart ProcessFlowChart PacketFlowChart ChainReactionChart |
| Value and text |
BigNumber (semiotic/value) WordCloud (semiotic/wordcloud) |
| Custom layouts |
XYCustomChart OrdinalCustomChart NetworkCustomChart GeoCustomChart (semiotic/geo) PhysicsCustomChart (semiotic/physics) |
| Coordination |
LinkedCharts |
| Layout |
ChartGrid ContextLayout CategoryColorProvider |
| Frames |
StreamXYFrame StreamOrdinalFrame StreamNetworkFrame StreamGeoFrame (semiotic/geo) StreamPhysicsFrame (semiotic/physics) |
Vega-Lite Translation
Paste a Vega-Lite spec, get a Semiotic chart:
import { fromVegaLite } from "semiotic/data"
import { configToJSX, fromConfig } from "semiotic"
const config = fromVegaLite({
mark: "bar",
data: { values: [{ a: "A", b: 28 }, { a: "B", b: 55 }] },
encoding: {
x: { field: "a", type: "nominal" },
y: { field: "b", type: "quantitative" },
},
})
// Render directly
const { componentName, props } = fromConfig(config)
// → componentName: "BarChart", props: { data, categoryAccessor: "a", valueAccessor: "b" }
// Or generate JSX code
configToJSX(config)
// → <BarChart data={[...]} categoryAccessor="a" valueAccessor="b" />
Supports bar, line, area, point, rect, arc, tick marks with encoding translation
for color, size, aggregation, and binning.
Conversation Arc Telemetry
Capture and replay the path an AI-assisted chart session took:
import {
createLocalStorageConversationArcSink,
enableConversationArc,
getConversationArcStore,
loadConversationArc,
registerConversationArcSink,
} from "semiotic/ai"
const sink = createLocalStorageConversationArcSink({ key: "my-app:arc" })
registerConversationArcSink(sink)
enableConversationArc({ sessionId: "session-abc" })
getConversationArcStore().record({ type: "chart-rendered", component: "LineChart" })
loadConversationArc(sink.load(), { enabled: false })
What's New in 3.15.0
Use forecastExtents() from semiotic/xy to size an axis before drawing a
forecast, including the confidence band. Node request handlers can use
createBoundedRenderer() from semiotic/server/node to set a deadline,
cancel a render, and cap the size of the resulting SVG and evidence.
Charts can distinguish settled, pending, and projected observations with
dataState. Fill patterns and time-threshold style rules carry those
distinctions into static SVG. The developer MCP profile also gains chart
critique and Vega-Lite conversion with diagnostics for unsupported encodings.
See the 3.15.0 changelog for the full release notes.
Why Semiotic
Semiotic is a data visualization library for React that combines broad chart
coverage with AI tooling. It supports network graphs, streaming data,
statistical distributions and coordinated views, with schemas, examples and
diagnostics for implementing and checking each task. Check the project's
existing dependencies first: extending its current charting library may be
the best fit for a small change.
Built for AI-assisted development
Semiotic provides a workflow for generating, checking and repairing chart
configurations. The July 27, 2026 evaluation
reports model- and task-specific results; it does not guarantee first-try correctness.