Largest texture edge in texels the GPU allows (capped at 4096); 0 when the engine has no texture support.
Undo / redo depth of the zoom history (at most 50 steps; cleared by a new chart).
Optionaldesc: Omit<PrimitiveObjectDescriptor, "shape">Optionaldesc: Omit<PrimitiveObjectDescriptor, "shape">Optionaldesc: Omit<PrimitiveObjectDescriptor, "shape">Optionaldesc: Omit<PrimitiveObjectDescriptor, "shape">Atomically appends one chunk per area series, in render order. Stacked / percent chunks
must have equal lengths and identical x; overlap chunks may differ. Validation failure
leaves every series unchanged. maxPoints trims each series to its newest samples.
Styles, visibility and the zoom window are preserved. Returns the retained lengths.
Stacks recompute cumulative tops in O(retained samples); overlap uses the line FIFO path.
Optionaloptions: AppendSeriesOptionsAppend XYZ samples to a cloud, optionally retaining only the newest maxPoints. Preserves orbit and visibility; returns the retained series length. IDs are rebased. Currently copies retained metadata and rebuilds native geometry (not an O(chunk) GPU upload).
Optionaloptions: PointCloud3DAppendOptionsStreams samples onto one line / overlap area series. Stacked / percent areas use
appendAreaData instead. x (required iff the chart
has x) must not go back before the series' last x. With maxPoints the oldest samples
beyond it are dropped and ids are re-based. Amortized O(appended) in the engine plus a
rebuild of the visible window on the next frame; the SDK keeps no copy of streamed data
(tooltips / a11y read it back from the engine). Returns the new sample count.
Optionalx: number[] | Float64Array<ArrayBufferLike> | Date[]Optionaloptions: AppendSeriesOptionsApplies an instant 3D spatial layout preset (cluster-sphere, radial-shells, helix, grid-3d).
Removes the brush and its selection; emits an empty 'select' when something was selected.
Clears every parallel coordinates brush interval (no-op without a brush or chart).
Removes every scene object and the active chart.
Clears the graph selection and, with a chart shown, its brush selection (see clearChartSelection).
Copies the chart image (PNG, toImage) to the clipboard. Resolves false when the browser
has no ClipboardItem / clipboard.write or refuses (call it from a user gesture).
Optionaloptions: Omit<ChartImageOptions, "format" | "quality">Creates a texture from raw RGBA8 texels (straight alpha, row-major, first row at the top of the
image); returns its id. Handy for procedural textures such as checkerboards. Throws when
rgba.length is not width * height * 4.
Creates an HDR environment map from linear RGB floats: width * height texels, 3 floats each,
row-major with the top row straight up (equirect, 2:1, at most 4096x2048). Same prefiltering
and use as loadEnvironmentHdr. Negative and non-finite values are treated as 0, values
above 65504 are clamped. Returns the texture id. GPU errors while prefiltering (validation
or out of memory) throw on WebGL2; WebGPU reports them asynchronously, so there the map is
returned, then freed again with a console warning: await environmentReady(id) to catch them.
Detaches every interaction, removes overlay DOM, and releases the WASM engine.
Removes the objects and textures a loadGltf call created.
Frees a texture. Objects that used it render untextured (white) from then on. Returns false for an unknown id.
Downloads toPDF().
Optionaloptions: Omit<ChartImageOptions, "format" | "quality">Downloads exportChartSVG().
Optionaloptions: ChartSvgOptionsDownloads toImage (format from the extension unless options.format is given).
Optionaloptions: ChartImageOptionsTreemap / sunburst: shows the subtree of target (node index, flat input id, or node
name). Returns false when unchanged or not drillable (leaves). Emits 'drill'; call
render() afterwards (pointer, keyboard and breadcrumb drills render themselves).
Treemap / sunburst: back up one level. Returns false at the top.
Returns the active high-dimensional embedding dimension D (0 if dataset was loaded as raw 3D coordinates).
Fades every series but seriesIndex (null clears).
Binds pointer hover & click interactions to canvas so users can immediately inspect node data
via a floating tooltip and click callbacks without writing manual raycast/NDC boilerplate.
Returns a cleanup function () => void to detach listeners and remove the tooltip.
Optionaloptions: NodeInteractionOptionsResolves once the GPU prefiltering of an HDR environment map (loadEnvironmentHdr /
createEnvironmentFromFloat) is known to have succeeded. Rejects with the creating method's
error (createEnvironmentFromFloat: GPU error while creating the environment map: ...) when it
failed; the map has then been freed with disposeTexture. Only needed for
createEnvironmentFromFloat on WebGPU: everywhere else such errors already throw or reject.
Rejects for ids that are not live HDR environment maps.
getChartDataTable() as RFC 4180 CSV (CRLF rows).
The current 2D chart view as a vector SVG document (chart-svg.ts): engine marks as paths /
rects / circles (decimated lines stay decimated; maxMarks caps points), clipped like the
canvas, plus the DOM overlay as <text>. Heatmaps embed their plot as a PNG; 3D views and
kinds without a vector writer embed the canvas (with a console warning).
Optionaloptions: ChartSvgOptionsCSV of the parallel coordinates rows (activeOnly: only the rows inside the brush).
Optionaloptions: { activeOnly?: boolean }Exports the current 3D Scene (objects, transforms, materials, physics, lighting, helpers) as a
serializable SceneDescriptor. Textures the objects use are listed in textures (ids, size and
src for fetched images); pixel data is not exported.
Jumps a running chart animation to its final frame (call render() to show it).
Re-frames the camera on the current chart.
Frames every node: centers the camera on them and sets the distance at which they fill the
view from the current direction (the engine fits horizontally and vertically, so wide and
tall canvases both fill). Also the overview distance focusNode zooms relative to.
Centers the camera on a node (a chart data point in chart mode) and, in graph / 3D views,
moves it closer: by default to 40 % of the overview distance (fitToView / setCameraPose),
never farther than it is (options.distance overrides; false keeps it). The move is
immediate. Returns false for an unknown id.
Optionaloptions: FocusNodeOptionsPopulates realistic domain metadata for all current nodes in the graph (useful for demos or quick inspection).
The SDK-wide animation setting (null = off).
Applied main-pass sample count (1 = off, 4 = MSAA x4).
Current scale options of one axis, or null (no line / area / scatter chart).
Orbit camera pose: target, eye, distance, yaw / pitch, field of view and aspect. null on
engine builds without the camera_state binding.
Chart data as { columns, rows } (line: x rows x series columns; bar: categories; heatmap:
grid rows x columns). Full by default; maxRows / maxColumns downsample evenly (first /
last kept, sampledRows / sampledColumns set). A full 4096 x 4096 heatmap is 16M cells:
cap it, or use exportChartCSV(), which streams rows.
Optionaloptions: DataTableOptionsCurrent point editing options (null = off).
Short text summary of the active chart (the canvas aria-label).
Data x of the current chart hover's primary point (line: series x or sample index; bar:
category index; scatter: x), null without one. What synced charts hover at.
Navigator strip [left, top, width, height] in CSS px (null without one).
Returns complete live 3D state, topology connectivity, and custom metadata for nodeId.
Retrieves stored metadata for a node ID (or a default generated label if none was registered).
Row indices inside the brush (visible series; every visible row without a brush).
Current parallel coordinates brush in axis values (category axes also list their names).
GPU buffer / texture bytes, chart upload bytes, staged mark counts and the WebAssembly memory size of this engine (chart-stats.ts); null on backends without counters.
Fits of the scatter chart's trendlines (ScatterChartOptions.trendline); empty for other charts.
Committed brush selection of the active chart (re-queried after data / legend changes), or null.
Current data of one series (after edits): line series index as x (x values, or sample
indices) and y; scatter series id index as the x / y of its points with their point
index in the input arrays. null without a line / scatter chart or for an unknown series.
Sync group key and effective flags of this instance (null when not synced).
Textures created through this SDK, by id (src is set for string / URL sources only).
The current watermark with defaults filled in (null = none).
Visible x range in data units: line charts the series x (epoch ms on time axes) or the
sample index, scatter charts x values. null for bar charts / without a chart.
Current [min, max] of the right y domain, or null (no right-axis series).
Current [min, max] of the line chart's y domain, or null.
Visible y range in data units: the line / area y domain (autoscaled or zoomed), scatter y (null otherwise).
True while built-in camera controls (enableNodeInteractions cameraControls) drive the
camera of the current graph / 3D view: hosts should skip their own camera drag / wheel handling.
True while chart mouse drags draw a brush (setChartBrush on and a chart shown): hosts should
skip their own drag handling unless Alt is held (Alt + drag navigates).
True when the active chart handles wheel / drag itself (2D line chart navigation).
True while an enableNodeInteractions binding owns touch / pen gestures (hosts should skip their own).
Removes the loading indicator (and a pending delayed one).
Computes and highlights the undirected shortest path between startNodeId and endNodeId via BFS.
Returns the ordered sequence of node IDs along the path.
Hovers the chart at data x like a pointer resting there in index mode (crosshair + markers
of every series at that x; bars: the category at round(x)), without 'hover' events.
null / out of range clears. tooltip also shows the built-in tooltip (needs
enableNodeInteractions). Returns true when something is hovered; call render() to draw.
Optionaloptions: { tooltip?: boolean }True while a chart animation runs.
True between showLoading and hideLoading (also while a delay is pending).
Bulk loads a custom 3D graph or embedding point cloud from flat TypedArrays.
Projects an arbitrary D-dimensional embedding matrix (vectors.length === N * options.dimensions,
supporting 64D, 128D, 384D, 768D, 1024D, 1536D, 3072D, 4096D+) into 3D space (x, y, z)
and constructs a cosine-similarity k-NN graph inside Rust WASM.
Loads a Radiance .hdr (RGBE, flat or run-length encoded, at most 4096x2048) as an HDR
environment map; resolves to its texture id for setShading({ environment: { map } }).
The equirect image is downsampled to at most 1024 texels wide and prefiltered once on the
GPU: a GGX mip chain read by roughness plus spherical-harmonics diffuse irradiance. Radiance
above 1 is kept for exposure and tone mapping. Strings and URLs are fetched (CORS applies).
Rejects with an AbortError when signal fires and with loadEnvironmentHdr: ... for
malformed or oversized files and for GPU errors while prefiltering (validation or out of
memory; the map is freed again). Free it with disposeTexture.
Loads a glTF 2.0 model (.gltf with external or data: buffers / images, or .glb) as custom
meshes, one object per triangle primitive with the node hierarchy baked into the vertices.
position / rotation become the objects' transform, scale is baked in. Base color factor
and texture, metallic / roughness factors, emissive and alpha modes map onto the scene material;
unsupported features are skipped with one console.warn per kind. Rejects with an AbortError
when signal fires and with loadGltf: ... errors otherwise; objects and textures created
before a failure are removed. Free the model with disposeGltf(result).
Declaratively loads an entire 3D Scene from a SceneDescriptor (clearing existing objects).
loadScene for a scene exported in another session: textures in descriptor.textures that
have a src are loaded first (a live texture with the same src is reused) and the objects'
map ids are remapped to the new ids. Textures that fail to load, and textures without a src
that no live data texture of the same id and size replaces, are dropped from the objects with a console warning.
Decodes an image and uploads it as a texture; resolves to its id for the map field of
addBox / addPrimitive / addCustomMesh / setObjectMaterial. Strings and URLs are fetched
(CORS applies); other sources are decoded with straight alpha and the browser's default color
handling. Images whose longest edge exceeds maxTextureSize are downscaled keeping the aspect
ratio. ImageData is uploaded as is. Rejects with an AbortError when signal fires and with
loadTexture: cross-origin image for tainted sources.
Subscribes to an SDK event ('hover', 'click', 'rangechange', 'legendtoggle',
'themechange', 'resize'); returns the unsubscribe function. Pointer events need
enableNodeInteractions. Existing option callbacks keep working alongside.
Pans the x axis of a 2D line chart by a canvas-relative NDC delta.
Pans both axes of a scatter chart by a canvas-relative NDC delta (+y = up).
Batch version of projectNodeToScreen (one WASM call for many labels).
Returns [x0, y0, x1, y1, ...] in canvas pixels; NaN for points behind the camera.
Projects a 3D node's world position into 2D canvas pixel coordinates { x, y, ndcZ }.
Returns null if the node is behind the camera or out of bounds.
Records the current zoom as an undo step (wheel / drag / box gestures do it themselves).
Queries the top topK most similar nodes to nodeId using exact D-dimensional Cosine Similarity
computed directly in the original high-dimensional embedding space (R^D).
Re-applies the last undone zoom; true when the view moved.
Renders a 2D area chart natively: overlapping areas filled to zero, stacked areas, or
percent-stacked areas (options.mode). Strokes, M4 decimation, axes (index / numeric / time
x), legend (toggle re-stacks), zoom / pan, and hover work like renderLineChart; tooltips
show the raw series values plus the total (stacked) or each share (percent).
Optionaloptions: AreaChartOptionsTwo independent curves filled between their edges (no center line required). Shares numeric / time axes, dual-edge LOD, legend, zoom, brush and vector export. Replace both channels together by calling this method again.
Optionaloptions: BandChartOptionsRenders a bar chart natively: flat 2D bars with rounded data ends and nice-tick axes, or a lit 3D matrix. Negative values hang below the zero baseline. Hover highlights on the GPU.
Optionaloptions: BarChartOptionsRenders a box plot (or violins with violin) natively: one distribution per category and
series, series side by side like grouped bars. Quartiles (numpy linear interpolation),
whiskers ('tukey' 1.5 IQR, 'minmax', or a percentile pair), outlier counts, a capped
outlier sample and the violin KDE are computed in the engine in O(n) per group; the
samples are uploaded once and not kept. Hover reports a group's statistics, or the value
of the outlier under the pointer. Data point ids: box = series * categories + category,
outliers follow (chart_box_outliers).
Optionaloptions: BoxPlotOptionsRenders a calendar heatmap natively: one cell per day of each range (a year, a month or
[start, end]; default one calendar per year of the data) in week columns (or rows when
vertical) starting at firstDay, colored by the heatmap colormap (empty days in a neutral
tone), with weekday / month / year labels, month split lines and a colorbar. Dates are
'YYYY-MM-DD' (as written) or epoch ms / Date (their day in the chart time zone). Hover and
the keyboard visit every day. Throws for an invalid date, range or option. Point ids = day
offset over the calendars.
Optionaloptions: CalendarHeatmapOptionsRenders a candlestick (OHLC) chart natively: bodies + wicks on the GPU, per-pixel-column OHLC aggregation in the engine once candles get narrower than ~2 px (open = first, high = max, low = min, close = last; 1,000,000+ candles stay interactive), optional volume pane, x zoom / pan (wheel / drag / pinch) with the price axis fitting the visible candles, a crosshair, and an O/H/L/C/V tooltip. Rising candles default to the theme's first palette color and hollow bodies, falling ones to the second color (blue / orange: not red / green alone). Data point ids = candle index.
Optionaloptions: CandlestickChartOptionsRenders a chord diagram natively (d3-chord chord() / chordDirected() layout in the
engine): one outer arc per group sized by its total flow, padAngle apart from
startAngle, and one ribbon per pair of groups (per direction when directed, with arrow
tips) colored by source, target or a gradient. Input: a square flow matrix with names, or
ECharts-style nodes / links. Hovering a group lights its ribbons and dims the rest; ribbon
tooltips show both directions. The legend emphasizes / hides groups (re-laid out, tweened
when animation is on). Throws for an invalid matrix or option before the current chart is
replaced. Point ids: group index, then n + source * n + target per ribbon.
Optionaloptions: ChordChartOptionsRenders a combo chart natively: bar, line and area series (type per series) on one plot
sharing a category axis (categories) or numeric / time x, with an optional right y axis
(yAxis: 'right'). Bars (barMode grouped / stacked / percent) sit on category slots and
line points on the slot centers; layout, restacking on legend toggles, both y domains, area
fills, hover (every series at the hovered category: bars tinted, line markers) and x zoom /
pan run in the engine. Line / area series take the line styles (marker, dash, curve,
nulls). Data point ids = seriesIndex * categoryCount + categoryIndex.
Optionaloptions: ComboChartOptionsIndependent high/low whiskers around each center; all channels are replaced atomically.
Optionaloptions: ErrorBarChartOptionsRenders a funnel chart natively: stages from the largest to the smallest share of the widest stage (trapezoids narrowing to the next stage, or centered bars), 2 px surface gaps, labels with value and conversion rate (of the first / previous stage, computed in the engine), and a hover tooltip with both rates. Values must be finite and >= 0. Point ids = stage index.
Optionaloptions: FunnelChartOptionsRenders a gauge natively: an arc from min to max (default 0-100, -120 to 120 degrees)
with threshold bands (status bands use the reserved good / warning / serious / critical
colors with an icon + label), a needle (default with bands) or a progress arc, min / max
labels and the formatted value in the center. Throws for an invalid range or band. Use
setGaugeValue for live values (only the indicator is rebuilt). Point ids: 0 = value,
1 + k = band k in drawing order (sorted by from).
Optionaloptions: GaugeChartOptionsRenders a 2D graph natively (ECharts graph): layout 'force' (force-directed in the
plane on the engine's CPU simulator, settled before display; fixed nodes stay at x / y),
'circular' (slices by value, clockwise from 3 o'clock; rotateLabel runs labels outward),
'none' (given x / y, aspect kept) or 'cartesian' (x / y on value axes with gridlines;
xAxis.categories for a category x). Category colors with a legend that toggles and
emphasizes, size by value (symbolSize: [min, max]), straight or curved edges with
optional arrows, hover highlights the node and its links. Input is validated before the
current chart is replaced (a throw keeps it). Data point ids: node index.
Optionaloptions: GraphChartOptionsRenders a multi-series bar chart natively: 'grouped' (side by side), 'stacked' (positive
values stack up, negative values down) or 'percent' (each category normalized to 100%).
Layout, stacking, hit-testing, and legend toggles (re-stacking) run in the engine. Stacked
hover reports every series of the category (tooltip adds the total / shares).
Data point ids = seriesIndex * categories.length + categoryIndex. The 3D matrix view
(viewMode: '3d') shows the first series only.
Optionaloptions: GroupedBarChartOptionsRenders a heatmap / matrix natively: the cols x rows grid is uploaded once as a float
texture and drawn as ONE quad (4096 x 4096 cells stay interactive), colored through a
256-entry LUT built by the engine (sequential single hue, viridis, magma, or diverging
around center). Wheel / drag zoom and pan both axes; hover outlines the cell under the
pointer. A colorbar is drawn right of the plot. Data point ids = row * cols + col.
Optionaloptions: HeatmapChartOptionsRenders a histogram of raw values: the engine bins them in O(n) (Freedman–Diaconis with a
Sturges fallback, or bins equal-width bins; 1,000,000+ values) and draws zero-gap bars on
a numeric x axis ticked at bin edges. Hover shows the bin range and its count / density.
Data point ids = bin index.
Optionaloptions: HistogramChartOptionsIndependent stems from each series baseline to its samples, with optional tip markers.
Optionaloptions: ImpulseChartOptionsRenders a multi-series line chart natively (Rust + WebGPU): screen-resolution M4 decimation, constant-pixel strokes, nice-tick axes, legend, x zoom / pan, and GPU hover overlays. Handles 1,000,000+ points at 60 FPS. Data point ids = series offset + sample index.
Optionaloptions: LineChartOptionsHigh–low stem, left open tick and right close tick; shares candle LOD, volume and navigation.
Optionaloptions: OhlcChartOptionsRenders parallel coordinates natively: one polyline per row across dimensions (value /
category / time axes, each with nice ticks, min / max and inverse), side by side or
stacked (orient), straight or smooth, colored by series (legend toggles) or by a value
dimension through the heatmap colormap (colorBy, with a colorbar). Dragging along an axis
brushes an interval (Shift adds one, a click clears the axis; several on one axis = union,
several axes = intersection); rows outside fade to inactiveOpacity. A brush change only
re-uploads the row flags. Hover lists every dimension of a row; the keyboard moves along an
axis in value order and Shift brushes. Throws for an invalid cell, dimension or option
(before the active chart is torn down). Point ids = row index (series in order).
Optionaloptions: ParallelChartOptionsRenders a pictorial bar chart (ECharts pictorialBar): a 2D bar chart (items, or grouped /
stacked / percent series) whose bars are drawn as symbols, built-in shapes or path:// SVG
paths, stretched over each bar or repeated along it and optionally clipped at the value
(chart-pictorial.ts). Symbol options are chart defaults, overridden per series / item.
background tracks act as the shadow bars. Hover, tooltips, legend, labels, a11y and
exports are the bar chart's. Throws for invalid symbol options or viewMode: '3d' before
the current chart is replaced.
Optionaloptions: PictorialBarChartOptionsRenders a pie / donut chart natively. The engine validates the values (finite and >= 0, else
this throws), folds the smallest slices beyond maxSlices (default 8) into "Other", sorts,
lays out the angles and tessellates the slices with 2 px surface gaps and anti-aliased edges;
hover explodes the slice under the pointer (O(log n) angle search). Outside labels get leader
lines and per-side collision nudging from the engine; the SDK only places the DOM text.
Legend click hides a slice (the rest re-lay out). Data point ids = displayed slice index.
{ rings } data draws nested rings (each with its own percents, folding and labels); same
names share a color and one legend entry across rings.
Optionaloptions: PieChartOptionsIndependent XYZ billboards with depth-tested orbit navigation.
Optionaloptions: Scientific3DChartOptionsRenders a polar chart natively (ECharts polar with angleAxis / radiusAxis): each axis
is a category or value axis (nice ticks, min / max, labels, split circles / spokes);
startAngle (degrees clockwise from 12 o'clock) and clockwise orient the angle axis,
innerRadius opens a hole. Series: radial / ring bars (whichever axis is the category one;
stacked by stack, roundCap), lines (open / closed, smooth, area, markers), scatter
points and heatmap cells (category angle x category radius, colormap and colorbar). Hover
outlines the item; the legend emphasizes / hides series (axes re-fit, tweened when animation
is on). Throws for an invalid item or option before the current chart is replaced. Point
ids = series offset + item index.
Optionaloptions: PolarChartOptionsRenders a radar (spider) chart natively: one closed polygon per series (1 to 8) over axes
(at least 3) on a shared nice radial scale (max fixes it, or gives one max per axis), with
translucent fills, strokes, vertex markers and a concentric grid. Hover picks the axis
nearest to the pointer and lists every visible series there; the legend toggles / emphasizes
series. Throws for invalid values (negative / infinite) or shapes. Point ids =
series * axes + axis.
Optionaloptions: RadarChartOptionsRenders a sankey diagram natively (d3-sankey layout in the engine): nodes in columns
(longest path, align, or explicit column), breadth by value, iterations rounds of
relaxation with collision resolution (nodes in a column never overlap), cubic bezier
ribbons as wide as their value. Hover highlights the connected flows; the tooltip reads
A → B: value (x% of A). Links forming a cycle throw (the message names the nodes). Data
point ids: node index, then node count + link index.
Optionaloptions: SankeyChartOptionsRenders a 2D scatter / bubble chart natively (Rust + WebGPU): instanced px-sized points uploaded once (1,000,000+ points at 60 FPS), nice-tick x / y axes, series legend, wheel zoom / drag pan on both axes, and grid-hashed nearest-point hover. Data point ids = point index.
Optionaloptions: ScatterChartOptionsRenders a sparkline: a line / area / bar / win-loss chart with zero chrome (no axes, grid,
legend, title or overlay DOM; ~2 px padding; no zoom; tooltip opt-in). Last / min / max
markers and the reference band are engine marks; the canvas gets role="img" and a trend
aria-label ('Revenue: trend up 12% from 100 to 112, min 95, max 120'). Pair with a shared
CharturboDevice for pages with hundreds of sparklines. Data updates (setSeriesData) move the
markers. See chart-sparkline.ts.
Optionaloptions: SparklineOptionsRenders a sunburst natively: radial partition with one ring per depth (pie tessellation:
anti-aliased arcs, 2 px gaps). The center is the current root; a click drills into the arc,
the center goes back up. Hover highlights the path; labels sit at arcs that fit them. Same
input as renderTreemap.
Optionaloptions: HierarchyChartOptionsY-up row-major height grids; nonfinite vertices make cell holes.
Optionaloptions: Scientific3DChartOptionsRenders a ThemeRiver (streamgraph, ECharts themeRiver) from [x, value, name] rows: one
smooth stream per name around a moving baseline (offset: d3 wiggle by default, silhouette,
zero; order: input or inside-out). Names stack in order of first appearance; a name without
a row at some x is 0 there. Hover lists every stream at x (plus the total) and emphasizes the
stream under the pointer; legend toggles re-order and recompute the baseline; stream names
label the left end of each stream. Streams append with appendAreaData (one chunk per name,
in stream order). See chart-theme-river.ts.
Optionaloptions: ThemeRiverChartOptionsRenders a tidy tree natively (d3-hierarchy tree() layout in the engine): nodes by depth,
siblings 1 apart and cousins 2 apart, parents centered over their children. orient picks
the root's side (LR / RL / TB / BT); layout: 'radial' puts the root in the center with
leaves on the rim (labels rotate outward). Edges are curves or elbows. Parents below
initialTreeDepth start collapsed (filled symbols); a click, Enter or Space toggles them and
the tree re-lays out (tweened when animation is on). Same input as renderTreemap, values
optional, plus collapsed per node. Data point ids: node index.
Optionaloptions: TreeChartOptionsRenders a squarified treemap natively (Bruls et al.): nested levels with inner padding and a
header strip per parent, 2 px surface gaps, colors by top-level group (palette in fixed
order, groups beyond it fold into a neutral "Other") or by value. Layout, aggregation of
subtrees too small to show, hit-testing and label fitting run in the engine (100k leaves
lay out in milliseconds). Hover shows the path (A › B › C), value and shares; a click drills
into the clicked top-level group (breadcrumb / Escape go back up; 'drill' event). Tree
input { name, value?, children? } or flat rows { id, parent, value }; leaf values must
be finite and >= 0 and cycles throw. Data point ids = node index (depth-first for trees).
Optionaloptions: TreemapChartOptionsRenders a waterfall chart natively on the 2D bar chart: each change floats from the running
total before it to the total after it, totals (and options.total) are full bars from zero,
dashed connectors join the bar ends, and value labels carry the sign. Increase / decrease /
total use palette slots and a neutral (never red / green alone). Horizontal orientation,
axes, gridlines and label collision handling are the bar chart's. Point ids = item index.
Optionaloptions: WaterfallChartOptionsSearches nodes by ID, label, category, tag, or attribute value.
Selects a data rectangle like a brush release (x: sample index / x value / Date, category
index for bars; y omitted = x interval). Emits 'select'; returns the selection, null
outside 2D charts.
Optionaly: [number, number]Chart enter / update animations (off by default): true / { duration, easing } / false.
Enter: lines reveal left to right, bars grow from the baseline, points and pie slices fade
and scale in. Update (setSeriesData, or re-rendering data of the same shape): values,
bar heights and pie angles tween. Interpolation runs in the engine over the staged
(decimated) marks; charts with more than 50k staged marks skip it. Applies to charts
rendered from now on (and the current one); prefers-reduced-motion: reduce turns it off.
Charts override it with their own animation option.
Replaces the annotations of the active 2D chart: reference lines (hline / vline), bands
(yband / xband), point markers, and text, in data units (line: sample index or x
value; bar: category index; scatter: x / y). They follow zoom / pan, are clipped to the plot,
and are cleared when a new chart is rendered. Labels are DOM pills in the chart overlay.
Multisample anti-aliasing of the main pass (default 1 = off): 4 renders 4 samples per pixel
and resolves them, smoothing stair-stepped mesh edges (2D lines and markers are already
shader anti-aliased; texture interiors and DOM text are unchanged). Costs 4x the color + depth memory of the canvas
(getRenderStats().gpuBytes) and fill rate. A device that cannot render the canvas format x4
stays at 1 with a console warning (see getAntialias). Throws on values other than 1 / 4.
Stops the force simulation once the layout is at rest. sleepThreshold = mean kinetic
energy per (unpinned) node; the layout sleeps after 30 consecutive calm steps (default 0.05).
Changes the scale of one axis of the active 2D line / area / scatter chart: 'x', 'y'
(left), or 'y2' (right axis of a dual-axis line chart); options are merged into the
current ones. Log needs positive values (line x: numeric x; index / time x stay linear).
A changed mapping resets that axis's zoom; ticks, gridlines, annotations and hover follow on
the next frame.
Sets the camera's vertical field of view in degrees (the engine clamps it to 10..120;
default 45). Takes effect on the next frame; call fitToView to re-frame for the new angle.
No-op on engine builds without the set_camera_fov binding.
Brush selection mode of chart mouse drags: 'x' (x interval), 'xy' (rectangle), or false
(drag navigates; default). Needs an enableNodeInteractions binding. style sets the brush
look (kept across charts).
Optionalstyle: BrushStyleOptionsPoint editing of 2D line / scatter charts (true = defaults, false = off; see
ChartEditOptions). Options are validated first: invalid ones throw and keep the current
state. Pointer edits need an enableNodeInteractions binding; keyboard edits work on the
focused point (Shift + arrows: 1/50 of the visible span, Alt + arrows: 1/500). Stacked /
percent areas, bands, sparse charts, ThemeRiver and extra y axes are not editable.
Updates the gridlines of the current chart.
Optionalstyle: ChartGridStyleUpdates the hover layer style of the current chart (crosshair, markers, bar highlight).
Positions the camera either dead-on perpendicular to the XY plane ('2d')
for crisp flat 2D charts, or at an isometric perspective angle ('3d').
Freezes continuous effects (the scatter ripple) at seconds into their cycle, e.g. for
screenshots or exports; null restarts them.
Moves the current gauge to value (cheap: the band geometry and label layout are kept; only
the needle / progress arc and the value text change). Returns false without a gauge or for
an infinite value.
Switches the colormap of the current heatmap (re-uploads only the 1 KB LUT).
Optionaloptions: { color?: ColorInput; emptyColor?: ColorInput; reverse?: boolean }Value domain of the current heatmap (omitted = from the data; uniform-only update).
Changes the stroke width (CSS pixels) of the current line chart.
Pass seriesIndex to change a single series; omit it to change every series.
OptionalseriesIndex: numberLocale of default number / time labels, tooltip values and built-in UI text (accessibility
summaries, data tables, default tooltips, legend / colorbar labels; English, Korean or
Simplified Chinese, see registerMessages). undefined = the page language (<html lang>),
then the browser language. A chart's own locale option wins. Default names a chart got at
render time (series / value names) keep their language until the next render.
Attaches custom business/domain metadata to nodes by ID.
Sets the parallel coordinates brush: intervals in axis terms (category names, dates,
numbers; [from, to] in any order; at most 16 per dimension). Several intervals on one
dimension select their union, several dimensions their intersection; [] clears. Emits
'parallelBrush' (source 'api') when it changed; returns the active row count. Throws for
an unknown dimension / category or a non-finite bound (the brush is kept).
Physical pixels per CSS pixel used for chart strokes and markers. The engine derives it from
the canvas on resize(); call this only to override it.
Opt-in HDR post-processing of the scene meshes (both effects off by default; costs nothing
while off). With an effect on, the meshes render into an Rgba16Float target and a
composite pass applies exposure, bloom, the setShading tone mapping and the sRGB encode;
2D charts, nodes, edges and helpers draw on top unchanged (also over translucent meshes).
Needs the PBR shading model; skipped (getPostProcessing().supported === false) on devices
without float render targets (WebGL2 without EXT_color_buffer_float).
bloom: pixels brighter than threshold (after exposure, soft knee) glow through a mip
chain; radius widens it, intensity scales it. HDR values (emissive, a strong sun, HDR
environments) bloom the most.
autoExposure: meters the average log luminance on the GPU every frame and adapts the
exposure toward EV log2(average / 0.18) (clamped to minEv..maxEv, plus compensation;
setShading({ exposure }) still multiplies). adaptation: 'smooth' moves at speedUp /
speedDown per second of rendered frames (render continuously to see it settle);
'instant' meters every frame. The first frame after enabling always snaps.
Omitted fields keep their current value; throws on invalid values.
Optionalgravity: Vec3TupleReplaces the data of one line / area series without re-rendering the chart. Stacked / percent
areas require the same length and x coordinates as the other series. Styles, legend state
and the zoom window are kept (a window touching the right edge stays pinned to the latest
data). x is required iff the chart was rendered with x. Data point ids of every series
are re-based (offsets follow the new lengths). Like renderLineChart, values is kept by
reference for tooltips / a11y: do not mutate it afterwards. Returns the new sample count.
Optionalx: number[] | Float64Array<ArrayBufferLike> | Date[]Shows / hides a line or multi-series bar series (same as clicking its legend entry). Bar stacks / groups are re-laid out by the engine; the value axis stays fixed.
Scene mesh shading. 'classic' (default) keeps the Blinn-Phong look; 'pbr' switches the
meshes to metallic-roughness physically based shading (GGX) in linear space with environment
lighting, exposure and tone mapping. Colors and textures stay sRGB in both models. The
directional / point lights of setLighting apply to both; ambientIntensity is classic only
(PBR ambient comes from environment). Omitted fields keep their current value; throws on
invalid values.
Directional-light shadow mapping for the scene meshes (off by default; chart 3D marks never
cast or receive). The setLighting directional light casts; the shadow darkens that light
only (ambient, point light and environment are unchanged) in both shading models. Objects
opt out with castShadow / receiveShadow; translucent objects do not cast and alpha-tested
textures cut holes into their shadows. mapSize is clamped to the device limit (see
getShadows). Omitted fields keep their current value; throws on invalid values.
point (off by default, independent of the directional fields) adds omnidirectional
shadows of the setLighting point light: six 90° depth passes from pointPosition into a
cube map every frame (casters only), sampled with PCF. The shadow darkens the point light
only. Costs nothing while off.
Updates or sets metadata for a single node ID.
Joins the cursor / zoom sync group options.key (leaving any previous one), or leaves with
null. Members share the hovered data x (cursor, needs enableNodeInteractions on the
hovered chart) and the visible x range (x) in data units; see Charturbo.connect.
Switches the color theme of the canvas, chart marks, labels, legend, and tooltips. Custom
themes may give the GPU color tokens as CSS colors (getTheme() returns them as tuples).
Zone of time axes: 'local' (default, the viewer's zone), 'UTC', or an IANA name
('America/New_York'). Tick boundaries (local midnight / month start, hours on 23 h / 25 h
DST days, +05:30 / +05:45 offsets) and every time label — ticks, tooltips, a11y text, data
table / CSV — follow it; a chart's own timeZone option wins. Re-renders the active chart.
Throws a RangeError for a zone the runtime does not know.
Tidy tree: expands or collapses target (node index, flat input id, or node name) and
re-lays out. Returns false when unchanged (leaves, hidden nodes, no tree). Emits
'treeToggle'; call render() afterwards (pointer and keyboard toggles render themselves).
Draws a text or image watermark over the chart (tiled by default, or one centered mark with
repeat: false), above the plot and under labels and tooltips; null removes it. It stays
across charts and follows theme switches; image / SVG / PDF exports include it unless
export: false. Screen readers skip it. Bad options throw and keep the current watermark.
Zooms the x axis to [min, max] in data units (2D line / scatter charts; Dates on time
axes), clamped to the data and the zoom limit like wheel zoom. Returns true when the view
moved; call render() to draw it.
Like setYDomain, for the right y axis of a dual-axis line chart.
Changes how the line chart's y domain is derived; options are merged into the current
ones (pass min: undefined to free an end). Axes, gridlines and hover follow on the next
frame.
Zooms the y axis to [min, max] in data units (see setXRange): scatter charts zoom y,
line / area charts pin the y domain (until resetChartZoom).
Accessible <table> of the active chart's data (caption, scoped headers); see chart-a11y.ts.
Optionalcontainer: HTMLElementOptionaloptions: DataTableOptionsShows a loading indicator over the chart (ECharts showLoading): a mask with a spinner and
a status text ('Loading…' in the chart language), aria-busy on the chart container and
a polite live-region announcement. It stays until hideLoading (rendering a chart does not
hide it); calling it again updates the options. Exports never include it. Bad options throw
and keep the current indicator.
Optionaloptions: ChartLoadingOptionsOpt-in GPU-resident graph step (WebGPU): positions stay on the GPU, which builds the Barnes-Hut octree and applies repulsion, springs, integration and auto-sleep. Resolves once submitted, with the kinetic energy of the newest read-back layout. The CPU copy used by picking, exports, node details and isSleeping() trails by a frame or two; await syncPhysicsPositions() when it must be current. CPU edits (moveNode, pinNode, styles, loadDataset, stepPhysics) are applied in order. Uses CPU physics on WebGL2/older backends; the synchronous stepPhysics() stays CPU-only. Await each step before starting another. Does not render automatically.
Whether this device supports the opt-in GPU-resident graph solver.
Brings the CPU copy of a GPU-resident layout up to date: after await, picking, exports, node details and isSleeping() reflect every submitted stepPhysicsAsync(). No-op on CPU physics.
Tidy tree: flips the expanded state of target (see setTreeNodeExpanded).
Chart image: the canvas re-rendered (at pixelRatio, default the current one) with the DOM
overlay (title, legend, axis labels) composited on top; see chart-export.ts.
Optionaloptions: ChartImageOptionsOne-page PDF of the chart image (toImage, PNG): raster; use exportChartSVG for vector.
Optionaloptions: Omit<ChartImageOptions, "format" | "quality">Back to the zoom before the last gesture; true when the view moved.
Replace heights or append column-major columns / row-major rows. Scroll defaults to true. Preserves orbit and visibility. Recomputes domains and colors from retained samples.
Box zoom: zooms x and y to the canvas rectangle between two NDC corners (-1..1, +y up), clamped to the plot (line / area / scatter / candlestick). Records an undo step; true when the view moved.
Zooms the x axis of a 2D line chart (factor < 1 zooms in) around anchorNdcX (-1..1).
Zooms both axes of a scatter chart (factor < 1 zooms in) around an NDC anchor (-1..1).
Zooms the y axis (factor < 1 zooms in) around anchorNdcY (-1..1): line / area charts pin
their y domain there (autoscale pauses until resetChartZoom), scatter charts zoom y.
Returns true when the view moved.
StaticconnectSynchronizes crosshair / hover (cursor, default true) and x zoom / pan (x, default true)
across charts, each with its own canvas and engine. An array forms a new group; a key sets
the options of the instances that joined it with sync: { key }. Positions travel in data
units (epoch ms on time axes, sample / category index otherwise), are clamped by each chart
to its own domain, and are applied at most once per animation frame (followers re-render).
Followers show crosshair + markers only unless tooltip is set. Returns the disconnect.
Optionaloptions: ChartSyncOptionsStaticcreateLoads the WASM module and starts the engine on canvas (WebGPU, else WebGL2). Throws a
CharturboInitError whose reason says what is missing (see isSupported() to check first).
Optionaloptions: {Optionalanimation?: ChartAnimationInputChart enter / update animations (default off; see setAnimation)
Optionalantialias?: CharturboAntialiasMain-pass MSAA (default off): true / 4 = 4 samples per pixel, smoothing stair-stepped
mesh edges; falls back to off with a console warning when the device cannot (see
setAntialias).
OptionalautoResize?: booleanKeep canvas.width / height at its CSS size x device pixel ratio (ResizeObserver +
DPR changes) and call resize() + render() on change (default: true). Disable when
the host sizes the canvas itself.
OptionalclusterCount?: numberOptionaldevice?: CharturboDeviceShared GPU device (CharturboDevice.create()): no adapter / device request, cached pipelines,
compact buffers — use it for pages with many charts. Graph defaults are 0 nodes / edges
on this path. WebGL2 devices need a canvas without a context (see charturbo-device.ts).
OptionaledgeCount?: numberOptionallocale?: stringLocale of default number / time labels and tooltip values (see setLocale)
OptionalnodeCount?: numberOptionalseed?: numberOptionalsync?: ChartSyncMemberOptionsJoins a cursor / zoom sync group (see setSync)
OptionaltimeZone?: CharturboTimeZoneZone of time axes, labels, and tooltips (see setTimeZone; default 'local')
StaticcreateShared GPU device for many engines: same as CharturboDevice.create(options).
Optionaloptions: CharturboDeviceOptionsStaticcreateProcedural 3D Torus mesh generator for testing/spawning custom indexed meshes. The result
(including uvs) can be spread into addCustomMesh.
StaticfromStaticgenerateGenerates a realistic multi-cluster D-dimensional embedding matrix (Float32Array of length nodeCount * dimensions)
for any dimension D >= 3 (e.g., 128D, 384D, 768D, 1024D, 1536D, 3072D).
StaticisTrue when this browser can run the engine: a WebGPU adapter is available, or WebGL2 (the
engine's fallback backend). create() may still fail on a device-level error.
High-performance 3D Scene, Physics, Graph & Point-Cloud Engine SDK powered by Rust + wgpu (WebAssembly).