Chartsv26.10.18
Standard edition

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

ThemePalette of the chart (`theme` attribute of the element).Effect: Repaints tokens only - the chart itself is never rebuilt. Six named palettes ship: dark and light (library bases), corporate (flat light surfaces for reports), capitalMarkets (charcoal terminal), orange (amber terminal with a monospace readout) and unifin (brand navy with a teal accent, the base of the brand gradients). system follows the host preference.Recommended: dark on terminals, corporate inside documents, unifin on brand pages
Palette of the chart, exposed as the `theme` attribute of the element.Current: Dark

Interaction

CrosshairCrosshair drawn under the pointer.Effect: hidden turns it off, free follows the pointer, magnet snaps to the nearest bar close.Recommended: magnet - values read without hunting for the bar
ReadoutValues strip of the pointed bar above the plot.Effect: off keeps the frame clean, line prints one dense row, rows print one line per field.Recommended: line on dashboards, rows where space allows

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

Grid styleStroke style of the grid.Effect: solid is the calm default, dotted thins the background for dense studies.Recommended: solid
Grid periodPeriod separators of the time axis.Effect: Adds a stronger divider where a month, quarter or year opens.Recommended: off; month on long histories
WatermarkPosition of the ticker watermark.Effect: center for promotion, bottom-left when the picture must stay clean.Recommended: center
StateEmpty, loading and failure states of the frame.Effect: Paints the state message instead of the series; empty is the usual fallback.Recommended: off unless the feed can be empty

Scales

Value axisSide of the value scale.Effect: right is the convention of the library, left matches terminal layouts.Recommended: right
Value scaleMapping of prices to the axis.Effect: linear for prices, log for wide ranges, percentage and indexedTo100 for comparing instruments, volume for volume panes.Recommended: linear
Time axisWhere the time labels sit in a stack of panes.Effect: auto hands them to the bottom pane, hidden removes them from the pane.Recommended: auto

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)
GroupControlAttribute / memberValuesCurrentRecommendedEffect
DataScenesetScene(scene)candles, bars, renko, profilecandlescandlescandles, bars, renko and profile build the series from the same data.
DataTimeframetimeframe1m, 5m, 15m, 1h, 4h, 1D5m5mThe one-minute base is aggregated through the core resample; switching keeps the window.
DataSymbolsymbolAAPL, AAPL, MSFT, NVDAAAPLthe instrument of the feedLabels, the watermark and the hover card follow the symbol.
DataLocalelocaleen, ru, uz, kzen (fixed on the portal)en on this portal, ru/kz/uz for hostsSets number grouping, date formats and the wording of states.
DataLive streambars (ticker)on, offononMoves the newest bar every half second and fires sparks; off freezes the data.
InteractionCrosshaircrosshairhidden, free, magnetmagnetmagnet - values read without hunting for the barhidden turns it off, free follows the pointer, magnet snaps to the nearest bar close.
InteractionReadoutreadout-modeoff, line, rowslineline on dashboards, rows where space allowsoff keeps the frame clean, line prints one dense row, rows print one line per field.
InteractionTooltip cardtooltippresent, absentpresentonPrints open, high, low, close, volume and the period change of the pointed bar.
InteractionTooltip holdtooltip-hold0 .. 60000 ms5000 ms5000 ms (the core default)Zero hides them at once; long holds keep the values readable while the chart streams.
InteractionPrice tagprice-tagpresent, absentpresentonShows the last traded level without reading the scale.
InteractionVolume tagvolume-tagpresent, absentpresentonShows the traded size of the bar under the pointer.
InteractionOHLCV legendlegendpresent, absentpresentonPrints open, high, low, close, volume and the change above the plot.
InteractionWindow chipschipspresent, absentabsentoff by default, on for reviewsAdds high and low markers of the visible window and a notch at the last price.
InteractionLeft fadeleft-fadeabsent, number (0 .. 0.6)absentoff; 0.18 when history is longGently dims the left edge so the newest bars read first.
EventsCorporate eventsevents (property)markers, null8 badgeson where the feed has eventsDividends, reports and news as badges; hover opens the card, click fires the event.
EventsBadge gapevents.minGap0 .. 60 px10 px10 pxSmall gaps collapse crowded badges, large gaps keep them apart.
ChromeGridshow-gridtrue, falsetrueonHorizontal value lines and vertical time lines behind the series.
ChromeGrid stylegrid-stylesolid, dottedsolidsolidsolid is the calm default, dotted thins the background for dense studies.
ChromeGrid periodgrid-periodoff, month, quarter, yearoffoff; month on long historiesAdds a stronger divider where a month, quarter or year opens.
ChromeValue axisprice-axisright, leftrightrightright is the convention of the library, left matches terminal layouts.
ChromeAxis widthprice-axis-width0 .. 200 px64 px64 px (28 in mini mode)Wider shows longer numbers without clipping, zero hides the scale.
ChromeValue scaleprice-scale-modelinear, log, percentage, indexedTo100, volumelinearlinearlinear for prices, log for wide ranges, percentage and indexedTo100 for comparing instruments, volume for volume panes.
ChromeTime axistime-axisauto, hiddenautoautoauto hands them to the bottom pane, hidden removes them from the pane.
ChromeWatermarkwatermark-positioncenter, bottom-leftcentercentercenter for promotion, bottom-left when the picture must stay clean.
ChromeStatestateoff, empty, loading, error, waitingoffoff unless the feed can be emptyPaints the state message instead of the series; empty is the usual fallback.
ChromeMini modeminipresent, absentabsentoff on full pagesNarrow axis, smaller text and sparkline density for cards and lists.
Look packBackdropbackdropflat, gradient, auroraauroraaurora on the portal, flat in embedsflat is neutral, gradient adds depth, aurora paints the portal backdrop.
Look packBarsbars-styleclassic, neon, sunset, ice, monoiceclassic for products, ice on the portalclassic follows the theme, ice, neon, sunset and mono restyle bodies only.
Look packVolume tonevolume-tonetheme, dim, accent, contrastdimdimtheme follows the palette, dim and contrast mute or lift the band.
Look packVolume alphavolume-alpha0.15 .. 10.550.5Lower values keep the price series dominant.
Look packReadout skinreadout-skinplain, chip, cardschipchipplain text, chip with a background, cards with per-field boxes.
Look packFontfontonest, inter, serif, monoonestonestSets the face of labels, legend and the hover card.
Look packIndicator gradientindicator-gradientpresent, absentpresentonFades each curve along its length; off keeps flat strokes.
Look packLine gradientline-gradientabsent, on, number (0.02 .. 0.9)on (0.35)on for brand pages, off for monochrome reportsShades 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 packVolume gradientvolume-gradientabsent, on, number (0.02 .. 0.9)on (0.35)on together with the line gradientShades the volume band top-to-bottom; independent of the volume tone, so a themed column can carry it. Ignored while volume is off.
Look packChart gradientchart-gradientabsent, on, from/to/angle/phaseabsenton for the brand palette, off for printReplaces 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.
PresetsSheen, cursor glow, sparksfx(preset, on)sheen, cursorGlow, sparkssparkssparks only; presets are opt-insheen sweeps a highlight, cursor glow follows the pointer, sparks burst at the newest close.
PresetsSpark stylespark-styleburst, bengal, sparkler, fountain, comet, ember, confetti, pulse, shower, novabengalbengalTen styles from a single burst to a fountain; the style shows on the next burst.
ReplayTransportreplayPlay / replayStep / replayPause / replayExitplay, step, pause, exitoffuse for demos and reviewsplay starts the cursor, step walks bars, pause holds, exit returns the full history.
ReplaySpeedreplayPlay(speed)1x, 2x, 5x, 10x, 20x, 50x5x5xHigher 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

ControlAttribute / memberValuesWhat it changes
Crosshaircrosshairhidden, free, magnetCrosshair on hover; magnet snaps to the nearest bar
Readoutreadout-modeabsent, line, rowsValues strip of the hovered bar above the plot
Tooltip cardtooltippresent, absentHover card next to the crosshair
Tooltip holdtooltip-hold0 .. 60000 msHow long the card stays after the pointer leaves (default five seconds)
Price tagprice-tagpresent, absentLast price notch on the value axis
Volume tagvolume-tagpresent, absentVolume value on the volume pane
OHLCV legendlegendpresent, absentLegend row with the newest bar
Window chipschipspresent, absentWindow high and low markers plus the last price notch
Left fadeleft-fadeabsent, number 0 .. 0.6Fade 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
};
MemberTypeNotes
events.markers{ time, title, kind?, glyph? }[]One badge per marker; time is the bar it belongs to
events.glyphsRecord<string, string>Glyph override per kind
events.minGapPixelsCollapsing distance; the demo slider drives it
eventsEventLaneInput | nullnull removes the lane
event-clickeventDetail 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

ControlAttributeValuesWhat it changes
Themethemedark, light, corporate, capitalMarkets, orange, unifin, systemPalette of the whole frame; only tokens change, the chart is not rebuilt
Gridshow-gridtrue, falsePlot grid
Grid stylegrid-stylesolid, dottedGrid stroke style
Grid periodgrid-periodmonth, quarter, yearPeriod separators of the time axis
Value axisprice-axisright, leftSide of the value scale
Axis widthprice-axis-widthPixelsWidth of the value scale; 0 hides it
Value scaleprice-scale-modelinear, log, percentage, indexedTo100, volumeValue scale of the pane
Time axistime-axisauto, hiddenUpper panes hand the time axis to the pane below
Watermarkwatermark-positioncenter, bottom-leftTicker watermark position
Statestateempty, loading, error, waitingEmpty, loading and failure states of the frame
Mini modeminipresent, absentSparkline 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

ControlAttributeValues
Backdropbackdropflat, gradient, aurora
Barsbars-styleclassic, neon, sunset, ice, mono
Volume tonevolume-tonetheme, dim, accent, contrast
Volume alphavolume-alpha0.15 .. 1
Readoutreadout-skinplain, chip, cards
Fontfontonest, inter, serif, mono
Indicator gradientindicator-gradientpresent or absent
Line gradientline-gradientabsent, on, or a share 0.02 .. 0.9
Volume gradientvolume-gradientabsent, on, or a share 0.02 .. 0.9
Chart gradientchart-gradientabsent, 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

PresetWhat it drawsWhen it fires
sheena soft highlight sweeping across the framecontinuously while active
cursorGlowa radial glow following the pointerwhile active and the pointer moves
sparksa burst of particles at the newest closewhen 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:spark fires for every burst with { scene, source }: source is "scene" for switches and preset activation, "live" for data updates.
  • sparksAlive reads the current particle count - handy for demos, telemetry and tests.

Element API

Properties and methods

MemberTypeNotes
fx(preset, on)(preset: string, on: boolean) => booleanTurns a preset on or off. Unknown names and reduced-motion refusals return false.
fxActivereadonly FxPreset[]Active presets in canonical order: sheen, cursorGlow, sparks.
sparksAlivenumberAlive spark particles of the current burst.
setScene(scene)(scene: string) => booleancandles, bars, renko or profile; a successful switch fires the scene burst. The bars scene paints OHLC bars, the other scenes keep candles.
lookChartLookInput | nullThe look pack of the frame; the scalar knobs also have attributes (backdrop, bars-style, volume-tone, volume-alpha, indicator-gradient, readout-skin, font).
sparkStyleSparkStyleNameBurst style of the sparks: burst, bengal, sparkler, fountain, comet, ember, confetti, pulse, shower, nova.
replayPlay(speed, from)(speed?: ReplaySpeed, from?: number) => booleanStarts the history cursor; from seeks to a bar index first.
replayStep(delta)(delta?: number) => booleanPauses and moves the cursor by whole bars (negative walks back).
replayPause(), replayExit()() => void / () => booleanPauses the cursor; replayExit leaves replay mode and draws the full history.
barsreadonly Bar[]Assigning new data redraws and fires the live burst whenever the newest value changed.

Events

EventDetailFires
chart:spark{ scene: string, source: 'scene' | 'live' }every burst
replay:progressReplayViewStatestarted, 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 motion

Driving 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 particles

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

On this page