charturbo - v0.1.0
    Preparing search index...

    Class Charturbo

    High-performance 3D Scene, Physics, Graph & Point-Cloud Engine SDK powered by Rust + wgpu (WebAssembly).

    Index
    addAnnotation addBox addCustomMesh addCylinder addPlane addPrimitive addSphere appendAreaData appendPointCloud3D appendSeriesData applyLayout boxSelect clearAnnotations clearChartSelection clearParallelBrush clearScene clearSelection clearZoomHistory copyChartImage createDataTexture createEnvironmentFromFloat dispose disposeGltf disposeTexture downloadChartPDF downloadChartSVG downloadImage drillTo drillUp edgeCount embeddingDimension emphasizeSeries enableNodeInteractions environmentReady exportChartCSV exportChartSVG exportParallelCSV exportPositions exportScene finishAnimation fitChartToView fitToView focusNode generateDefaultMetadata getAnimation getAnnotations getAntialias getAxisScale getCameraState getChartBrush getChartDataTable getChartEditable getChartSummary getHelpers getHoverX getLighting getLocale getNavigatorRect getNodeDetails getNodeMetadata getObjectRecord getObjects getObjectTransform getParallelActiveRows getParallelBrush getPostProcessing getRenderStats getRigidPhysics getScatterTrendlines getSelection getSeriesData getShading getShadows getSync getTextures getTheme getTimeZone getWatermark getXRange getY2Domain getYDomain getYRange handlesCameraControls handlesChartBrush handlesChartNavigation handlesTouchGestures hideDataTable hideLoading highlightNeighbors highlightShortestPath hoverAtX importPositions isAnimating isGraphVisible isLoading isSeriesVisible isSleeping loadDataset loadEmbeddings loadEnvironmentHdr loadGltf loadScene loadSceneWithTextures loadTexture moveCameraLocal moveNode nodeCount objectCount off on panCamera panChartX panChartXY pickNodeAtNdc pickObjectAtNdc pinNode projectNodesToScreen projectNodeToScreen pushZoomHistory queryCosineSimilar queryRadius raycastObjectAtNdc redoZoom reloadSeededDataset removeObject render renderAreaChart renderBandChart renderBarChart renderBoxPlot renderCalendarHeatmap renderCandlestickChart renderChordChart renderComboChart renderErrorBarChart renderFunnelChart renderGauge renderGraph renderGroupedBarChart renderHeatmap renderHistogram renderImpulseChart renderLineChart renderOhlcChart renderParallelChart renderPictorialBarChart renderPieChart renderPointCloud3D renderPolarChart renderRadarChart renderSankey renderScatterChart renderSparkline renderSunburst renderSurface3D renderThemeRiverChart renderTree renderTreemap renderWaterfallChart resetChartZoom resize rotateCamera rotateCameraLook searchNodes selectChartRange selectCluster selectObject setAnimation setAnnotations setAntialias setAutoSleep setAxisScale setCameraFov setCameraPose setChartBrush setChartEditable setChartGrid setChartHoverStyle setChartViewMode setEffectTime setForceOptions setFrustumCulling setGaugeValue setGraphVisible setHeatmapColorScale setHeatmapDomain setHelpers setLighting setLineWidth setLocale setNodeHoverStyle setNodeMetadata setNodeStyle setObjectMaterial setObjectParent setObjectPhysics setObjectTransform setParallelBrush setPixelRatio setPostProcessing setRigidPhysics setSeriesData setSeriesVisible setShading setShadows setSingleNodeMetadata setSync setTheme setTimeZone setTreeNodeExpanded setWatermark setXRange setY2Domain setYDomain setYRange showDataTable showLoading stepPhysics stepPhysicsAsync supportsGpuPhysics syncPhysicsPositions toDataURL toggleTreeNode toImage toPDF undoZoom updateSurface3D wakeUp warmup zoomCamera zoomChartBox zoomChartX zoomChartXY zoomChartY connect create createDevice createTorusMesh fromBackend generateSyntheticHighDimEmbeddings isSupported
    • get maxTextureSize(): number

      Largest texture edge in texels the GPU allows (capped at 4096); 0 when the engine has no texture support.

      Returns number

    • 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.

      Parameters

      Returns number[]

    • Append 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).

      Parameters

      Returns number

    • Streams 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.

      Parameters

      • seriesIndex: number
      • values: number[] | Float32Array<ArrayBufferLike>
      • Optionalx: number[] | Float64Array<ArrayBufferLike> | Date[]
      • Optionaloptions: AppendSeriesOptions

      Returns number

    • Parameters

      • minNdcX: number
      • minNdcY: number
      • maxNdcX: number
      • maxNdcY: number

      Returns Uint32Array

    • Removes the brush and its selection; emits an empty 'select' when something was selected.

      Returns void

    • Clears every parallel coordinates brush interval (no-op without a brush or chart).

      Returns void

    • Removes every scene object and the active chart.

      Returns void

    • Clears the graph selection and, with a chart shown, its brush selection (see clearChartSelection).

      Returns void

    • 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).

      Parameters

      Returns Promise<boolean>

    • 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.

      Parameters

      • width: number
      • height: number
      • rgba: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>
      • options: DataTextureOptions = {}

      Returns number

    • 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.

      Parameters

      • width: number
      • height: number
      • rgb: Float32Array<ArrayBufferLike> | ArrayLike<number>

      Returns number

    • Detaches every interaction, removes overlay DOM, and releases the WASM engine.

      Returns void

    • Frees a texture. Objects that used it render untextured (white) from then on. Returns false for an unknown id.

      Parameters

      • textureId: number

      Returns boolean

    • Downloads toPDF().

      Parameters

      • filename: string = 'chart.pdf'
      • Optionaloptions: Omit<ChartImageOptions, "format" | "quality">

      Returns Promise<void>

    • Downloads toImage (format from the extension unless options.format is given).

      Parameters

      Returns Promise<void>

    • Treemap / 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).

      Parameters

      • target: string | number

      Returns boolean

    • Treemap / sunburst: back up one level. Returns false at the top.

      Returns boolean

    • Returns the active high-dimensional embedding dimension D (0 if dataset was loaded as raw 3D coordinates).

      Returns number

    • Fades every series but seriesIndex (null clears).

      Parameters

      • seriesIndex: number | null

      Returns void

    • 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.

      Parameters

      Returns () => void

    • Resolves 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.

      Parameters

      • textureId: number

      Returns Promise<void>

    • getChartDataTable() as RFC 4180 CSV (CRLF rows).

      Returns string

    • 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).

      Parameters

      Returns string

    • CSV of the parallel coordinates rows (activeOnly: only the rows inside the brush).

      Parameters

      • Optionaloptions: { activeOnly?: boolean }

      Returns string

    • 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.

      Returns SceneDescriptor

    • Jumps a running chart animation to its final frame (call render() to show it).

      Returns void

    • Re-frames the camera on the current chart.

      Returns void

    • 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.

      Returns void

    • 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.

      Parameters

      Returns boolean

    • Populates realistic domain metadata for all current nodes in the graph (useful for demos or quick inspection).

      Parameters

      • prefix: string = 'Service-Node'

      Returns void

    • 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.

      Parameters

      Returns ChartDataTable | null

    • Short text summary of the active chart (the canvas aria-label).

      Returns string

    • 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.

      Returns number | null

    • Navigator strip [left, top, width, height] in CSS px (null without one).

      Returns [number, number, number, number] | null

    • Returns complete live 3D state, topology connectivity, and custom metadata for nodeId.

      Parameters

      • nodeId: number

      Returns NodeDetails | null

    • Row indices inside the brush (visible series; every visible row without a brush).

      Returns number[]

    • 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.

      Parameters

      • series: number = 0

      Returns { index?: number[]; x: number[]; y: number[] } | null

    • 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.

      Returns [number, number] | null

    • Current [min, max] of the right y domain, or null (no right-axis series).

      Returns [number, number] | null

    • Current [min, max] of the line chart's y domain, or null.

      Returns [number, number] | null

    • Visible y range in data units: the line / area y domain (autoscaled or zoomed), scatter y (null otherwise).

      Returns [number, number] | null

    • 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.

      Returns boolean

    • 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).

      Returns boolean

    • True when the active chart handles wheel / drag itself (2D line chart navigation).

      Returns boolean

    • True while an enableNodeInteractions binding owns touch / pen gestures (hosts should skip their own).

      Returns boolean

    • Removes the loading indicator (and a pending delayed one).

      Returns void

    • Parameters

      • nodeId: number
      • hops: number = 1

      Returns Uint32Array

    • Computes and highlights the undirected shortest path between startNodeId and endNodeId via BFS. Returns the ordered sequence of node IDs along the path.

      Parameters

      • startNodeId: number
      • endNodeId: number

      Returns Uint32Array

    • 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.

      Parameters

      • x: number | Date | null
      • Optionaloptions: { tooltip?: boolean }

      Returns boolean

    • Parameters

      • positions: Float32Array

      Returns void

    • True while a chart animation runs.

      Returns boolean

    • True between showLoading and hideLoading (also while a delay is pending).

      Returns boolean

    • Parameters

      • seriesIndex: number

      Returns boolean

    • 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.

      Parameters

      Returns { dimensions: number; edgeCount: number; elapsedMs: number; nodeCount: number }

    • 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.

      Parameters

      Returns Promise<number>

    • 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).

      Parameters

      Returns Promise<GltfLoadResult>

    • 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.

      Parameters

      Returns Promise<number[]>

    • 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.

      Parameters

      Returns Promise<number>

    • Parameters

      • forwardDelta: number
      • rightDelta: number
      • upDelta: number

      Returns void

    • Parameters

      • nodeId: number
      • x: number
      • y: number
      • z: number

      Returns boolean

    • 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.

      Type Parameters

      Parameters

      Returns () => void

    • Parameters

      • deltaRight: number
      • deltaUp: number

      Returns void

    • Pans the x axis of a 2D line chart by a canvas-relative NDC delta.

      Parameters

      • deltaNdcX: number

      Returns void

    • Pans both axes of a scatter chart by a canvas-relative NDC delta (+y = up).

      Parameters

      • deltaNdcX: number
      • deltaNdcY: number

      Returns void

    • Parameters

      • ndcX: number
      • ndcY: number

      Returns number | null

    • Parameters

      • ndcX: number
      • ndcY: number

      Returns number | null

    • Parameters

      • nodeId: number
      • pinned: boolean

      Returns boolean

    • Batch version of projectNodeToScreen (one WASM call for many labels). Returns [x0, y0, x1, y1, ...] in canvas pixels; NaN for points behind the camera.

      Parameters

      • nodeIds: number[] | Uint32Array<ArrayBufferLike>
      • canvasWidth: number
      • canvasHeight: number

      Returns Float32Array

    • 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.

      Parameters

      • nodeId: number
      • canvasWidth: number
      • canvasHeight: number

      Returns { ndcZ: number; x: number; y: number } | null

    • Records the current zoom as an undo step (wheel / drag / box gestures do it themselves).

      Returns void

    • 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).

      Parameters

      • nodeId: number
      • topK: number = 8

      Returns CosineSimilarityMatch[]

    • Parameters

      • x: number
      • y: number
      • z: number
      • radius: number
      • maxResults: number = 100

      Returns Uint32Array

    • Parameters

      • ndcX: number
      • ndcY: number

      Returns { objectId: number; point: Vec3Tuple } | null

    • Re-applies the last undone zoom; true when the view moved.

      Returns boolean

    • Parameters

      • seed: number
      • nodeCount: number
      • edgeCount: number
      • clusterCount: number

      Returns void

    • Parameters

      • objectId: number

      Returns boolean

    • 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).

      Parameters

      Returns { seriesCount: number; totalPoints: number }

    • Two 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.

      Parameters

      Returns { seriesCount: number; totalPoints: number }

    • Renders 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).

      Parameters

      Returns {
          boxCount: number;
          categoryCount: number;
          sampleCount: number;
          seriesCount: number;
      }

    • Renders 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.

      Parameters

      Returns { calendarCount: number; dayCount: number }

    • Renders 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.

      Parameters

      Returns { candleCount: number }

    • Renders 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.

      Parameters

      Returns { chordCount: number; groupCount: number }

    • Renders 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.

      Parameters

      Returns { categoryCount: number; pointCount: number; seriesCount: number }

    • Renders 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.

      Parameters

      Returns { stageCount: number }

    • Renders 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).

      Parameters

      Returns { bandCount: number }

    • Renders 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.

      Parameters

      Returns { linkCount: number; nodeCount: number }

    • Renders 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.

      Parameters

      Returns { barCount: number; categoryCount: number; seriesCount: number }

    • Renders 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.

      Parameters

      Returns { cellCount: number }

    • Renders 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.

      Parameters

      Returns HistogramResult

    • Renders 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.

      Parameters

      Returns { seriesCount: number; totalPoints: number }

    • Renders 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).

      Parameters

      Returns { dimensionCount: number; rowCount: number; seriesCount: number }

    • Renders 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.

      Parameters

      Returns { barCount: number }

    • Renders 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.

      Parameters

      Returns { sliceCount: number }

    • Renders 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.

      Parameters

      Returns { itemCount: number; seriesCount: number }

    • Renders 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.

      Parameters

      Returns { axisCount: number; seriesCount: number }

    • Renders 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.

      Parameters

      Returns { linkCount: number; nodeCount: number }

    • Renders 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.

      Parameters

      Returns SparklineResult

    • Renders 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.

      Parameters

      Returns { nodeCount: number }

    • Renders 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.

      Parameters

      Returns { seriesCount: number; totalPoints: number }

    • Renders 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.

      Parameters

      Returns { nodeCount: number }

    • Renders 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).

      Parameters

      Returns { nodeCount: number }

    • Renders 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.

      Parameters

      Returns { itemCount: number }

    • Parameters

      • width: number
      • height: number

      Returns void

    • Parameters

      • deltaYaw: number
      • deltaPitch: number

      Returns void

    • Parameters

      • deltaYaw: number
      • deltaPitch: number

      Returns void

    • Searches nodes by ID, label, category, tag, or attribute value.

      Parameters

      • query: string
      • limit: number = 25

      Returns NodeDetails[]

    • 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.

      Parameters

      • x: [number | Date, number | Date]
      • Optionaly: [number, number]

      Returns CharturboSelection | null

    • Parameters

      • clusterId: number

      Returns Uint32Array

    • Parameters

      • objectId: number | null

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      Returns void

    • 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).

      Parameters

      • enabled: boolean
      • sleepThreshold: number = 0.05

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      • deg: number

      Returns void

    • 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).

      Parameters

      Returns void

    • Point 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.

      Parameters

      Returns void

    • Positions the camera either dead-on perpendicular to the XY plane ('2d') for crisp flat 2D charts, or at an isometric perspective angle ('3d').

      Parameters

      • mode: "2d" | "3d"
      • distance: number = 152

      Returns void

    • Freezes continuous effects (the scatter ripple) at seconds into their cycle, e.g. for screenshots or exports; null restarts them.

      Parameters

      • seconds: number | null

      Returns void

    • Parameters

      • enabled: boolean

      Returns void

    • 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.

      Parameters

      • value: number

      Returns boolean

    • Parameters

      • visible: boolean

      Returns void

    • Value domain of the current heatmap (omitted = from the data; uniform-only update).

      Parameters

      • domain: { center?: number; max?: number; min?: number }

      Returns void

    • Changes the stroke width (CSS pixels) of the current line chart. Pass seriesIndex to change a single series; omit it to change every series.

      Parameters

      • widthPx: number
      • OptionalseriesIndex: number

      Returns void

    • Locale 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.

      Parameters

      • locale: string | undefined

      Returns void

    • Dynamically updates a single node's visual style (color, mass, clusterId).

      Parameters

      • nodeId: number
      • style: { clusterId?: number; color?: RgbaTuple; mass?: number }

      Returns boolean

    • Parameters

      • objectId: number
      • parentId: number | null

      Returns boolean

    • 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).

      Parameters

      Returns number

    • 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.

      Parameters

      • ratio: number

      Returns void

    • 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.

      Parameters

      Returns void

    • Replaces 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.

      Parameters

      • seriesIndex: number
      • values: number[] | Float32Array<ArrayBufferLike>
      • Optionalx: number[] | Float64Array<ArrayBufferLike> | Date[]

      Returns number

    • 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.

      Parameters

      • seriesIndex: number
      • visible: boolean

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      Returns void

    • 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).

      Parameters

      • target: string | number
      • expanded: boolean

      Returns boolean

    • 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.

      Parameters

      Returns void

    • 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.

      Parameters

      • min: number | Date
      • max: number | Date

      Returns boolean

    • 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.

      Parameters

      Returns void

    • 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).

      Parameters

      • min: number
      • max: number

      Returns boolean

    • Accessible <table> of the active chart's data (caption, scoped headers); see chart-a11y.ts.

      Parameters

      Returns HTMLTableElement | null

    • Shows 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.

      Parameters

      Returns void

    • Parameters

      • dt: number = 0.016

      Returns number

    • Opt-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.

      Parameters

      • dt: number = 0.016

      Returns Promise<number>

    • Whether this device supports the opt-in GPU-resident graph solver.

      Returns boolean

    • 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.

      Returns Promise<void>

    • Tidy tree: flips the expanded state of target (see setTreeNodeExpanded).

      Parameters

      • target: string | number

      Returns boolean

    • 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.

      Parameters

      Returns Promise<Blob>

    • One-page PDF of the chart image (toImage, PNG): raster; use exportChartSVG for vector.

      Parameters

      Returns Promise<Blob>

    • Back to the zoom before the last gesture; true when the view moved.

      Returns boolean

    • 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.

      Parameters

      Returns { columns: number; pointCount: number; rows: number }

    • Parameters

      • ticks: number = 60
      • dt: number = 0.016

      Returns number

    • 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.

      Parameters

      • x0: number
      • y0: number
      • x1: number
      • y1: number

      Returns boolean

    • Zooms the x axis of a 2D line chart (factor < 1 zooms in) around anchorNdcX (-1..1).

      Parameters

      • factor: number
      • anchorNdcX: number = 0

      Returns void

    • Zooms both axes of a scatter chart (factor < 1 zooms in) around an NDC anchor (-1..1).

      Parameters

      • factor: number
      • anchorNdcX: number = 0
      • anchorNdcY: number = 0

      Returns void

    • 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.

      Parameters

      • factor: number
      • anchorNdcY: number = 0

      Returns boolean

    • Synchronizes 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.

      Parameters

      Returns () => void

    • Loads 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).

      Parameters

      • canvas: HTMLCanvasElement
      • Optionaloptions: {
            animation?: ChartAnimationInput;
            antialias?: CharturboAntialias;
            autoResize?: boolean;
            clusterCount?: number;
            device?: CharturboDevice;
            edgeCount?: number;
            locale?: string;
            nodeCount?: number;
            seed?: number;
            sync?: ChartSyncMemberOptions;
            timeZone?: CharturboTimeZone;
        }
        • Optionalanimation?: ChartAnimationInput

          Chart enter / update animations (default off; see setAnimation)

        • Optionalantialias?: CharturboAntialias

          Main-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?: boolean

          Keep 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?: number
        • Optionaldevice?: CharturboDevice

          Shared 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?: number
        • Optionallocale?: string

          Locale of default number / time labels and tooltip values (see setLocale)

        • OptionalnodeCount?: number
        • Optionalseed?: number
        • Optionalsync?: ChartSyncMemberOptions

          Joins a cursor / zoom sync group (see setSync)

        • OptionaltimeZone?: CharturboTimeZone

          Zone of time axes, labels, and tooltips (see setTimeZone; default 'local')

      Returns Promise<Charturbo>

    • Procedural 3D Torus mesh generator for testing/spawning custom indexed meshes. The result (including uvs) can be spread into addCustomMesh.

      Parameters

      • majorRadius: number = 8
      • minorRadius: number = 2.6
      • radialSegments: number = 18
      • tubularSegments: number = 32

      Returns {
          indices: Uint32Array;
          normals: Float32Array;
          positions: Float32Array;
          uvs: Float32Array;
      }

    • Generates 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).

      Parameters

      • nodeCount: number
      • dimensions: number
      • clusterCount: number = 8
      • seed: number = 42

      Returns { clusters: Uint16Array; vectors: Float32Array }

    • True 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.

      Returns Promise<boolean>