Live effects
Presentation presets for the custom element - a sheen sweep, a cursor glow, live sparks, the look pack and replay.
This page covers the presentation presets of the custom element - a sheen sweep, a cursor glow and live sparks - plus the look pack, the spark styles and the replay cursor. Presets are opt-in, follow the motion policy and cost nothing while they are off.
Try it live
Interaction
Events
8 badges in the window: News, Report and Dividend every 24 bars. Hover a badge for its card, click it for `event-click`.
Chrome
Scales
Look pack
Presets
0 bursts so far.
Replay
- O
- 867.90
- H
- 867.93
- L
- 866.68
- C
- 866.74
- Change
- -0.13%
- Range
- 1.25
- Volume
- 1,420
- Avg vol 20
- 2,315
- Bursts
- 0
- Pointer
- Hover the chart to read the values under the crosshair
Every parameter of this page (40)
| Group | Control | Attribute / member | Values | Current | Recommended | Effect |
|---|---|---|---|---|---|---|
| Data | Scene | setScene(scene) | candles, bars, renko, profile | candles | candles | candles, bars, renko and profile build the series from the same data. |
| Data | Timeframe | timeframe | 1m, 5m, 15m, 1h, 4h, 1D | 5m | 5m | The one-minute base is aggregated through the core resample; switching keeps the window. |
| Data | Symbol | symbol | AAPL, AAPL, MSFT, NVDA | AAPL | the instrument of the feed | Labels, the watermark and the hover card follow the symbol. |
| Data | Locale | locale | en, ru, uz, kz | en (fixed on the portal) | en on this portal, ru/kz/uz for hosts | Sets number grouping, date formats and the wording of states. |
| Data | Live stream | bars (ticker) | on, off | on | on | Moves the newest bar every half second and fires sparks; off freezes the data. |
| Interaction | Crosshair | crosshair | hidden, free, magnet | magnet | magnet - values read without hunting for the bar | hidden turns it off, free follows the pointer, magnet snaps to the nearest bar close. |
| Interaction | Readout | readout-mode | off, line, rows | line | line on dashboards, rows where space allows | off keeps the frame clean, line prints one dense row, rows print one line per field. |
| Interaction | Tooltip card | tooltip | present, absent | present | on | Prints open, high, low, close, volume and the period change of the pointed bar. |
| Interaction | Tooltip hold | tooltip-hold | 0 .. 60000 ms | 5000 ms | 5000 ms (the core default) | Zero hides them at once; long holds keep the values readable while the chart streams. |
| Interaction | Price tag | price-tag | present, absent | present | on | Shows the last traded level without reading the scale. |
| Interaction | Volume tag | volume-tag | present, absent | present | on | Shows the traded size of the bar under the pointer. |
| Interaction | OHLCV legend | legend | present, absent | present | on | Prints open, high, low, close, volume and the change above the plot. |
| Interaction | Window chips | chips | present, absent | absent | off by default, on for reviews | Adds high and low markers of the visible window and a notch at the last price. |
| Interaction | Left fade | left-fade | absent, number (0 .. 0.6) | absent | off; 0.18 when history is long | Gently dims the left edge so the newest bars read first. |
| Events | Corporate events | events (property) | markers, null | 8 badges | on where the feed has events | Dividends, reports and news as badges; hover opens the card, click fires the event. |
| Events | Badge gap | events.minGap | 0 .. 60 px | 10 px | 10 px | Small gaps collapse crowded badges, large gaps keep them apart. |
| Chrome | Grid | show-grid | true, false | true | on | Horizontal value lines and vertical time lines behind the series. |
| Chrome | Grid style | grid-style | solid, dotted | solid | solid | solid is the calm default, dotted thins the background for dense studies. |
| Chrome | Grid period | grid-period | off, month, quarter, year | off | off; month on long histories | Adds a stronger divider where a month, quarter or year opens. |
| Chrome | Value axis | price-axis | right, left | right | right | right is the convention of the library, left matches terminal layouts. |
| Chrome | Axis width | price-axis-width | 0 .. 200 px | 64 px | 64 px (28 in mini mode) | Wider shows longer numbers without clipping, zero hides the scale. |
| Chrome | Value scale | price-scale-mode | linear, log, percentage, indexedTo100, volume | linear | linear | linear for prices, log for wide ranges, percentage and indexedTo100 for comparing instruments, volume for volume panes. |
| Chrome | Time axis | time-axis | auto, hidden | auto | auto | auto hands them to the bottom pane, hidden removes them from the pane. |
| Chrome | Watermark | watermark-position | center, bottom-left | center | center | center for promotion, bottom-left when the picture must stay clean. |
| Chrome | State | state | off, empty, loading, error, waiting | off | off unless the feed can be empty | Paints the state message instead of the series; empty is the usual fallback. |
| Chrome | Mini mode | mini | present, absent | absent | off on full pages | Narrow axis, smaller text and sparkline density for cards and lists. |
| Look pack | Backdrop | backdrop | flat, gradient, aurora | aurora | aurora on the portal, flat in embeds | flat is neutral, gradient adds depth, aurora paints the portal backdrop. |
| Look pack | Bars | bars-style | classic, neon, sunset, ice, mono | ice | classic for products, ice on the portal | classic follows the theme, ice, neon, sunset and mono restyle bodies only. |
| Look pack | Volume tone | volume-tone | theme, dim, accent, contrast | dim | dim | theme follows the palette, dim and contrast mute or lift the band. |
| Look pack | Volume alpha | volume-alpha | 0.15 .. 1 | 0.55 | 0.5 | Lower values keep the price series dominant. |
| Look pack | Readout skin | readout-skin | plain, chip, cards | chip | chip | plain text, chip with a background, cards with per-field boxes. |
| Look pack | Font | font | onest, inter, serif, mono | onest | onest | Sets the face of labels, legend and the hover card. |
| Look pack | Indicator gradient | indicator-gradient | present, absent | present | on | Fades each curve along its length; off keeps flat strokes. |
| Look pack | Line gradient | line-gradient | absent, on, number (0.02 .. 0.9) | on (0.35) | on for brand pages, off for monochrome reports | Shades every candle and column body from the bright top towards its own darker tail and tapers line and area strokes; one ramp per layer, so a long history keeps the flat frame cost. |
| Look pack | Volume gradient | volume-gradient | absent, on, number (0.02 .. 0.9) | on (0.35) | on together with the line gradient | Shades the volume band top-to-bottom; independent of the volume tone, so a themed column can carry it. Ignored while volume is off. |
| Look pack | Chart gradient | chart-gradient | absent, on, from/to/angle/phase | absent | on for the brand palette, off for print | Replaces the flat theme fill with a soft ramp derived from the palette; the brand palette drifts its phase on every repaint (a shimmer), frozen under prefers-reduced-motion. Optional overrides: from, to, angle, phase. |
| Presets | Sheen, cursor glow, sparks | fx(preset, on) | sheen, cursorGlow, sparks | sparks | sparks only; presets are opt-in | sheen sweeps a highlight, cursor glow follows the pointer, sparks burst at the newest close. |
| Presets | Spark style | spark-style | burst, bengal, sparkler, fountain, comet, ember, confetti, pulse, shower, nova | bengal | bengal | Ten styles from a single burst to a fountain; the style shows on the next burst. |
| Replay | Transport | replayPlay / replayStep / replayPause / replayExit | play, step, pause, exit | off | use for demos and reviews | play starts the cursor, step walks bars, pause holds, exit returns the full history. |
| Replay | Speed | replayPlay(speed) | 1x, 2x, 5x, 10x, 20x, 50x | 5x | 5x | Higher speeds walk the history faster; the feed keeps streaming underneath. |
Rendered on this page by `@unifin/chart-element` - a streaming ticker moves the last bar every half second and every update makes the chosen spark burst at the newest close (0 bursts so far). Every control drives the real public API: the scene buttons call `setScene`, the look selects map to the `backdrop`, `bars-style`, `volume-tone`, `volume-alpha`, `readout-skin`, `font` and `spark-style` attributes, the interaction and chrome controls map to the `crosshair`, `readout-mode`, `tooltip`, `tooltip-hold`, `price-tag`, `chips`, `left-fade`, `show-grid`, `grid-style`, `grid-period`, `price-axis`, `price-axis-width`, `price-scale-mode`, `time-axis`, `watermark-position`, `state` and `mini` attributes, the event toggle sets the `events` property, the presets map to `fx()`, and the replay row calls `replayPlay`, `replayStep`, `replayPause` and `replayExit`. Effects are refused while the system prefers reduced motion.
The panel under the heading groups every option of the element into cards - Interaction, Events, Chrome, Look pack, Presets and Replay - and the table below the chart lists each control with its attribute, the accepted values and the value in force right now, so a setting can be checked without reading the source. The strip above the table shows the newest bar, the second strip follows the pointer: time, price and the OHLCV of the bar under the crosshair.
Switch scenes (every switch fires a spark burst), pick a look, switch the timeframe, toggle the presets, replay the history and watch the sparks pop at the newest close. Everything on this page runs on the real library build - the component uses the same public API you would.
Interaction parameters
| Control | Attribute / member | Values | What it changes |
|---|---|---|---|
| Crosshair | crosshair | hidden, free, magnet | Crosshair on hover; magnet snaps to the nearest bar |
| Readout | readout-mode | absent, line, rows | Values strip of the hovered bar above the plot |
| Tooltip card | tooltip | present, absent | Hover card next to the crosshair |
| Tooltip hold | tooltip-hold | 0 .. 60000 ms | How long the card stays after the pointer leaves (default five seconds) |
| Price tag | price-tag | present, absent | Last price notch on the value axis |
| Volume tag | volume-tag | present, absent | Volume value on the volume pane |
| OHLCV legend | legend | present, absent | Legend row with the newest bar |
| Window chips | chips | present, absent | Window high and low markers plus the last price notch |
| Left fade | left-fade | absent, number 0 .. 0.6 | Fade of the oldest bars in the window |
The hover card does not vanish with the pointer: the hold window keeps the last hover readable, and
crosshair-move / crosshair-leave report the values so a host can mirror them (the strip in the
demo does exactly that).
Corporate events on the chart
Events are a property, not an attribute: a marker carries a time and a title, and the frame paints
one badge row above the time axis. Hovering a badge paints its card, clicking it fires event-click.
import type { EventLaneInput } from '@unifin/chart-core';
const element = document.querySelector('unifin-chart') as HTMLElement & { events: EventLaneInput | null };
element.events = {
markers: [
{ time: Date.UTC(2026, 8, 21, 7, 0), title: 'Earnings', kind: 'earnings' },
{ time: Date.UTC(2026, 8, 21, 9, 0), title: 'Dividends', kind: 'dividends' },
],
minGap: 10, // minimum pixels between two badges; crowded badges collapse
};| Member | Type | Notes |
|---|---|---|
events.markers | { time, title, kind?, glyph? }[] | One badge per marker; time is the bar it belongs to |
events.glyphs | Record<string, string> | Glyph override per kind |
events.minGap | Pixels | Collapsing distance; the demo slider drives it |
events | EventLaneInput | null | null removes the lane |
event-click | event | Detail is the marker that was clicked |
The React binding takes the same object through the events prop, so a portal and a plain HTML page
show the same lane.
Chrome parameters
| Control | Attribute | Values | What it changes |
|---|---|---|---|
| Theme | theme | dark, light, corporate, capitalMarkets, orange, unifin, system | Palette of the whole frame; only tokens change, the chart is not rebuilt |
| Grid | show-grid | true, false | Plot grid |
| Grid style | grid-style | solid, dotted | Grid stroke style |
| Grid period | grid-period | month, quarter, year | Period separators of the time axis |
| Value axis | price-axis | right, left | Side of the value scale |
| Axis width | price-axis-width | Pixels | Width of the value scale; 0 hides it |
| Value scale | price-scale-mode | linear, log, percentage, indexedTo100, volume | Value scale of the pane |
| Time axis | time-axis | auto, hidden | Upper panes hand the time axis to the pane below |
| Watermark | watermark-position | center, bottom-left | Ticker watermark position |
| State | state | empty, loading, error, waiting | Empty, loading and failure states of the frame |
| Mini mode | mini | present, absent | Sparkline density and a narrow axis |
locale stays en on this portal: the pages are English by design, the attribute takes ru, en,
uz and kz for hosts that ship other languages.
Look pack
| Control | Attribute | Values |
|---|---|---|
| Backdrop | backdrop | flat, gradient, aurora |
| Bars | bars-style | classic, neon, sunset, ice, mono |
| Volume tone | volume-tone | theme, dim, accent, contrast |
| Volume alpha | volume-alpha | 0.15 .. 1 |
| Readout | readout-skin | plain, chip, cards |
| Font | font | onest, inter, serif, mono |
| Indicator gradient | indicator-gradient | present or absent |
| Line gradient | line-gradient | absent, on, or a share 0.02 .. 0.9 |
| Volume gradient | volume-gradient | absent, on, or a share 0.02 .. 0.9 |
| Chart gradient | chart-gradient | absent, on, or from=#..,to=#..,angle=..,phase=.. |
The three gradients are independent and work in every palette. line-gradient shades candle and
column bodies from the bright top towards their own darker tail and tapers line and area strokes, so a
body no longer needs a bar palette to carry a gradient. volume-gradient does the same for the volume
columns and is independent of the volume tone, so a themed band can still be shaded. chart-gradient
replaces the flat theme fill with a ramp derived from the palette; on the brand palette the ramp drifts
its phase on every repaint, which reads as a slow shimmer - the drift follows the repaints the host
already drives instead of adding an animation loop, and it freezes when the system asks for reduced
motion.
All three create at most one gradient object per colour and frame, so a long history keeps the flat frame cost.
Gradient rendering degrades gracefully: a canvas without createLinearGradient keeps the flat S13 fill,
an invisible volume tone keeps the theme columns, and classic always resolves to the live theme colours.
Replay
Engage the cursor with replayPlay(speed, from), walk bar by bar with replayStep(delta), pause with
replayPause() and leave with replayExit(). replay:progress reports the index, progress, playing flag
and speed, so the host can drive its own transport UI. The demo above starts the cursor 60 percent into the
history and streams the exact same engine the Pro workspace uses.
Presets
| Preset | What it draws | When it fires |
|---|---|---|
sheen | a soft highlight sweeping across the frame | continuously while active |
cursorGlow | a radial glow following the pointer | while active and the pointer moves |
sparks | a burst of particles at the newest close | when the preset turns on, on scene switches and on every live update of the last bar |
All three are refused with false while the host prefers reduced motion; nothing animates
silently.
Live sparks in detail
- The burst spawns at the newest bar: its screen point is the bar centre at the last close, so the sparks always sit exactly where the price moved.
- Up to 48 particles live at once; a burst burns out in about 900 ms with gravity and damping, so the effect stays cheap and self-limiting.
- The element runs its own animation loop and repaints while particles are alive - no timers on the data side, no perpetual redraw, and nothing to clean up when the burst ends.
chart:sparkfires for every burst with{ scene, source }:sourceis"scene"for switches and preset activation,"live"for data updates.sparksAlivereads the current particle count - handy for demos, telemetry and tests.
Element API
Properties and methods
| Member | Type | Notes |
|---|---|---|
fx(preset, on) | (preset: string, on: boolean) => boolean | Turns a preset on or off. Unknown names and reduced-motion refusals return false. |
fxActive | readonly FxPreset[] | Active presets in canonical order: sheen, cursorGlow, sparks. |
sparksAlive | number | Alive spark particles of the current burst. |
setScene(scene) | (scene: string) => boolean | candles, bars, renko or profile; a successful switch fires the scene burst. The bars scene paints OHLC bars, the other scenes keep candles. |
look | ChartLookInput | null | The look pack of the frame; the scalar knobs also have attributes (backdrop, bars-style, volume-tone, volume-alpha, indicator-gradient, readout-skin, font). |
sparkStyle | SparkStyleName | Burst style of the sparks: burst, bengal, sparkler, fountain, comet, ember, confetti, pulse, shower, nova. |
replayPlay(speed, from) | (speed?: ReplaySpeed, from?: number) => boolean | Starts the history cursor; from seeks to a bar index first. |
replayStep(delta) | (delta?: number) => boolean | Pauses and moves the cursor by whole bars (negative walks back). |
replayPause(), replayExit() | () => void / () => boolean | Pauses the cursor; replayExit leaves replay mode and draws the full history. |
bars | readonly Bar[] | Assigning new data redraws and fires the live burst whenever the newest value changed. |
Events
| Event | Detail | Fires |
|---|---|---|
chart:spark | { scene: string, source: 'scene' | 'live' } | every burst |
replay:progress | ReplayViewState | started, paused, seek, step and speed changes |
CSS contract
The element only toggles classes; the look is yours. While a preset is active the host carries
uf-fx-sheen, uf-fx-cursor-glow or uf-fx-sparks; scene bursts add uf-fx-spark-burst for
600 ms, and the cursor glow reads the --uf-fx-x / --uf-fx-y custom properties the element keeps
updated. A minimal host stylesheet:
unifin-chart { position: relative; }
unifin-chart.uf-fx-sheen::after {
content: "";
position: absolute;
inset: 0;
pointer-events: none;
background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.09) 50%, transparent 60%);
background-size: 240% 100%;
animation: uf-sheen 2.8s linear infinite;
}
@keyframes uf-sheen {
from { background-position: 120% 0; }
to { background-position: -120% 0; }
}Minimal usage
<unifin-chart id="demo" symbol="UFX" timeframe="5m" theme="dark"></unifin-chart>
<script type="module">
import { defineUnifinChart } from '@unifin/chart-element';
defineUnifinChart();
const chart = document.getElementById('demo');
chart.fx('sparks', true);
chart.addEventListener('chart:spark', (event) => console.log(event.detail));
</script>import { FX_PRESETS, isFxPreset, resolveFx } from '@unifin/chart-element';
// Host-side preset state without the element methods:
const state = resolveFx([], 'sparks', true, { reducedMotion: false });
state.active; // ['sparks'] - or [] with state.refused === true under reduced motionDriving the particles yourself
The particle model is a public, pure API of the core package - hosts that paint their own layers can run it without the element:
import { createSparks, spawnSparks, stepSparks, SPARKS_LIMIT } from '@unifin/chart-core';
const sparks = createSparks(); // deterministic xorshift state
spawnSparks(sparks, x, y, 12); // burst at a screen point, capped at SPARKS_LIMIT
stepSparks(sparks, frameDeltaMs); // advance, apply gravity and drop burnt particlesRenderInput.sparks passes the alive particles to the renderer (painted above the data in the
interaction layer and clipped to the plot), RenderStats.sparks reports the painted count, and the
React binding accepts a sparks getter (ChartBindingOptions.sparks()) so any host can push its
own particles per frame.
Frame extras
Beyond the presets, the renderer takes frame extras that a host turns on per chart: the history fade
(polish.leftFade), the dotted grid and the period dividers (gridStyle, gridPeriod), the collapsible
legend (legend.toggle, legend.collapsed), the pinned measure ruler (measure), price and alert lines
(priceLines), the corporate-event lane (events) and the volume tag (volume.tag). They follow the same
layer order as the rest of the frame and never animate on their own, so the motion policy below applies to
the presets. The option list is on the React API page and the
core API page.
Motion policy
Every preset follows one rule: while the system prefers reduced motion, enabling a preset returns
false and nothing is drawn. The same policy gates the scene crossfade and the view animations, so
a host never has to special-case effects.
See also
- Pro effects - the volume effects and the look pack on the Pro surfaces.
- Features - the look pack and the chrome options in context.
- Series types - the types the scene switcher draws.
- API overview - renderer, series, scales and binding surfaces.
Features
What Unifin Charts includes - rendering, scales, panes, data, indicators, drawings, profiles, order flow, alerts, trading UI, accessibility and performance, with the edition each area belongs to.
Live gallery
Interactive examples rendered by the library directly on this page - the series explorer, the themes and the standard surfaces.
