Theme River.
PROStack multiple flows as they change over time.
LIVE EXAMPLE
Composition over time
Appearance and style3
Legend and interaction14
Title and dimensions3
Stack series around a centerline to show their flow. All values are sample data.
View code
<div id="chart-container" style="width: 100%; min-width: 0;"></div>
<script type="module">
import { defineCustomElement as define0 } from '@syidax/advanced-pro/components/sy-theme-river.js';
define0();
// Pro: complete registerLicense at app startup using your issued certificate.
// The website preview certificate is not for use in customer apps.
const specs = [
{
"id": "example-chart",
"tag": "sy-theme-river",
"props": {
"data": {
"x": [0, 1, 2, 3, 4, 5],
"series": [
{
"id": "s0",
"name": "Online",
"values": [24, 29, 27, 38, 43, 40],
"color": "#8263d9"
},
{
"id": "s1",
"name": "Store",
"values": [15, 19, 17, 24, 22, 29],
"color": "#239c91"
}
]
},
"offset": "silhouette",
"width": 640,
"height": 360,
"brandPosition": "bottom-right",
"brandLogo": ""
}
}
];
const container = document.querySelector('#chart-container');
const elements = specs.map(({ tag, id, props }) => {
const element = document.createElement(tag);
element.id = id;
Object.assign(element, props);
element.setAttribute('aria-label', 'theme-river example chart');
return element;
});
container.replaceChildren(...elements);
const chart = elements.at(-1);
const onEvent = event => {
console.log('pointClick', event.detail);
};
chart.addEventListener('pointClick', onEvent);
const observer = new ResizeObserver(([entry]) => {
const width = Math.max(160, Math.floor(entry.contentRect.width));
elements.forEach(element => { element.width = width; });
});
observer.observe(container);
// In an SPA, call this function when the view is disposed.
function disposeChart() {
observer.disconnect();
chart.removeEventListener('pointClick', onEvent);
container.replaceChildren();
}
</script>Usage and data
#Explore changes in topic interest or composition.
The central baseline moves, so read band thickness rather than vertical position. Use a table for precise comparisons.
Data contract
| Property | Input format |
|---|---|
data | { x: [...], series: [{ id, name?, values }] }. Align every values array with x. |
offset | The baseline mode: silhouette, zero, or expand. |
Updating data
Assign a new array or object to the property instead of mutating values inside an array. Chart events provide selection results through event.detail. When disposing of the view, clean up ResizeObserver and event listeners registered by your app.
Feature examples
#Try 38 interactive feature examples and inspect their code. Select “Edit in preview” to combine more options in the settings panel above.
Zero baselinePRO
Stack series from zero to compare magnitudes.
View code
Series orderPRO
Change the series order to compare flows.
View code
Inspect values with the pointerPRO
Point to data to view the value at that location.
View code
Crosshair trackingPRO
Move the pointer to read horizontal and vertical coordinates alongside values.
View code
Drag to zoom and panPRO
Drag to zoom and hold Shift to pan. Use Ctrl + wheel to zoom in or out.
View code
Replay animationPRO
Redraw the same example to inspect its initial display animation.
View code
AccessibilityPRO
Compare 2 examples of Accessibility. Buttons and options update both the live result and source code.
View code
AnimationPRO
Compare 3 examples of Animation. Buttons and options update both the live result and source code.
View code
AxesPRO
Compare 3 examples of Axes. Buttons and options update both the live result and source code.
View code
ColorPRO
Compare 4 examples of Color. Buttons and options update both the live result and source code.
View code
CrosshairPRO
Compare 5 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Data inputPRO
Compare 6 examples of Data input. Buttons and options update both the live result and source code.
View code
LayoutPRO
Compare 4 examples of Layout. Buttons and options update both the live result and source code.
View code
LegendPRO
Compare 2 examples of Legend. Buttons and options update both the live result and source code.
View code
LocalePRO
Compare 1 examples of Locale. Buttons and options update both the live result and source code.
View code
Large datasetsPRO
Compare 2 examples of Large datasets. Buttons and options update both the live result and source code.
View code
SizePRO
Compare 2 examples of Size. Buttons and options update both the live result and source code.
View code
TooltipPRO
Compare 15 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Zoom and panPRO
Compare 5 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Context menuPRO
Compare 1 examples of Context menu. Buttons and options update both the live result and source code.
View code
HoverPRO
Compare 1 examples of Hover. Buttons and options update both the live result and source code.
View code
Point ClickPRO
Compare 1 examples of Point Click. Buttons and options update both the live result and source code.
View code
Data context menuPRO
Compare 1 examples of Data context menu. Buttons and options update both the live result and source code.
View code
RuntimePRO
Compare 3 examples of Runtime. Buttons and options update both the live result and source code.
View code
Selection ChangedPRO
Compare 1 examples of Selection Changed. Buttons and options update both the live result and source code.
View code
Zoom ChangePRO
Compare 2 examples of Zoom Change. Buttons and options update both the live result and source code.
View code
AnimationPRO
Compare 1 examples of Animation. Buttons and options update both the live result and source code.
View code
CrosshairPRO
Compare 1 examples of Crosshair. Buttons and options update both the live result and source code.
View code
Data inputPRO
Compare 2 examples of Data input. Buttons and options update both the live result and source code.
View code
ExportPRO
Compare 1 examples of Export. Buttons and options update both the live result and source code.
View code
Read coordinates and dataPRO
Compare 1 examples of Read coordinates and data. Buttons and options update both the live result and source code.
View code
Runtime APIPRO
Compare 1 examples of Runtime API. Buttons and options update both the live result and source code.
View code
OptionalPRO
Compare 1 examples of Optional. Buttons and options update both the live result and source code.
View code
TooltipPRO
Compare 2 examples of Tooltip. Buttons and options update both the live result and source code.
View code
Zoom and panPRO
Compare 1 examples of Zoom and pan. Buttons and options update both the live result and source code.
View code
Theme RiverPRO
Compare 3 examples of Theme River. Buttons and options update both the live result and source code.
View code
Streaming · Add and update live dataPRO
Compare 4 examples of Add and update live data. Buttons and options update both the live result and source code.
View code
Streaming · Add and update live dataPRO
Compare 1 examples of Add and update live data. Buttons and options update both the live result and source code.
View code
Add to your interface
#The code tabs below the preview contain the full data, options, event bindings, and responsive sizing for the current example. Copy them into an app project, such as Vite, that can resolve the installed packages.
API reference
#The full public API for sy-theme-river. Pass objects and arrays as JavaScript properties. Select a name to view usage code and type definitions.
Key properties
| Attribute / Property | Type / Default | Description |
|---|---|---|
ThemeRiverDataDefault: undefined | { x: [...], series: [{ id, name?, values }] }. Align every values array with x. | |
numberDefault: 900 | Chart width in pixels. Update with ResizeObserver when the container changes. | |
numberDefault: 420 | Chart height in pixels. | |
| brandLogo | stringDefault: undefined | The default is the Syidax logo. With the Pro chart.branding entitlement, use none or a PNG, JPEG, or WebP data URL. |
| brandPosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'Default: 'bottom-right' | The corner where the logo is anchored. Applies equally to Community and Pro, on screen and in image exports. |
ThemeRiverOffsetDefault: 'silhouette' | The baseline mode: silhouette, zero, or expand. | |
ThemeRiverOrderDefault: 'input' | Allowed values: input, reverse. Default: 'input'. | |
numberDefault: 1 | Set as an HTML attribute or JavaScript property. type: number. | |
booleanDefault: true | Whether to show a legend for series or items. | |
| chartTitle | stringDefault: undefined | The title inside the chart. Explain the data's unit and meaning alongside it. |
| chartSubtitle | stringDefault: undefined | The subtitle inside the chart. |
CartesianTooltipInputDefault: undefined | Tooltip settings for pointer-driven values, position, and content. | |
| tooltipEnabled | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
CartesianZoomInputDefault: undefined | Settings for zooming and the visible range. | |
CartesianCrosshairInputDefault: undefined | Pass as a JavaScript property. type: CartesianCrosshairInput. | |
| animated | booleanDefault: false | Whether to animate initial display and data changes. |
| animationDuration | numberDefault: 600 | Animation duration in milliseconds. |
| animationEasing | ThemeRiverEasingDefault: 'ease-out' | Allowed values: linear, ease-out, ease-in, ease-in-out. Default: 'ease-out'. |
| animationType | ThemeRiverAnimationTypeDefault: undefined | Allowed values: initial, update. Default: undefined. |
Other properties 14
| Attribute / Property | Type / Default | Description |
|---|---|---|
ReadonlyArray<string>Default: undefined | Pass as a JavaScript property. type: ReadonlyArray<string>. | |
ThemeRiverAxesOptionsDefault: undefined | Pass as a JavaScript property. type: ThemeRiverAxesOptions. | |
| hiddenSeries | ReadonlyArray<ThemeRiverId>Default: [] | Pass as a JavaScript property. type: ReadonlyArray<ThemeRiverId>. |
stringDefault: 'en' | Set as an HTML attribute or JavaScript property. type: string. | |
| showEmpty | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| activeColor | stringDefault: '#f59e0b' | Set as an HTML attribute or JavaScript property. type: string. |
| enableMouseTracking | booleanDefault: true | Set as an HTML attribute or JavaScript property. type: boolean. |
| tooltipFormat | (detail: ThemeRiverHitDetail) => stringDefault: undefined | Pass as a JavaScript property. type: (detail: ThemeRiverHitDetail) => string. |
| crosshairSnapDistance | numberDefault: 24 | Set as an HTML attribute or JavaScript property. type: number. |
| streamSource | ThemeRiverStreamSourceDefault: undefined | A stream source for live data. Check the contract for the specific type. |
| streamMax | numberDefault: 128 | The maximum number of streaming data points to retain. |
| streamWindow | numberDefault: undefined | The streaming data range to keep visible. |
ThemeRiverEngineModeDefault: 'auto' | Renderer selection: auto, standard, or pro. Engine selection is separate from permission to use a Pro chart type. | |
ThemeRiverUnavailableBehaviourDefault: 'fallback' | Allowed values: fallback, error. Default: 'fallback'. |
Events 16
| Events | Detail type | Description |
|---|---|---|
ThemeRiverRenderResult & {
tier: ThemeRiverEngineTier;
} | Emits rendering results in detail when chart drawing completes. | |
ThemeRiverHitDetail | A point selection event. Read the selected data and index from CustomEvent.detail. | |
ThemeRiverHitDetail | null | CustomEvent.detail type: ThemeRiverHitDetail | null. Event names are case-sensitive. | |
ThemeRiverSelectionChangeEventDetail | CustomEvent.detail type: ThemeRiverSelectionChangeEventDetail. Event names are case-sensitive. | |
ThemeRiverCrosshairDetail | null | CustomEvent.detail type: ThemeRiverCrosshairDetail | null. Event names are case-sensitive. | |
{
count: number;
replaced: number;
} | CustomEvent.detail type: { count: number; replaced: number; }. Event names are case-sensitive. | |
{
dropped: number;
} | CustomEvent.detail type: { dropped: number; }. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
{
message: string;
} | CustomEvent.detail type: { message: string; }. Event names are case-sensitive. | |
CartesianTooltipEventDetail | Whether to display the built-in tooltip. | |
void | CustomEvent.detail type: void. Event names are case-sensitive. | |
CartesianTooltipActionEventDetail | CustomEvent.detail type: CartesianTooltipActionEventDetail. Event names are case-sensitive. | |
CartesianZoomChangeEventDetail | CustomEvent.detail type: CartesianZoomChangeEventDetail. Event names are case-sensitive. | |
ChartPointContextMenuEventDetail<ThemeRiverHitDetail> | CustomEvent.detail type: ChartPointContextMenuEventDetail<ThemeRiverHitDetail>. Event names are case-sensitive. |
Methods 38
Stencil methods return Promises. Use await within an async function to read the result.
| Method / Arguments | Return type | Description |
|---|---|---|
Promise<ThemeRiverRenderResult> | An asynchronous method. Check the argument and return types below. | |
Promise<HeatmapEngineTier> | An asynchronous method. Check the argument and return types below. | |
Promise<string> | An asynchronous method. Check the argument and return types below. | |
Promise<ChartEngineStatus> | Requested engine vs what runs, and why (CHART-ADD-08); a frozen or unlicensed chart reports the license outcome. | |
Promise<void> | Without the grant (or while frozen) nothing is recycled: no GPU work starts. | |
| data: ThemeRiverData | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<ThemeRiverData> | An asynchronous method. Check the argument and return types below. | |
Promise<ThemeRiverLayout> | An asynchronous method. Check the argument and return types below. | |
Promise<{ columns: number; series: number; points: number; missingValues: number; zeroValues: number; }> | An asynchronous method. Check the argument and return types below. | |
| row: ThemeRiverRow | Promise<void> | An asynchronous method. Check the argument and return types below. |
| rows: ReadonlyArray<ThemeRiverRow> | Promise<void> | An asynchronous method. Check the argument and return types below. |
| rows: ReadonlyArray<ThemeRiverRow> | Promise<void> | An asynchronous method. Check the argument and return types below. |
| count: number | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<ThemeRiverStreamSource> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| options: { enabled?: boolean; duration?: number; easing?: ThemeRiverEasing; type?: ThemeRiverAnimationType; } | Promise<void> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<ChartDataTable> | An asynchronous method. Check the argument and return types below. | |
| options?: CsvOptions | Promise<string> | An asynchronous method. Check the argument and return types below. |
Promise<string> | An asynchronous method. Check the argument and return types below. | |
| cssX: number, cssY: number | Promise<{ cssX: number; cssY: number; kind: "band"; seriesIndex: number; seriesId: ThemeRiverId; seriesName: string; columnIndex: number; dataX: number; value: number; lower: number; upper: number; interpolated: boolean; }> | An asynchronous method. Check the argument and return types below. |
| series: number, column: number | Promise<{ cssX: number; cssY: number; kind: "band"; seriesIndex: number; seriesId: ThemeRiverId; seriesName: string; columnIndex: number; dataX: number; value: number; lower: number; upper: number; interpolated: boolean; }> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
Promise<ThemeRiverSelection | null> | An asynchronous method. Check the argument and return types below. | |
| series: number, column: number | Promise<CartesianTooltipEventDetail> | An asynchronous method. Check the argument and return types below. |
| index: number | Promise<CartesianTooltipEventDetail> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| series: number, column: number | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
| request: CartesianCrosshairShowRequest | Promise<boolean> | An asynchronous method. Check the argument and return types below. |
Promise<void> | An asynchronous method. Check the argument and return types below. | |
| request: CartesianZoomRequest | Promise<CartesianZoomChangeEventDetail> | An asynchronous method. Check the argument and return types below. |
| factor: number, anchorFraction?: number | Promise<CartesianZoomChangeEventDetail> | An asynchronous method. Check the argument and return types below. |
| delta: { x?: number; y?: number; } | Promise<CartesianZoomChangeEventDetail> | An asynchronous method. Check the argument and return types below. |
Promise<CartesianZoomChangeEventDetail> | An asynchronous method. Check the argument and return types below. | |
Promise<CartesianZoomState> | An asynchronous method. Check the argument and return types below. | |
| request?: CartesianZoomExtentRequest | Promise<CartesianZoomExtentDetail> | An asynchronous method. Check the argument and return types below. |
No matching APIs.