When the catalog doesn't fit, the four custom-chart HOCs — XYCustomChart,OrdinalCustomChart, NetworkCustomChart, andGeoCustomChart — let you supply a layout function that emits scene nodes directly. The frame still owns scales, theme, hit testing, transitions, decay, accessibility, and SSR — your layout owns the geometry. Most novel chart types (waffle, calendar, streamgraph, flextree, dagre) decompose into the same primitives the built-in HOCs use.
Layouts ship in semiotic/recipes. You can use them as-is or copy one and customize. Writing your own is ~30 lines.
When layouts run
On a client mount with bounded data, the frame ingests the data before its first layout. A fixed-size NetworkCustomChart runs its layout once. A responsive container can add a call when its measured plot size replaces the initial size. If measurement arrives before the first layout, there is no fallback-size pass. Stable rerenders and repeated measurements at the same size reuse the scene. Server rendering and client hydration execute separately, and React development StrictMode can replay mounting work.
Network layouts reuse their last successful scene while data, plot dimensions, layout function, layoutConfig, theme/palette, and geometry-driving selection are unchanged. Keep data and configuration immutable; replace their references when values change. Memoize layout functions and configuration objects created inside your component. Pass changing geometry inputs throughlayoutConfig instead of hiding them in mutable closures. An explicitref.current.relayout() forces a new call; a failed call can be retried.
Selection changes use the returned restyle/restyleEdgecallbacks when supplied, so highlighting can repaint without recomputing geometry. Without these callbacks, a changed selection reaches the next layout throughctx.selection. Palette changes update network scenes without rerunning built-in topology solvers. animate={false} also disables network transitions after data or size changes.
Nonempty bounded graphs no longer receive a preliminary empty-data layout. Empty data is still a valid layout input on a lower-level frame or an unseeded push-mode chart: layouts can emit decorations without nodes. An explicitly empty bounded NetworkCustomChart displays its empty state. Edges alone can create endpoint nodes, so an empty authored nodes array does not always mean an empty graph.
Isometric geographic board
GeoCustomChart receives the frame’s fitted projection helpers plus raw areas, points, and lines, then emits interactive geographic scene nodes. TheParis, Isometric City of Lightsexample quantizes DBpedia landmarks into a five-by-five isometric board while GeoFrame retains polygon hit-testing, accessibility, tooltips, selection, and SSR.
JSX
import { GeoCustomChart } from "semiotic/geo" import { isometricLandmarkLayout } from "semiotic/recipes" <GeoCustomChart points={landmarks} layout={isometricLandmarkLayout} layoutConfig={{ center: { lon: 2.3522, lat: 48.8566 }, centerId: "http://dbpedia.org/resource/Paris", gridSize: 5 }} />
Waffle chart
A grid of cells where each cell represents one share of the total. Categories fill row-major, allocated proportionally with the largest-remainder method. Categories that receive no cells are disclosed with a shown/total count below the grid, including in SVG exports. Rows and columns must be positive integers, with enough plot space for the gutters; an invalid grid shows a notice instead of cells.
Recipe contract: semiotic.recipe.waffle.v0 · intentpart-to-whole · semantic navigation by category, not by individual cell.
Intent Mark · part-to-whole
XYCustomChart: part-to-whole for general-technical. A unit grid makes composition concrete through repeated, inspectable units.
{ "ididVersion": "0.1", "chartId": "custom-layouts-waffle", "title": "Waffle chart", "intent": { "primary": "part-to-whole", "secondary": [ "compare-categories", "explanation" ] }, "audience": { "primary": "general-technical", "familiarityAssumptions": { "waffleChart": "medium", "partToWhole": "high" }, "literacyTargets": [ { "feature": "unit-based composition", "rationale": "Readers can reason about proportions through repeated visible units." } ] }, "reception": { "channels": [ "visual", "interactive", "screen-reader", "agent" ], "strengths": [ "memorable", "glanceable", "explainable", "teaching-friendly" ], "risks": [ "precise comparison may be harder than a bar chart", "individual cells can become navigation noise" ], "scaffolds": [ "legend", "category summary", "accessible table", "description" ], "memorableForm": true }, "designContract": { "chartFamily": "XYCustomChart", "whyThisForm": "A unit grid makes composition concrete through repeated, inspectable units.", "whyNotDefault": "A pie chart would show share but provide less unit-level evidence and less interaction surface.", "risks": [ "precise comparison may be harder than a bar chart", "individual cells can become navigation noise" ], "misuse": [ "too many categories", "too many units", "false precision", "treating each cell as a separate semantic datum" ] }, "accessibility": { "description": "A 100-cell waffle chart showing share composition by region. 4 categories total 100; each cell represents approximately 1% of the whole. AMER is the largest category at 42%, represented by 42 of 100 cells. This is an apportioning and explanatory chart: repeated units make the composition tangible while category summaries preserve the meaningful reading unit.", "navigation": true, "dataFallback": true, "manualChecks": [ "real screen-reader behavior", "keyboard order quality", "custom metaphor comprehension", "animation distraction" ] }, "provenance": { "reviewStatus": "docs example", "generatedBy": "Semiotic recipe intelligence" } }JSX
import { XYCustomChart } from "semiotic/xy" import { waffleLayout } from "semiotic/recipes" <XYCustomChart data={[ { region: "AMER", share: 42 }, { region: "EMEA", share: 28 }, { region: "APAC", share: 18 }, { region: "LATAM", share: 12 }, ]} layout={waffleLayout} layoutConfig={{ rows: 10, columns: 10, gutter: 3, categoryAccessor: "region", valueAccessor: "share", }} width={420} height={420} />
Calendar heatmap
GitHub-style day-by-day grid. 53 ISO weeks × 7 days, color-encoded by daily value. The recipe handles the day-of-week / week-of-year math; the active theme provides the defaultsurface → primary color ramp. Pass a custom colorRamp for non-default ramps.
This built-in portable recipe is also a first-class serialized component. Use the same name with MCP or renderChart, while React renders it through the genericChartRecipe host:
JSX
import { ChartRecipe } from "semiotic/ai" <ChartRecipe recipeId="CalendarHeatmapRecipe" data={dailyEvents} layoutConfig={{ dateAccessor: "date", valueAccessor: "count", year: 2025 }} title="Daily activity" description="Daily activity by calendar week and weekday." summary="Activity peaks in the final week of March." accessibleTable />
JSX
import { calendarLayout } from "semiotic/recipes" <XYCustomChart data={dailyEvents} layout={calendarLayout} layoutConfig={{ dateAccessor: "date", valueAccessor: "count", year: 2025, colorRamp: ["#ebedf0", "#216e39"], // optional }} width={780} height={130} />
Flextree (network)
Hierarchical trees where node sizes vary along the major axis — rendered throughNetworkCustomChart. The user runs d3-flextree (a BYO dep) to compute positions, then passes the laid-out nodes and parent → child edges into the chart. The recipe handles scene emission: rect nodes, smooth bezier edges from parent-bottom to child-top, optional labels.
The demo below is what flextree exists for. Four kinds of variation that uniform-heightd3-tree can't pack tightly are all present at once:
- Per-node height. Row 1's Tutorials (tall card) sits next toAPI Reference (short pill); Row 2's First Chart is taller than every other rect in the row.
- Per-node width. Each rect hugs its label — from the 46px Dataleaf to the 92px Tutorials card.
- Asymmetric subtree breadth.Tutorials's subtree is huge (3 leaves, one of which itself has 3 sub-leaves), so it claims most of the horizontal room.API Reference only needs a narrow slot.
- Asymmetric depth. Two branches drop a 3rd row of children; the others stop at row 2. Real documentation / project trees look like this; flextree packs them without forcing every leaf to the deepest level.
Flextree and Dagre center and uniformly shrink the node bounds into the plot, including negative coordinates. Labels and tooltips receive your original data objects. Set layoutConfig={{ fit: "none" }} to preserve authored pixel positions. Non-finite positions and nonpositive node sizes are skipped. Dagre includes edge waypoints in the fitted bounds.
JSX
import flextree from "d3-flextree" import { NetworkCustomChart } from "semiotic/network" import { flextreeLayout } from "semiotic/recipes" const layout = flextree({ nodeSize: (n) => [n.data.size, 40] }) const tree = layout.hierarchy(rootData) layout(tree) const nodes = tree.descendants().map(n => ({ id: n.data.id, x: n.x, y: n.y, width: n.size[0], height: n.size[1], })) const edges = tree.links().map(l => ({ source: l.source.data.id, target: l.target.data.id, })) <NetworkCustomChart nodes={nodes} edges={edges} layout={flextreeLayout} layoutConfig={{ orientation: "vertical" }} width={800} height={260} />
Dagre (network)
Layered DAG layout from dagre (BYO dep). Same shape as flextree: rundagre.layout(g), flatten nodes/edges, pass to NetworkCustomChart. Edges with a points waypoint array render as polylines through those points; without waypoints, fall back to a straight line.
JSX
import dagre from "dagre" import { NetworkCustomChart } from "semiotic/network" import { dagreLayout } from "semiotic/recipes" const g = new dagre.graphlib.Graph() g.setGraph({ rankdir: "TB" }) g.setDefaultEdgeLabel(() => ({})) for (const n of myNodes) g.setNode(n.id, { width: 120, height: 40, label: n.label }) for (const e of myEdges) g.setEdge(e.source, e.target) dagre.layout(g) const nodes = g.nodes().map(id => { const n = g.node(id) return { id, x: n.x, y: n.y, width: n.width, height: n.height, label: n.label } }) const edges = g.edges().map(e => { const ed = g.edge(e) return { source: e.v, target: e.w, points: ed.points } }) <NetworkCustomChart nodes={nodes} edges={edges} layout={dagreLayout} layoutConfig={{ edgeStyle: "smooth" }} />
To place a minimap, overlay, or viewport on the fitted graph, compute the same fit the layout applies with createDagreFit(nodes, edges, plot, config) (orcreateFlextreeFit(nodes, plot, config) for flextree) instead of copying the recipe's defaults. It returns scale, dx, dy,bounds, project(point), invert(point), andnodeBounds(node), which equals the rect the layout draws. The plot is plot-relative (frame margins excluded); fit each chart size separately. WithZoomableNetworkCustomChart, apply the camera afterwards withprojectNetworkPoint / invertNetworkRect fromsemiotic/network/zoom.
JSX
import { createDagreFit } from "semiotic/recipes" const plot = { x: 0, y: 0, width: width - margin.left - margin.right, height: height - margin.top - margin.bottom } const fit = createDagreFit(nodes, edges, plot) const box = fit.nodeBounds(nodes[0]) // { x, y, width, height, cx, cy } in plot space const authored = fit.invert({ x: pointerX, y: pointerY })
Lineage DAG with composite glyphs (network)
lineageDagLayout renders a pre-positioned layered lineage/DAG where each node is a composite glyph — a partition-colored container, a semantic icon, a truncated label, and a chip per attached item — that stays a single hit-testable unit: one canvas rect owns the hit area while the icon, label, and chips ride the layout's overlays (which is pointer-events: none, so it never steals a hover). It collapses through full → compact → icon → dot as the graph gets denser, renders cycles as dashed loops with arrowheads inside the plot, and dims to a host-supplied reachable set. Because it only reads pre-computed layer/row coordinates, output is deterministic. Domains fit actual extents, including negative layers and uncentered rows. Backedges are inferred when the source layer is at or beyond the target layer; an explicit isBackEdge boolean overrides that inference. Optional layerCount and maxLayerSize reserve zero-based layers and centered rows, expanding to include data outside those ranges. Set hullGroupAccessor to enclose nodes that share a group value in padded, rounded convex hulls. Those hulls use the layout's fitted pixel geometry and render in the background layer in both the browser and static SVG output. See the full interactive build — main view, synced minimap, and a snapshot morph — in Kafka Streams.
JSX
import { NetworkCustomChart } from "semiotic/network" import { lineageDagLayout } from "semiotic/recipes" <NetworkCustomChart nodes={nodes} // each { id, x: layer, y: row, partition, semantic, stores, label } edges={edges} // each { source, target, edgeType, isBackEdge } layout={lineageDagLayout} layoutConfig={{ layerCount, maxLayerSize, reachableIds, selectedId, renderIcon, partitionColors, hullGroupAccessor: "subtopologyId", hullColors, hullPadding: 16, hullRadius: 12 }} selection={{ name: "lineage" }} // LinkedCharts → ctx.selection highlights across views />
Use createLineageDagFit(nodes, plot, config) from semiotic/recipesto share the recipe's exact fitting rules with a minimap. It returns resolved glyph dimensions and LOD, nodeBounds(node), project(layer, row), andinvert(x, y). Coordinates are plot-relative; margins and scrolling are separate. Create one fit per view size/LOD and convert the main viewport through logical coordinates into the minimap. An inverse with a single layer returns layer: null because that axis is collapsed; show the full minimap width in that case. For a custom layout's already-emitted positions, the chart ref's getCustomLayout() supplies readback.
Compositional DAG interfaces
Try the interactive Compositional DAGs example: wire individual fields, compare fixed and optimized row orders, select duplicate wires, and trace dependencies through explicit transfers.
Use prepareCompositionalGraph and routeCompositionalGraph fromsemiotic/recipes/core for connections to identifiable parts or named ports. Every connection has its own ID, including exact endpoint duplicates. A node can also remain an ordinary row or record node. Parts do not acquire dependencies merely by sharing an owner; tracing follows supplied connections and explicit transfers.
Prepare and solve outside the synchronous scene callback. Supply owner-local geometry and either authored positions in route-only mode or explicit order freedoms in optimize mode. The built-in optimizer evaluates routed attachment geometry and legal row swaps with bounded work. It reports infeasible pins, missing anchors, unsupported compound routing, and shared-channel congestion through diagnostics.
When the application draws its own curves, set routing: "terminals". It computes exact attachments without obstacle routing; crossings describe escape-to-escape chords, with zero congestion and bends. Exact duplicates retain distinct lanes. Userouting: "bump" for a midpoint cubic with straight terminal stubs; this mode also ignores obstacles and measures curves with 24 samples. Same-owner connections default to route: "none"; an edge hint can override that with route: "auto". Unrouted connections keep their terminals and trace identity but do not contribute to routing metrics or bundles.
Model an operator chain step as a same-owner connection from one row's out-port to the next row's in-port. Declare a transfer from each row's in-port to its out-port so tracing can pass through it. Keep operator order fixed; permit optimization only when row order has no semantic meaning. When every owner has pin: "both", optimization changes rows without rank placement, including compound graphs and cyclic owner projections. Semantic cycles still require topology: "feedback"; use that option for cyclic owner projections when the solver places owners too.
Overlapping rect scene nodes prefer the smaller rectangle; equal areas prefer the deeper node. Nodes take priority over edges. Set a row's navParentId to its owner's scene ID: arrows move between owners, Enter descends into rows, and Escape ascends. Arrows and Home/End stay among siblings. Accessible tables include a group column for child rows when the authored accessible data does not already provide one. Scene IDs must be unique even when local row IDs repeat.
JSX
import { NetworkCustomChart } from "semiotic/network" import { prepareCompositionalGraph, routeCompositionalGraph, compositionalLayoutOptions, compositionalDagLayout } from "semiotic/recipes/core" // graph: versioned nodes, parts, ports, edges and explicit transfers. // view: representations, complete part orders, anchors and node constraints. // geometry: authored or measured owner-local rectangles, with a revision. const prepared = prepareCompositionalGraph(graph) const solved = routeCompositionalGraph({ requestId: "layout-1", prepared, view, geometry, options: compositionalLayoutOptions({ mode: "route-only" }) }) // Retain the previous accepted scene if solved.status === "infeasible". const layoutConfig = { prepared, solved, showParts: true } <NetworkCustomChart nodes={graph.nodes} edges={graph.edges} layout={compositionalDagLayout} layoutConfig={layoutConfig} frameProps={{ edgeIdentity: "id", edgeIdAccessor: "id" }} title="Interface dependencies" description="Declared connections between identifiable interfaces." accessibleTable />
edgeIdentity="id" opts streaming frames into replacement by edge ID; the default still accumulates pushes by owner pair. updateEdgeById and single-ID removeEdge on a StreamNetworkFrame ref operate on one connection. Clear retained push data before switching from ID identity back to pair identity; this avoids silently merging distinct connections. Controlled edges and their ID accessor can be replaced together in one render.patchCompositionalGraph validates semantic mutations atomically. Serialized graph structure has a schema atsemiotic/spec/v0.1/compositional-graph.schema.json; runtime preparation additionally validates references and directions. These are layout helpers, not a new serialized MCP chart component.
For asynchronous engines, CompositionalLayoutController accepts matching revisions atomically and keeps the last valid solution during work or failure.createCompositionalWorkerEngine takes an application-owned worker;installCompositionalWorker installs the matching worker protocol. Request IDs must be unique for the lifetime of each worker engine, including cancelled requests. Engine results must cover every visible semantic owner and exploded part; collapsed descendants are excluded from that coverage. No worker or optional optimizer dependency is loaded automatically. Cancellation of the built-in synchronous solve discards stale results; it cannot interrupt an executing sweep.
TS
// topology.worker.ts (a module worker owned by the application) import { installCompositionalWorker } from "semiotic/recipes/core" installCompositionalWorker(self) // Main thread; use the same worker alongside other protocols with distinct message types. import { createCompositionalWorkerEngine, CompositionalLayoutController } from "semiotic/recipes/core" const engine = createCompositionalWorkerEngine(worker) const controller = new CompositionalLayoutController() await controller.solve({ ...request, requestId: [chartId, structuralKey, revision].join(":") }, engine) // revision must advance for every request, including retries and cancelled requests. // On teardown: controller.dispose(); engine.dispose(); worker.terminate()
Fallback for applications still on 3.13.2
On 3.13.2, an orthogonal routing failure makes the entire result infeasible. A consumer drawing its own curves from authored LR cards can recompute anchors from its current rectangles when diagnostics report ROUTING_NO_PATHor ROUTING_LANE_SPACE. Do this before deciding to retain a previous solution, including on the first solve. With CompositionalLayoutController, inspect the boolean returned by solve and its diagnostics; a retainedcontroller.solution is not fresh geometry after failure. Each row anchor is its vertical center on the card's right source edge or left target edge. This fallback is consumer geometry, not a feasible orthogonal routing result; retain the routing diagnostic.
The following recipe needs no newer runtime. Pass current world-space card positions and owner-local row rectangles; map folded rows to their authored proxy rectangles. Missing rows are an input error. For node-level header attachments, supply a header rectangle as a row; omitted row IDs use the card center. It preserves duplicate edge IDs and must be recomputed after layout changes. After upgrading, preferrouting: "terminals". Keep the consumer fallback if duplicate-lane clearance failures must also leave row edges visible.
TS
/** Consumer fallback for LR cards with owner-local authored row rectangles. */ export interface AuthoredCard { x: number y: number width: number height: number rows: ReadonlyMap<string, { y: number; height: number }> } export interface RowConnection { id: string source: string target: string sourceRow?: string targetRow?: string } /** Recompute from the current authored layout, including every connection ID. */ export function authoredRowAnchors( cards: ReadonlyMap<string, AuthoredCard>, connections: readonly RowConnection[], ) { const anchor = (id: string, rowId: string | undefined, source: boolean) => { const card = cards.get(id) if (!card) throw new Error(`Missing authored card: ${id}`) const row = rowId === undefined ? undefined : card.rows.get(rowId) if (rowId !== undefined && !row) throw new Error(`Missing authored row: ${id}/${rowId}`) return { x: card.x + (source ? card.width : 0), y: card.y + (row ? row.y + row.height / 2 : card.height / 2), } } return connections.map((edge) => ({ edgeId: edge.id, source: anchor(edge.source, edge.sourceRow, true), target: anchor(edge.target, edge.targetRow, false), })) }
CompositionalNavigator from semiotic/recipes/react supplies keyboard access to parts and ports. useCompositionalInterfaces(prepared, ownerId)from the same entry returns semantic items (ref, label, kind),isRemoved(selected), onOwnerKeyDown(event, focus) andonItemKeyDown(event, index, focus). Supply focusOwner() andfocusItem(index) callbacks to use your own controls and theme. Stable glyph visibility and camera changes reuse solved geometry. Explicit scrolling can use projectCompositionalScrollwith horizontal boundary slots to disclose clipped rows as continuation proxies.CompositionalMeasurementTransaction caps host measurement corrections at two. Unpinned compound optimization, free port permutations and arbitrary interior routing corridors require another adapter. See the working controls, trace, individual duplicate selection and shared HTML row geometry in thecompositional Pipeline Explorer.
Streamgraph
Streamgraphs aren't a recipe — they're StackedAreaChart withbaseline="wiggle" (Byron–Wattenberg offset, post-centered on y=0) orbaseline="silhouette" (symmetric centering). The same layout pipeline that drives stacked areas handles the offset; no escape hatch needed.
For the canonical streamgraph aesthetic — a "central anchor" series with smaller series wrapping outward — pair the baseline with stackOrder="insideOut". The series with the largest total ends up in the middle straddling y=0; smaller series alternate above and below it. Without an explicit order, series stack alphabetically (which is stable under streaming but visually arbitrary).
JSX
<StackedAreaChart data={timeSeries} xAccessor="t" yAccessor="v" areaBy="group" baseline="wiggle" // or "silhouette" for symmetric centering stackOrder="insideOut" // central anchor series, others wrap outward colorBy="group" />
Marimekko (ordinal)
Variable-width stacked bars where each bar's width encodes its category's contribution to the grand total, and the inner stacked segments encode the within-category breakdown bystackBy. Both dimensions are proportional, making it the natural pick for cohort revenue analysis, market share by segment × product, or any "what's the mix within the mix" question.
JSX
import { OrdinalCustomChart } from "semiotic/ordinal" import { marimekkoLayout } from "semiotic/recipes" <OrdinalCustomChart data={salesByRegionAndProduct} layout={marimekkoLayout} layoutConfig={{ categoryAccessor: "region", stackBy: "product", valueAccessor: "revenue", gutter: 4, }} width={760} height={320} />
Bullet chart (ordinal)
Stephen Few's compact KPI replacement for half-circle gauges. Each row stacks three layers: qualitative range bands (poor → satisfactory → good) as backgrounds, a thinner dark bar for the actual measured value, and a perpendicular tick at the target. Each row is independently scaled so metrics in different units (dollars, percentages, counts) sit side-by-side without any shared axis. Rows without positive values are skipped without leaving gaps. When rows cannot fit, a shown/total count below the chart discloses the omission, including in SVG exports.
JSX
import { bulletLayout } from "semiotic/recipes" <OrdinalCustomChart data={[ { metric: "Revenue ($M)", actual: 270, target: 250, ranges: [150, 225, 300] }, { metric: "Profit Margin (%)", actual: 23, target: 27, ranges: [ 20, 25, 30] }, { metric: "Order Size ($)", actual: 102, target: 120, ranges: [ 80, 110, 140] }, { metric: "New Customers", actual: 540, target: 600, ranges: [400, 550, 700] }, ]} layout={bulletLayout} layoutConfig={{ categoryAccessor: "metric", valueAccessor: "actual", targetAccessor: "target", rangesAccessor: "ranges", }} width={600} height={210} />
Parallel coordinates (ordinal)
One polyline per row, traced across N parallel vertical axes. Each axis represents a numeric field with its own independent linear scale, so columns in different units (mpg, horsepower, weight) can sit side-by-side without normalizing. Useful for high-dimensional pattern hunting: clusters of similar rows, outliers that swing wildly between axes, and inverse correlations (lines crossing). Set colorBy to color groups.
Interaction: hover a line or point to dim its neighbors. The demo uses a shared selection and a returned restyle callback to update opacity on retained marks. Its stable layoutConfigcontains only the fields and geometry settings. highlightFnremains useful when you intentionally want the recipe to rebuild draw order; a style-only hover does not need that work.
Hover a line or point to highlight that vehicle without rebuilding its axes.
ParallelCoordinatesRecipe is discoverable through the schema and chart recommender. Its portable configuration requires at least two numeric fields; the lower level layout remains available when a React-only callback such as highlightFnis needed.
JSX
import { ChartRecipe } from "semiotic/ai" <ChartRecipe recipeId="ParallelCoordinatesRecipe" data={cars} layoutConfig={{ fields: ["mpg", "hp", "weight", "accel", "year"], colorBy: "origin", showPoints: true, }} title="Vehicle profiles" description="Vehicle profiles compared across five independently scaled measures." summary="Efficient vehicles generally trade horsepower for lower weight." accessibleTable />
The complete selection examples below use public imports. The ordinal layout returns a style patch; the network cards subscribe to the same selection with useCustomLayoutSelection().
selectionLayouts.tsx defines both layouts and the selection-aware card:
TSX
import React from "react" import { useCustomLayoutSelection } from "semiotic/network" import type { NetworkCustomLayout } from "semiotic/network" import type { OrdinalCustomLayout } from "semiotic/ordinal" import { parallelCoordinatesLayout } from "semiotic/recipes" import type { ParallelCoordinatesConfig } from "semiotic/recipes" function NodeCard({ datum }: { datum: { id: string; title?: unknown; meta?: unknown } }) { const selection = useCustomLayoutSelection() const dim = selection.isActive && !selection.predicate(datum) return ( <div data-service-card={String(datum.id)} style={{ boxSizing: "border-box", width: "100%", height: "100%", padding: "8px 12px", borderRadius: 8, border: "1px solid var(--semiotic-border, #cbd5e1)", background: "var(--semiotic-bg, #ffffff)", color: "var(--semiotic-text, #111827)", boxShadow: "0 1px 3px rgba(0,0,0,0.12)", opacity: dim ? 0.25 : 1, transition: "opacity 140ms ease", }} > <div style={{ fontWeight: 600, fontSize: 14 }}>{String(datum.title)}</div> <div style={{ fontSize: 12 }}>{String(datum.meta)}</div> </div> ) } export const htmlCardLayout: NetworkCustomLayout = (ctx) => { const { plot } = ctx.dimensions const width = Math.min(150, plot.width / ctx.nodes.length - 12) const height = 58 const positions = new Map( ctx.nodes.map((node, i) => [ node.id, { x: (plot.width / ctx.nodes.length) * (i + 0.5), y: plot.height / 2 }, ]), ) return { // Transparent scene marks retain canvas hit testing for the HTML cards. sceneNodes: ctx.nodes.map((node) => { const p = positions.get(node.id)! return { type: "rect", x: p.x - width / 2, y: p.y - height / 2, w: width, h: height, id: node.id, datum: node.data ?? node, style: { fill: "rgba(0,0,0,0)", stroke: "none" }, } }), sceneEdges: ctx.edges.map((edge) => { const source = positions.get(typeof edge.source === "string" ? edge.source : edge.source.id)! const target = positions.get(typeof edge.target === "string" ? edge.target : edge.target.id)! return { type: "line", x1: source.x + width / 2, y1: source.y, x2: target.x - width / 2, y2: target.y, datum: edge, style: { stroke: "#64748b", strokeWidth: 1.5, opacity: 0.8 }, } }), htmlMarks: ctx.nodes.map((node) => { const p = positions.get(node.id)! return { id: node.id, x: p.x - width / 2, y: p.y - height / 2, width, height, content: <NodeCard datum={{ ...node.data, id: node.id }} />, } }), // Opt into selection restyling even though these hit rectangles are invisible. restyle: () => ({}), restyleEdge: (_edge, selection) => ({ opacity: selection?.isActive ? 0.25 : 0.8 }), } } export const selectableParallelLayout: OrdinalCustomLayout<ParallelCoordinatesConfig> = (ctx) => ({ ...parallelCoordinatesLayout(ctx), // Merge a style patch onto retained marks; the axes and geometry stay fixed. restyle: (node, selection) => ({ ...(selection?.isActive && { opacity: node.datum && selection.predicate(node.datum) ? 1 : 0.08, }), }), })
SelectionLayoutDemos.tsx supplies data and connects hover to selection:
TSX
import React from "react" import { LinkedCharts } from "semiotic/ai" import { NetworkCustomChart } from "semiotic/network" import { OrdinalCustomChart } from "semiotic/ordinal" import { htmlCardLayout, selectableParallelLayout } from "./selectionLayouts" const services = [ { id: "orders", title: "Orders", meta: "REST · 1.2k rps" }, { id: "payments", title: "Payments", meta: "gRPC · 480 rps" }, { id: "inventory", title: "Inventory", meta: "queue · 90 rps" }, { id: "shipping", title: "Shipping", meta: "batch · hourly" }, ] const connections = [ { source: "orders", target: "payments" }, { source: "orders", target: "inventory" }, { source: "payments", target: "shipping" }, { source: "inventory", target: "shipping" }, ] const cars = [ { name: "compact", mpg: 32, hp: 95, weight: 2200, accel: 16, year: 2018 }, { name: "sedan", mpg: 26, hp: 180, weight: 3100, accel: 12, year: 2019 }, { name: "suv", mpg: 21, hp: 240, weight: 4200, accel: 10, year: 2020 }, { name: "truck", mpg: 17, hp: 310, weight: 5400, accel: 9, year: 2017 }, { name: "ev", mpg: 92, hp: 350, weight: 4400, accel: 6, year: 2022 }, { name: "sport", mpg: 24, hp: 400, weight: 3200, accel: 5, year: 2021 }, { name: "minivan", mpg: 22, hp: 280, weight: 4600, accel: 11, year: 2019 }, { name: "hybrid", mpg: 52, hp: 130, weight: 3000, accel: 13, year: 2020 }, { name: "wagon", mpg: 28, hp: 195, weight: 3400, accel: 11, year: 2018 }, { name: "coupe", mpg: 25, hp: 320, weight: 3300, accel: 7, year: 2021 }, ] const parallelConfig = { fields: ["mpg", "hp", "weight", "accel", "year"], colorBy: "name", showPoints: true, opacity: 0.7, strokeWidth: 1.5, } export function HtmlMarksDemo() { return ( <div data-testid="selection-html-marks"> <LinkedCharts> <NetworkCustomChart nodes={services} edges={connections} layout={htmlCardLayout} width={720} height={200} responsiveWidth margin={{ top: 20, right: 24, bottom: 20, left: 24 }} animate={false} enableHover linkedHover={{ name: "service", fields: ["id"] }} selection={{ name: "service" }} tooltip={(d) => ( <> <strong>{String(d.title ?? `${d.source} → ${d.target}`)}</strong> <div>{String(d.meta ?? "Service connection")}</div> </> )} title="Service connections" description="Orders connects to payments and inventory; both connect to shipping." summary="Hover a service to highlight its card without moving the graph." accessibleTable /> </LinkedCharts> <p>Hover a card to dim its neighbors. Moving away restores every card.</p> </div> ) } export function ParallelCoordinatesDemo() { return ( <div data-testid="selection-parallel-coordinates"> <LinkedCharts> <OrdinalCustomChart data={cars} layout={selectableParallelLayout} layoutConfig={parallelConfig} width={760} height={320} responsiveWidth margin={{ top: 30, right: 48, bottom: 20, left: 20 }} enableHover linkedHover={{ name: "vehicle", fields: ["name"] }} selection={{ name: "vehicle" }} tooltip={(d) => ( <> <strong>{String(d.name)}</strong> <div> {String(d.mpg)} mpg · {String(d.hp)} hp </div> </> )} title="Vehicle profiles" description="Ten vehicles compared across five independently scaled measures." summary="The electric vehicle has the highest equivalent fuel efficiency." accessibleTable /> </LinkedCharts> <p>Hover a line or point to highlight that vehicle without rebuilding its axes.</p> </div> ) }
Writing your own layout
A layout is a pure function: (ctx) => { nodes, overlays? }. The context exposes the frame's scales, plot-rect dimensions, theme, and a resolveColorhelper that honors the same CategoryColorProvider /ThemeProvider cascade built-in charts use. Emit standard scene nodes (rect, line, area, point,heatcell) and the frame handles the rest.
TSX
import type { CustomLayout } from "semiotic/xy" interface MyConfig { rows: number columns: number valueAccessor: string } export const myLayout: CustomLayout<MyConfig> = (ctx) => { const { rows, columns, valueAccessor } = ctx.config const { plot } = ctx.dimensions const cellW = plot.width / columns const cellH = plot.height / rows const nodes = ctx.data.map((d, i) => { const r = Math.floor(i / columns) const c = i % columns return { type: "rect", x: c * cellW, y: r * cellH, w: cellW - 1, h: cellH - 1, style: { fill: ctx.resolveColor(String(d[valueAccessor])) }, datum: d, } }) return { nodes } }
What you get for free
- Hit testing. Hover, tooltip, click — quadtree built from your scene-node geometry.
- Transitions. Enter/exit/move animations run through the same pipeline as built-in charts.
- Theme cascade. Use
ctx.resolveColor instead of hard-coded literals and the chart honors ThemeProvider +CategoryColorProvider. - SSR. Scene nodes serialize to SVG via the same path the built-in charts use.
- Streaming. Layouts re-run on each push/pushMany — your custom waffle becomes a streaming waffle without extra plumbing.
Recipe authoring contracts
Custom layouts work best when they split semantic marks from decoration. Emit data-bearing scene nodes for anything the reader can hover, click, select, animate, or describe. Render labels, petals, ribbons, arrows, silhouettes, and other visual detail as keyed SVG overlays. If a layout returns overlays without scene nodes, or every scene node has datum: null, Semiotic warns in development because hover callbacks and tooltips have nothing useful to read.
- Stable ids. Give each emitted node a stable identity such as
_transitionKey, pointId, or a recipe-specific id so transitions can interpolate between solved states. - Transparent hit targets. Pictorial glyphs often need a simple scene node underneath the visible overlay. Use
hitTargetPoint,hitTargetRect, networkHitTarget,geoHitTarget, or geoAreaHitTarget with a useful datum. Passcursor: "pointer" when the matching overlay glyph is actionable, and pair it with the frame click/observation API; cursor styling does not create activation or keyboard semantics by itself. If an overlay opts back into pointer events, style that overlay element directly because it, rather than the retained canvas, owns the hit. - Tooltip payloads. Shape datums with user-facing keys, then use
buildTooltipEntries to unwrap hover payloads consistently across custom chart families.
TSX
import { buildTooltipEntries } from "semiotic/recipes" const hit = { type: "rect", x, y, w: width, h: height, style: { fill: "rgba(0,0,0,0)", stroke: "none" }, datum: { category, amount, kind: "bottle" }, group: category, _transitionKey: `bottle-hit-${category}`, } function Tooltip(hover) { const rows = buildTooltipEntries(hover) return rows.length ? ( <div className="semiotic-tooltip"> {rows.map((row) => <div key={row.key}>{row.label}: {row.formatted}</div>)} </div> ) : null }
Push semantics
The push API supports two different mental models. Append streams add observations over time: a new event, trade, request, or passenger enters the layout. State updates replace an existing object's current value: a bottle's fill level changes, a node moves, or a KPI updates. Use ref.current.push(datum) for append streams andref.current.update(id, updater) when identity should stay fixed.
JSX
const ref = useRef(null) // Append semantics: add another observation. ref.current.push({ id: "event-42", category: "A", value: 12 }) // State semantics: update an existing object in place. ref.current.update("planning", (d) => ({ ...d, amount: nextAmount, }))
A pictorial bottle-fill chart is the canonical state-update case: the same bottles stay in the scene graph, keyed by id, while their fill values animate between solved states — no insertions or removals, just an in-place value change per frame.
Network custom diagrams
NetworkCustomChart is not limited to network science charts. It is the right escape hatch for semantic diagrams with nodes, edges, and stable identity: state machines, dependency diagrams, lineage diagrams, Python Tutor memory diagrams, process maps, and other object-reference systems. Use scene rects/circles for the semantic objects and network edges for relationships; use backgrounds for layout-derived regions and enclosures below the scene, and reserve overlays for labels, dividers, arrows, and other detail above it. Both SVG layers are included in static rendering and do not participate in canvas hit-testing.
When the chart has a perspective, the frame projects your scene marks but not those two SVG layers, since they are your own drawing. Wrap ground geometry in NetworkPerspectiveGround and upright chrome inNetworkPerspectiveBillboard, then return perspective: "manual". Both render their children unchanged on a flat chart, so the same layout serves both. The built-in recipes on this page already do this.
HTML marks (rich DOM nodes)
A network layout can return htmlMarks alongside backgrounds /sceneNodes / sceneEdges / overlays: positioned HTML/React nodes that Semiotic renders into one real-DOM layer above the canvas and SVG overlays (stack order: backgrounds → canvas → overlays → htmlMarks). Each mark is{ id, x, y, width, height, content } in the same plot space assceneNodes — the framework owns the margin transform, so a mark at (x, y) lands exactly where a scene node at(x, y) does.
Reach for it over an SVG <foreignObject> when a node istext-heavy or a rich component and dims/animates on hover. HTML laid out inside SVG gets no compositor layer, so an opacity change — the everyday hover-dim — forces the browser to re-rasterize the node's text; across a large graph that stalls the interaction. A real <div> composites opacity /transform / visibility changes without repainting its contents. Marks are pointer-events: none by default, so keep a transparent hit-rect scene node per card and let the canvas stay authoritative for hover, tooltip, and click.
HTML wrappers are virtualized against the nearest ancestor with overflow: auto,scroll, or overlay, with 400 CSS pixels of overscan. Scroll and resize updates share one animation-frame measurement and do not rerun the layout. If there is no measurable scroll target, including during SSR or when the target has zero size, all marks mount. This affects the DOM wrappers; scene geometry and hit targets stay retained. For camera zoom, import ZoomableNetworkCustomChart from semiotic/network/zoom. Its frame transform keeps canvas, SVG, HTML, culling and hit testing aligned. External CSS scaling is not supported.
Hover a card to dim its neighbors. Moving away restores every card.
Each card calls useCustomLayoutSelection() inside its htmlMarks content. The layout also returns restylefor the invisible hit rectangles and restyleEdge for the canvas edges. Selection updates the DOM and canvas styles without running the layout. See the complete source above for the LinkedCharts, linkedHover, and selection wiring. Keep selection in layoutConfig only when it changes geometry.
Stable mark IDs and stable descendant component types/keys preserve mounted content across position updates and node-array replacement. A new node array can still rerun the layout. Once an unpinned, unfocused card is culled, its local React state is discarded; keep durable edits outside virtualized cards. A focused card stays mounted until focus leaves. Removing focused data returns lost focus to the frame. Interactive card content must opt into pointer-events: auto.
Through frameProps, set viewport.scrollContainerRef explicitly, or use viewport.scrollContainer with an element stored by a callback ref when the scroll element can be replaced. A null explicit target mounts all marks; it does not fall back to another ancestor. Configure htmlMarkCulling with enabled, overscan (zero is valid), and pinnedIds. Refs resolve after a React commit; mutating ref.current alone does not notify React.
TSX
import { useState } from "react" import type { NetworkViewportSnapshot } from "semiotic/network" const [scrollContainer, setScrollContainer] = useState<HTMLDivElement | null>(null) const [viewport, setViewport] = useState<NetworkViewportSnapshot | null>(null) <div ref={setScrollContainer} style={{ height: 280, overflow: "auto" }}> <NetworkCustomChart nodes={nodes} edges={edges} layout={cardLayout} frameProps={{ viewport: { scrollContainer }, htmlMarkCulling: { overscan: 80, pinnedIds: selectedId ? [selectedId] : [] }, onViewportChange: setViewport, }} /> </div>
onViewportChange reports unpadded visibleRect, overscanned renderRect, visibleMarkIds, and mountedMarkIds in plot space. Null rectangles mean unmeasured. Off-screen pins appear only in the mounted set. Rectangle changes are reported even when IDs do not change, so a minimap tracks scrolling continuously. Reporting also works without HTML marks or with culling disabled. Feed it to subscribed overlay content and a minimap; keep it out of layoutConfigso scrolling does not trigger layout. Edge culling must test complete path bounds, including links whose endpoints are both outside the window. These props are React-only, not JSON configuration.
Scroll the stages. Select a card to retain it, or edit its note to keep it mounted while focused.
Skip to data tableScroll to explore the topology. The minimap outlines the visible region.
30 visible;30 mounted.No card is pinned.
Virtual viewport and semantic zoom
ZoomableNetworkCustomChart keeps the layout fixed while a camera pans and scales the plot. It clips content without native scrollbars. The gesture runtime and LOD hooks are only included when you import semiotic/network/zoom; ordinary charts keep their existing behavior.
- Source
- Validate
- Enrich
- Aggregate
- Publish
Payments validation needs review; Inventory enrichment is delayed. All other steps are healthy. The complete snapshot is also available in the table below.
Source●
- Output rows
- 24,816
- Batch latency
- 42 ms
- Fields
- 12
Validate●
- Fields
- 12
- Batch latency
- 70 ms
- Output rows
- 24,808
Source●
- Output rows
- 6,320
- Batch latency
- 59 ms
- Fields
- 12
Validate●
- Fields
- 12
- Batch latency
- 87 ms
- Output rows
- 6,309
Drag to pan · scroll or pinch to zoom. Focus the chart for + / − and Alt + arrow controls.
0 of 30 steps in viewSilhouettes → shapes → summaries → full detail
Trace and select all 73 connections
Illustrative metric wiring, not execution or record provenance. Containment adds no dependency. Selecting a connection traces only declared transfers of that metric.
Enter an owner to navigate its interfaces; Escape returns to the owner.
Select a connection to inspect its declared dependencies.
Every edge retains its own ID, including exact duplicates.| ID | Source | Part / port | Target | Part / port | Evidence / attachment |
|---|
| step-0 | rows / out | step-1 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-0 | latency / out | step-1 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-0 | fields / out | step-1 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-1 | rows / out | step-2 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-1 | latency / out | step-2 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-1 | fields / out | step-2 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-2 | rows / out | step-3 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-2 | latency / out | step-3 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-2 | fields / out | step-3 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-3 | rows / out | step-4 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-3 | latency / out | step-4 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-3 | fields / out | step-4 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-5 | rows / out | step-6 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-5 | latency / out | step-6 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-5 | fields / out | step-6 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-6 | rows / out | step-7 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-6 | latency / out | step-7 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-6 | fields / out | step-7 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-7 | rows / out | step-8 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-7 | latency / out | step-8 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-7 | fields / out | step-8 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-8 | rows / out | step-9 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-8 | latency / out | step-9 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-8 | fields / out | step-9 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-10 | rows / out | step-11 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-10 | latency / out | step-11 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-10 | fields / out | step-11 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-11 | rows / out | step-12 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-11 | latency / out | step-12 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-11 | fields / out | step-12 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-12 | rows / out | step-13 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-12 | latency / out | step-13 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-12 | fields / out | step-13 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-13 | rows / out | step-14 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-13 | latency / out | step-14 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-13 | fields / out | step-14 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-15 | rows / out | step-16 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-15 | latency / out | step-16 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-15 | fields / out | step-16 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-16 | rows / out | step-17 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-16 | latency / out | step-17 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-16 | fields / out | step-17 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-17 | rows / out | step-18 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-17 | latency / out | step-18 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-17 | fields / out | step-18 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-18 | rows / out | step-19 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-18 | latency / out | step-19 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-18 | fields / out | step-19 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-20 | rows / out | step-21 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-20 | latency / out | step-21 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-20 | fields / out | step-21 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-21 | rows / out | step-22 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-21 | latency / out | step-22 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-21 | fields / out | step-22 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-22 | rows / out | step-23 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-22 | latency / out | step-23 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-22 | fields / out | step-23 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-23 | rows / out | step-24 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-23 | latency / out | step-24 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-23 | fields / out | step-24 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-25 | rows / out | step-26 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-25 | latency / out | step-26 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-25 | fields / out | step-26 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-26 | rows / out | step-27 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-26 | latency / out | step-27 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-26 | fields / out | step-27 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-27 | rows / out | step-28 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-27 | latency / out | step-28 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-27 | fields / out | step-28 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-28 | rows / out | step-29 | rows / in | Illustrative; unknown /exact geometry |
|---|
| step-28 | latency / out | step-29 | latency / in | Illustrative; unknown /exact geometry |
|---|
| step-28 | fields / out | step-29 | fields / in | Illustrative; unknown /exact geometry |
|---|
| step-0 | rows / out | step-1 | rows / in | Illustrative; unknown /exact geometry |
|---|
Existing record nodes
These illustrative records keep their original node IDs. They need no synthetic field or port conversion.
Camera settings
Fit, Focus step and Reset respect these bounds and locks.
Read all 30 steps as a table
Illustrative daily snapshot. Each pipeline connects consecutive stages from left to right.| Pipeline | Stage | Status | Output rows | Fields | Batch latency |
|---|
| Orders | Source | Healthy | 24,816 | 12 | 42 ms |
|---|
| Orders | Validate | Healthy | 24,808 | 12 | 70 ms |
|---|
| Orders | Enrich | Healthy | 24,808 | 16 | 98 ms |
|---|
| Orders | Aggregate | Healthy | 15,380 | 6 | 126 ms |
|---|
| Orders | Publish | Healthy | 15,380 | 6 | 154 ms |
|---|
| Customers | Source | Healthy | 6,320 | 12 | 59 ms |
|---|
| Customers | Validate | Healthy | 6,309 | 12 | 87 ms |
|---|
| Customers | Enrich | Healthy | 6,309 | 16 | 115 ms |
|---|
| Customers | Aggregate | Healthy | 3,911 | 6 | 143 ms |
|---|
| Customers | Publish | Healthy | 3,911 | 6 | 171 ms |
|---|
| Payments | Source | Healthy | 18,364 | 12 | 76 ms |
|---|
| Payments | Validate | Review | 18,268 | 12 | 104 ms |
|---|
| Payments | Enrich | Healthy | 18,268 | 16 | 132 ms |
|---|
| Payments | Aggregate | Healthy | 11,326 | 6 | 160 ms |
|---|
| Payments | Publish | Healthy | 11,326 | 6 | 188 ms |
|---|
| Inventory | Source | Healthy | 9,840 | 12 | 93 ms |
|---|
| Inventory | Validate | Healthy | 9,823 | 12 | 121 ms |
|---|
| Inventory | Enrich | Delayed | 9,823 | 16 | 980 ms |
|---|
| Inventory | Aggregate | Healthy | 6,090 | 6 | 177 ms |
|---|
| Inventory | Publish | Healthy | 6,090 | 6 | 205 ms |
|---|
| Shipments | Source | Healthy | 4,386 | 12 | 110 ms |
|---|
| Shipments | Validate | Healthy | 4,366 | 12 | 138 ms |
|---|
| Shipments | Enrich | Healthy | 4,366 | 16 | 166 ms |
|---|
| Shipments | Aggregate | Healthy | 2,706 | 6 | 194 ms |
|---|
| Shipments | Publish | Healthy | 2,706 | 6 | 222 ms |
|---|
| Events | Source | Healthy | 76,820 | 12 | 127 ms |
|---|
| Events | Validate | Healthy | 76,797 | 12 | 155 ms |
|---|
| Events | Enrich | Healthy | 76,797 | 16 | 183 ms |
|---|
| Events | Aggregate | Healthy | 47,614 | 6 | 211 ms |
|---|
| Events | Publish | Healthy | 47,614 | 6 | 239 ms |
|---|
Open the Pipeline Explorer for the complete example, including its inspector, minimap, persistent notes and Full Code view.
TSX
import { ZoomableNetworkCustomChart, useNetworkLOD, useNetworkLODLevel } from "semiotic/network/zoom" function LevelOnlyCard({ focused }: { focused: boolean }) { const level = useNetworkLODLevel(260, { breakpoints: [55, 125, 235], hysteresis: 8, keepDetail: focused }) return <CardContent level={level} /> } // Use the live-size hook when the content needs displayed dimensions. function Card() { const { width, height, level, isInteracting } = useNetworkLOD(260, 174, { breakpoints: [55, 125, 235], hysteresis: 8, // Set keepDetail while an editor has focus. }) // Keep the same outer box and edge ports at every level. // Choose silhouettes, skeletons, summaries or full detail here. // Gate expensive requests on level and !isInteracting; cancel stale work. return <CardContent level={level} displayedSize={{ width, height }} /> } <ZoomableNetworkCustomChart ref={chartRef} nodes={nodes} edges={edges} layout={layout} width={800} height={500} zoomOptions={{ minZoom: 0.15, maxZoom: 4, panBounds: contentBounds }} frameProps={{ htmlMarkCulling: { overscan: 80, pinnedIds: selectedIds } }} /> // chartRef.current.fitToContent(bounds?, { padding, maxZoom, duration }), // zoomIn(), zoomOut(), panBy(dx, dy), resetZoom(), // centerOn(rectOrPoint, { k, duration, insets }), getMarkBounds(id), // centerOnMark(id), fitToMarks(ids), revealMark(id) // Supply zoom={{ x, y, k }} and onZoomChange for a controlled camera.
Wheel zoom requires Ctrl or Meta by default so an embedded chart does not trap page scrolling. Set wheelZoom: true for a dedicated map-like explorer. Mouse drag, touch pinch, double click, plus/minus keys and Alt+arrow panning are supported. Ordinary arrows retain network navigation. Native browser zoom shortcuts and editing controls keep their behavior. Wheel, drag and pinch follow input each animation frame; durationcontrols eased button, keyboard, fit and programmatic zoom transitions. settleDelay defers detail promotion without delaying camera movement.
For an explorer that uses ordinary arrows to move the camera, opt into zoomOptions={{ keyboard: { arrowKeys: "pan" } }}. Each arrow pans by 60 screen pixels, independent of zoom; Alt+arrows still pan, and plus/minus still zoom. The default keyboard: trueand explicit { arrowKeys: "navigate" } keep ordinary arrows for node navigation. keyboard: false disables camera shortcuts while preserving node navigation. Inputs, editable card content, browser shortcuts and Tab keep their native behavior. Provide node access through your cards or accessible table when choosing ordinary-arrow panning.
zoomOptions also exposes locked, zoomEnabled, pan (true, false, "x" or "y"), and separate gesture switches. Scale and pan bounds apply to fit and imperative movement too. Content smaller than the viewport is centered. Fit uses all retained nodes and card boxes; pass explicit bounds to include arbitrary SVG decorations or edge curves.
When chrome such as an inspector panel covers part of the chart, set zoomOptions={{ insets: { right: 690 } }} in screen pixels. Fit, centerOn, reveal, pan bounds and centered zoom (buttons, plus/minus keys and locked axes) then use the remaining viewport; changing insets alone does not move the camera. getMarkBounds(id) reads an HTML mark's box, or else a scene node's, from the retained layout, and centerOnMark, fitToMarks and revealMarknavigate by id. Set zoomOptions={{ anchor: { markId } }} to keep that mark's center at the same screen position when the layout runs again: the camera translates once per layout commit and keeps its scale. Zero-duration programmatic moves, such as zoomTo(view, 0), apply in a microtask rather than on the next animation frame, so a correction made from a React effect paints in the same frame as the layout change.
Use useNetworkLODLevel(width, options) for cards that only need a discrete detail level. It avoids rerendering during camera movement when that level stays unchanged. useNetworkLOD also returns live pixel sizes, so it updates on every scale frame even when you only destructure its level. useNetworkProjectedSize exposes live and settled CSS-pixel sizes; useNetworkZoom exposes the camera and world-coordinate visible rectangle for edge culling or minimaps; pass a selector, as in useNetworkZoom((state) => state.settledZoom.k), to rerender only when that value changes. The LOD helper delays promotion until motion settles and demotes immediately outside its hysteresis band. It does not fetch or cache data. Store drafts outside virtualized cards if they must survive unmounting, and set keepDetail while an editor is focused. At very small scales, aggregate dense graphs or draw cheap detail on canvas: zooming out can make many more cards visible.
For nested card and row hit rectangles, the smallest containing rectangle wins; equal-area ties use the first scene entry. Nodes take precedence over edges. For visible links drawn in SVG overlays, emit networkEdgeHitTarget into sceneEdges with the same plot geometry. Its default curved path hits the stroke only; use type: "ribbon" or "bezier" for filled bands. Set interactive: false for a table-only edge, or return edgeHitTesting: false from the layout to disable all edge hover, clicks, and cursors while keeping nodes interactive. Edges still render and retain accessible table rows. Overlay pointer events must reach the frame. Keyboard network traversal remains node-based.
Sub-path import
Each frame's escape-hatch HOC ships from its own sub-path: XYCustomChart fromsemiotic/xy, NetworkCustomChart fromsemiotic/network, OrdinalCustomChart fromsemiotic/ordinal, and GeoCustomChart fromsemiotic/geo. Layout recipes live on semiotic/recipes as a separate sub-path so they only land in the bundle if you actually use them. BYO deps (d3-flextree, dagre) are imported by your code, not Semiotic — keeps the library small.
JSX
import { XYCustomChart } from "semiotic/xy" import { NetworkCustomChart } from "semiotic/network" import { OrdinalCustomChart } from "semiotic/ordinal" import { GeoCustomChart } from "semiotic/geo" import { waffleLayout, calendarLayout, flextreeLayout, dagreLayout, marimekkoLayout, bulletLayout, parallelCoordinatesLayout, isometricLandmarkLayout, buildTooltipEntries, } from "semiotic/recipes"
Notes
- Plot-relative coordinates. Scene-node positions are in plot space — the frame already translates by the resolved
margin. Usectx.dimensions.plot for the drawing rect. - Renderer dispatch. When
customLayout is provided, the frame uses a renderer set that handles every node type, so your layout can emit any mix of rects, areas, lines, etc. regardless of chartType. - Extents. If your layout uses scales, pass
xExtent /yExtent on XYCustomChart to lock the domain. Layouts that don't use scales (waffle, calendar) ignore them. - For richer composition examples, seerecipes pages. Streamgraph baseline lives on StackedAreaChart.
- See it end-to-end in the Cookbook. Several Cookbook entries build the same chart concepts as worked examples —Marimekko,Slope,Radar,Isotype, andTimeline. Some use these layout functions; others reach the same result through a Stream Frame directly — useful for comparing the two routes.