Skip to content

Releases

2.3.1 — 2026-10-17

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 17 Oct 14:42

2.3.1 — 2026-10-17

Patch (dependency maintenance) release. No source code or public API changes;
backs the klinecharts upstream releases (10.0.3 → 10.1.0) and the matching
react-klinecharts wrapper (1.0.1 → 1.0.2). Typecheck, lint, the full test
suite (360 tests), and the build pass against the bumped versions. Backwards
compatible.

Changed

  • klinecharts ^10.0.3 → ^10.1.0 (dev dependency). 10.1.0 is strictly
    additive on the public type surface — diffing the published .d.ts between
    10.0.3 and 10.1.0 shows zero removed symbols. New: the Store interface
    (which Chart extends) gains setLayoutOptions(DeepPartial<Layout>) /
    getLayoutOptions(): DeepRequired<Layout>; new exported types
    CompareColorCallback, CandleBarColorCallback and
    CandleBarColorCallbackReturnStyle; and the candle bar, indicator OHLC and
    last-price-mark style fields widen to also accept per-bar color callbacks
    (CandleStyle.bar, IndicatorStyle.ohlc, CandleLastPriceMarkLineStyle.color,
    the last-price-mark text / extend-text backgroundColor). DeepPartial<T>
    now passes function-typed fields through unchanged instead of mapping them
    into partial objects — that is what makes the callback-typed style fields
    assignable through setStyles, and it improves any consumer-held
    DeepPartial<Styles> carrying functions. Nothing the library reads
    (getStyles().overlay.line, tooltip styles) or writes (settings-built
    DeepPartial<Styles>) is affected.

  • react-klinecharts 1.0.1 → 1.0.2 (dev dependency, and the same pin in
    the docs / examples workspace packages). 1.0.2 raises its klinecharts
    dependency to ^10.1.0 — bumping it here keeps a single klinecharts@10.1.0
    copy in the dependency tree — and adds one small feature of its own: a
    reactive layoutOptions?: DeepPartial<Layout> prop on <KLineChart> that
    forwards to the new chart.setLayoutOptions(). The peer ranges
    (klinecharts >=10.0.0, react-klinecharts >=1.0.0) are unchanged.

Notable upstream behaviour in klinecharts 10.0.4 / 10.1.0 (picked up automatically)

These ship in klinecharts and apply through the chart instance — no library
change is required to benefit:

  • 10.1.0: new setLayoutOptions(options) / getLayoutOptions() instance
    methods update and read default layout options after initialization.
  • 10.1.0: candlestick colors, indicator OHLC bar colors and last-price
    line/label colors can now be assigned dynamically per bar via callbacks,
    instead of only the up/down compare rule.
  • 10.1.0: time-axis tick generation now selects and caches ticks by time
    hierarchy — more stable tick labels and better scrolling performance.
  • 10.1.0: fixed scrollByDistance conflicting with an active fling-scroll
    animation; axis scrolling/scaling stopping when the pointer left the axis
    mid-drag; a rapid click far from the previous click not starting a new click
    sequence; logarithmic y-axis labels and coordinate conversion for ranges
    containing negative, zero or sub-1 prices; overlay y-axis labels rendered
    repeatedly on non-default axes in multi-axis panes.
  • 10.0.4: consecutive realtime data updates in the same event loop now coalesce
    indicator recalculations (the library's updateBar path benefits directly),
    and pane heights are rounded after separator dragging, preventing subpixel
    dimensions from causing continuous full repaints.
  • 10.0.4: fixed data-loader subscriptions not being removed when a chart is
    destroyed; indicator update detection comparing figures only by reference;
    calcParams / figures sharing references with external objects after
    indicator overrides (and explicit undefined values replacing existing
    options); a potential infinite loop when the y-axis tick interval is smaller
    than floating-point precision (relevant to the sub-cent precision work in
    2.3.0); y-axis width jitter from frequently changing realtime labels; drag,
    zoom and crosshair state remaining active after a cancelled touch gesture;
    and an exception when setting an unregistered locale (now falls back to
    en-US).

2.3.0 — 2026-09-26

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 26 Sep 05:46

2.3.0 — 2026-09-26

Fixed

  • Sub-cent symbols (PEPE, SHIB, …) rendered as a flat line with all axis
    labels reading 0.00.
    klinecharts clamps the candle-pane Y axis to
    10^-pricePrecision per tick and defaults to 2 decimals when the symbol
    carries none: for a 0.000005-priced token the data range (~2e-7) is far
    below the 0.01 minimum span, so the axis force-expands to ±0.04 and the
    candles collapse into a sub-pixel band. The terminal now detects the
    precision implied by the smallest movement in the bars returned by the
    initial getHistoryKLineData load (wicks, body, and adjacent-close deltas;
    order-of-magnitude based, so float-subtraction noise like
    65000.12 - 65000.11 cannot inflate it) and feeds it back into the symbol
    via a new internal ENSURE_PRICE_PRECISION action — the chart re-scales and
    the labels gain the missing decimals. Default-scale data detects nothing and
    dispatches nothing (normal symbols never pay the extra symbol refresh), and
    an explicit pricePrecision on the symbol always wins.
  • A stale init could stamp the wrong symbol's auto-detected precision onto
    the new symbol.
    The loader's generation counter only bumps once the NEW
    symbol's init starts, so an old symbol's init resolving in the gap after
    SET_SYMBOL would fill the new symbol's pricePrecision — and the
    explicit-precision guard would then keep the wrong value forever.
    ENSURE_PRICE_PRECISION now carries the ticker and the reducer ignores
    mismatches.
  • Workspace sync crashed with "Maximum update depth exceeded" when a sync
    bridge's cellId matched no cell
    (REMOVE_CELL while the bridge stayed
    mounted, or a typo'd id). The mirror effects dispatch whenever the cell
    value differs — for a missing cell it ALWAYS differs — and the workspace
    reducer built a fresh cells array for the no-op dispatch, retriggering
    the effect forever. SET_CELL_SYMBOL/SET_CELL_PERIOD now return the same
    state reference when no cell matches.
  • Deleting the "Auto-save" layout permanently killed auto-save for the
    session.
    The 5s sweep consumed the changed-content signature before the
    write attempt, then found the entry gone and skipped the write — with the
    stale id kept, every later sweep skipped too. The sweep now drops the stale
    id and falls through to the create path.
  • SET_LOADING no longer re-renders the whole terminal when the flag is
    unchanged.
    With overlapping init+forward requests the loader dispatches
    the same boolean repeatedly; the reducer now returns the same state
    reference (the existing SET_SCREENSHOT_URL pattern).
  • Overlay operations claiming a groupId scope were NOT scoped.
    klinecharts v10's filter short-circuits on a valid id and ignores
    groupId/name: removeOverlay({ id, groupId }) removed the overlay with
    that id in ANY group, and overrideOverlay({ id, groupId, … }) additionally
    merged our groupId into the victim (silently re-homing it). All id+group
    call sites (drawing tools, price alerts, undo/redo, the alert reconciler)
    now go through utils/overlays scoped helpers that verify the group BEFORE
    calling by id and never forward groupId into the override payload.
  • removeDrawing bypassed undo. Only removeAllDrawings recorded an
    overlays_removed action; a drawing deleted via the list/Delete key was
    unrecoverable and diverged the undo sequence. Single-drawing removal now
    snapshots the overlay and records the same action shape.
  • Price alerts created mid-bar fired immediately for a wick that predated
    the alert.
    The poller's baseline (previous bar close) plus the whole-bar
    touched signal bypassed the documented "first observation never fires"
    seed. useAlerts.addAlert now stamps createdAt on the alert; a forming
    bar that OPENED before that moment cannot fire the alert (baseline falls
    back to the first observed price, wick signal suppressed). Alerts hydrated
    from storage have no createdAt and keep the full wick detection.
  • Indicator alerts accept a bare indicator name. The poller resolved
    targets by id only, and v10's filter ignores name next to a valid id —
    an alert armed on "RSI" instead of sub_RSI sat silent forever. Falls
    back to a name lookup when the id misses.
  • Synced crosshairs never cleared when the cursor left the source chart.
    klinecharts emits no onCrosshairChange on mouseleave (the store's emit
    gate requires a string paneId), so siblings kept a frozen line. The sync
    bridge now listens for DOM mouseleave (the same gap useCrosshair already
    patched locally) and broadcasts an empty crosshair, which clears the target
    drawing without echo.
  • sync.symbol / sync.period config channels were silently ignored. The
    outward report effects wrote the provider's symbol/period into the workspace
    cell regardless of the flags. The channels now gate the outward report;
    inward (cross-cell) linking stays the consumer's job, as documented.
  • useCompare: remove→re-add while the first fetch was in flight
    resurrected the stale fetch and discarded the fresh one.
    The post-await
    guard checked only that the pending slot was occupied — by the NEWER fetch.
    The pending map now carries a monotonically increasing generation (never
    reset on remove, so a re-add can't reissue the same one) and a continuation
    proceeds only when its own generation is still current.
  • Settings hook fired a phantom onSettingsChange on mount and transiently
    overwrote stored settings with defaults.
    Hydration, notify and persist
    effects share the mount commit but the closures saw the pre-hydration
    defaults; the notify/persist effects now skip the pre-hydration commit and
    the persistence baseline is seeded with the hydrated value.
  • A theme toggle permanently clobbered custom settings styles. The
    settings bootstrap was a one-shot guard per chart instance, and
    setStyles(theme) merges the full built-in preset over current styles. The
    effect now owns the chart's style state: on theme change it rebases the
    preset and re-applies the (persisted) settings on top; on settings change it
    re-applies without the rebase; a recreated chart always receives the current
    settings.
  • Hydration validated only the root shape of stored JSON. A corrupt nested
    payload ({"main": "MA"} — string where string[] belongs) crashed
    ChartCanvas' forEach at chart-ready; a garbage element in the alerts array
    reconciled into a ghost overlay with id: undefined that removeAlert
    could never target. Stored indicators/alerts are now field-validated, with
    corrupt entries dropped back to defaults.
  • loadLayout threw on a truncated layout entry instead of returning
    false.
    readLayoutEntry parsed without a shape check; entries lacking a
    state object now degrade to null. Layout index writes are deduped
    (two providers sharing one backend race the index read-modify-write).
  • Forward pagination duplicated a bar with inclusive-to feeds (e.g.
    Binance endTime): klinecharts prepends the response verbatim. The loader
    now drops anything not strictly older than the anchor, and the Datafeed
    contract documents to as exclusive + ascending order required.
  • Watchlist fixes. A row is added BEFORE subscribing (a feed emitting its
    first quote synchronously inside subscribe no longer loses it); a throwing
    subscribe in the period/feed reconciliation loop no longer leaves a
    fresh-looking entry that blocks every retry (the ticker went permanently
    silent); each subscription records the feed it was opened on, so a runtime
    datafeed swap can no longer unsubscribe from — or leak on — the wrong feed.
  • Undo/redo history is capped at 100 entries (each carries a full
    overlay/indicator snapshot; it grew unboundedly for the life of the chart).
  • useMeasure: startMeasure before the chart exists no longer leaves the
    mode stuck active
    with no overlay and no reconciliation.
  • createOrderLine with an already-existing id returns null instead of
    reporting success for a line klinecharts silently never created.
  • useScriptEditor reconciles a vanished script indicator (wiped by a
    layout load) instead of leaving hasActiveScript true with a dead Remove
    button.
  • useScreenshot.capture no longer throws on a tainted canvas — a
    cross-origin image drawn by an overlay makes toDataURL throw; the failure
    is logged and the click handler survives.
  • Replay: a getBars entering the commit window after stopReplay could be
    served the old replay slice
    — the every-render effect re-armed
    replayActiveRef from the stale state of the same commit. The ref is now
    propagated one-way (cleared only); startReplay sets it.
  • brush legacy-index repair no longer retries on every animation frame
    for strokes pointing past the loaded range; it re-runs only when the data
    list length changes.
  • Docs: TA.ema/rma seed with an SMA of the first period values
    (TA-Lib convention), not Pine's first-value seed — the docstring previously
    claimed full Pine parity. Watchlist change/changePercent documented as
    the forming bar's move, not the day change.

v2.2.0

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 08 Sep 00:58

Fixed

  • Crosshair sync is time-based, not pixel-based. useChartSync forwarded
    the whole crosshair object to every sibling (executeAction( "onCrosshairChange", data)). klinecharts v10's ChartImp.executeAction
    calls setCrosshair(data, { notExecuteAction: true }), and StoreImp. setCrosshair recomputes dataIndex / kLineData / timestamp from x via
    coordinateToDataIndex(x) on the receiving chart's own scale — so the
    mirrored value was a pixel offset, and any sibling with a different scroll
    position, zoom, timeframe or symbol landed on a different bar (four charts,
    four dates under one crosshair). The source now converts its pixel to a
    timestamp with convertFromPixel and each target maps that timestamp back to
    its own pixel with convertToPixel, sending only { x, paneId }. y is
    dropped on purpose: a foreign instrument's price means nothing on another
    scale, and klinecharts draws the horizontal line only when y is present.
    No echo loop — executeAction sets the crosshair with
    notExecuteAction: true.
  • Scroll sync sent a bar index where a timestamp was expected.
    getVisibleRange().realTo is an (exclusive) BAR INDEX, not a timestamp, but
    it was passed straight to scrollToTimestamp. That method binary-searches
    the data list for the nearest timestamp, so small integers always resolved
    to the first bar and every sibling scrolled to the start of loaded history.
    The right-most visible bar's real timestamp is now resolved from the data
    list (clamped to the last bar when scrolled into the future) before
    broadcasting.
  • The multi-chart example had the same two defects in its own sync hook
    (crosshair driven by the never-populated event.dataIndex, scroll driven by
    the private _chartStore); it now uses the same public, time-based path.

Trap worth recording: onCrosshairChange subscribers receive the RAW
crosshair — { x, y, paneId } — because the store executes the action with the
argument it was given, not with its enriched internal _crosshair.
Crosshair declares timestamp / dataIndex / kLineData, so
crosshair.timestamp type-checks silently and is always undefined on the
mouse path.

  • useCrosshair always returned null — same root cause. It read
    event.kLineData off the raw crosshair, which is never populated, so the
    bar panel never showed anything. It now resolves the bar itself:
    convertFromPixel([{ x }], { paneId }) → dataIndex → getDataList()[i]
    (unclamped indices outside the loaded history map to null). A supplied
    event.kLineData still wins when present.
  • useCrosshair never cleared when the cursor left the chart. klinecharts
    clears its crosshair on mouseleave via setCrosshair(), which leaves
    _crosshair.paneId undefined, and setCrosshair only emits
    onCrosshairChange when that pane id is a string — so no event arrives and
    the panel kept displaying the last bar indefinitely. The hook now listens for
    mouseleave on the chart root (when getDom() is available), which restores
    the documented "null when the cursor is off-chart" contract.

Added

  • src/workspace/useChartSync.test.tsx (+11): crosshair mirroring goes
    pixel → timestamp → pixel (and never forwards y or the source pixel),
    no-op when the pixel maps to no bar, candle_pane fallback when the sibling
    lacks the source pane, per-channel disable, scroll mirroring of the
    right-edge timestamp (with a regression guard against the bar index),
    future-scroll clamping, and zoom mirroring.
  • src/hooks/useCrosshair.test.tsx (+8): the bar is resolved from the pixel
    (with correct change / changePercent), a supplied event.kLineData still
    wins, null when the pixel maps to no bar or to an index outside the loaded
    history, null when the crosshair has no x, the default candle_pane
    fallback, and clear-on-mouseleave plus listener teardown.

Fixed

  • useUndoRedo shared its history across instances. The undo/redo stacks
    were useState inside the hook, while the provider's recording slot and the
    hotkeys are single-slot (owned by the first mounted instance). Every other
    useUndoRedo() consumer therefore recorded nothing, permanently reported
    canUndo === false, and popped an empty stack on undo(). The stacks now
    live in a provider-owned store (createUndoRedoStore) that every instance
    reads with useSyncExternalStore, so all of them see — and undo — the same
    history. The Ctrl+Z / Ctrl+Y / Ctrl+Shift+Z listener also moved to the
    provider: one window listener per chart instead of one per instance (N-1 of
    which bailed out immediately), still driving only the owning instance.
  • ChartCanvas dropped the persisted indicator state on bootstrap. It
    re-created the saved main/sub indicators from state.mainIndicators /
    state.subIndicators only, ignoring state.indicatorAxes and
    state.indicatorVisibility. After a reload an indicator bound to a secondary
    Y-axis silently fell back to the pane default, and a hidden one came back
    visible while the provider (and every checkbox) still claimed it was hidden.
    Both maps are now applied through IndicatorCreate (yAxisId, visible).
  • useLayoutManager.loadLayout kept the SAVED pane id. Sub-indicator panes
    are minted per chart instance, so the restored subIndicators map pointed at
    pane ids that no longer existed — breaking collapse, reorder, axis overrides
    and removal for every restored sub indicator. The id is now read back from
    getIndicators({ id }) after creation (like addSubIndicator), and sub
    indicators are created without a paneId so klinecharts cannot resurrect a
    stale pane or merge two indicators into one.
  • Layout auto-save missed drawing-only edits. The 5s debounce re-armed only
    when mainIndicators / subIndicators changed, so adding, moving or
    clearing drawings — which have no provider state and no klinecharts change
    event — never scheduled a save, while an untouched chart still got an
    "Auto-save" entry 5s after enabling. Auto-save is now a 5s sweep that
    serializes the chart and writes only when the persisted content actually
    differs from the last write.
  • isSubIndicatorCollapsed never re-rendered. It read a useRef set, so a
    UI rendering a collapse/expand button from it showed the pre-click state
    forever, and the height saved before collapsing was lost whenever the hook
    remounted (expand fell back to 100px). Collapsed panes now live in provider
    state (collapsedPanes: paneId → height before collapse), cleared by
    SET_CHART since pane ids are per-instance.
  • useKlinechartsUISettings state was per-instance. Two components calling
    the hook got independent copies, each writing the whole slice to the same
    storage key, so a change in one panel was invisible to (and eventually
    overwritten by) the other. Settings now live in a provider-owned store.
    Two related defects went with it: the "apply initial settings" effect was
    guarded by a one-shot ref, so a REPLACED chart instance never got the axis
    settings / lastValueMark re-applied — it is now keyed on the chart identity
    and applies every style-backed setting (buildStyles) — and the
    onSettingsChange callback was in the effect's dep array, so an inline
    consumer callback fired on every render (it is now read through a ref and
    fires on real changes only).
  • setDrawingVisible / setDrawingLocked could hit a foreign overlay.
    Unlike removeDrawing, they called overrideOverlay({ id, … }) without
    groupId: "drawing_tools", so an id collision with an order/alert line
    toggled that one instead.
  • Annotations and order lines vanished on chart remount. An annotation
    added before the chart was ready (or after a remount) existed only in state
    with no overlay, and order lines kept ids pointing at overlays the new chart
    instance did not have (so updateOrderLine silently no-oped). Both hooks now
    reconcile their tracked entries onto every new chart instance, mirroring the
    provider's alert-line reconciliation.
  • Alert / annotation ids could collide with hydrated ones. The module
    counters (alert_1, annotation_1) restarted at 1 on every page load, so a
    fresh entry could reuse the id of one restored from storage — duplicate React
    keys and two overlays sharing an id. Ids now carry a per-load session tag.
  • useCompare assigned duplicate colors. The palette index came from
    symbols.length, so after removing a symbol the next one reused a color
    still in use. It now picks the first palette color nobody uses yet.
  • Replay playback was O(n²) over a session. Every step (timer tick,
    stepForward, stepBackward, seekTo) called chart.resetData() with the
    whole slice, so a 5 000-bar replay at 10 bars/s performed 5 000 reloads of an
    ever-growing array. Steps are now grouped: the interval advances
    ceil(speed / 6) bars per tick at a proportionally longer period, keeping the
    same wall-clock pace with at most 6 reloads per second
    (MAX_RELOADS_PER_SECOND, exported for tuning). Opt-in useReplay({ maxBars })
    additionally caps the buffered window for pathological histories.
  • The undo/redo stack survived a chart / symbol / period change. Entries
    reference overlay ids that no longer exist after a reload, so undo() either
    did nothing or removed a same-id overlay of the new symbol. The provider now
    clears the history when the chart instance, symbol or period changes.
  • Redo of a drawing recreated it unlocked and visible. Only name /
    points / styles were stored, so lock, visible and mode were lost on
    every undo → redo cycle. The payloads in useDrawingTools (draw end,
    remove-all snapshot) and the redo re-snapshot in useUndoRedo now carry all
    three.
  • Two useDrawingTools timers leaked. The initial queueMicrotask
    snapshot still ran after unmount (set...
Read more

v2.1.0

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 02 Sep 22:48

Integration-DX release prompted by third-party integration feedback.

Added

  • ChartCanvas forwards a ref to the klinecharts Chart instance — <ChartCanvas ref={chartRef} /> works like <KLineChart ref={…} /> upstream: populated on ready, reset to null on unmount.
  • ChartCanvas accepts a style prop, forwarded straight to the chart container <div> (same passthrough as className). style={{ height: 500 }} is the one-liner fix for the collapsed-height-chain failure.
  • Dev-only zero-height warning in ChartCanvas — if the container still has zero height ~1.5s after mount (and is not deliberately hidden), a console warning explains the three ways to give it a height and points at the README "Chart sizing" section. Stripped from production builds.
  • README "Chart sizing" section — no default size, three ways to set a height, height: 100% / min-height: 0 pitfalls in flex/grid/dock layouts, late-sizing recovery note. Installation now shows a single command including react-klinecharts.

Changed

  • react-klinecharts is now a required peer dependency (the peerDependenciesMeta.optional marker is removed). The ./chart entry statically imports it, and the optional marker let consumers install without it and only discover the break as a bundler error. npm 7+ and pnpm auto-install required peers; the peer range (>=1.0.0) is unchanged.
  • Datafeed.searchSymbols is optional. Consumed by exactly one call site (useSymbolSearch), which now resolves to an empty result list when the method is absent. Docs updated.

Typecheck, lint, the full test suite (220 tests), and the build pass.

v2.0.4

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 31 Aug 23:11

Patch release backing the klinecharts upstream patches (10.0.1 → 10.0.3),
a full-codebase audit with 19 bug fixes followed by a hardening pass (13
risk-class fixes and 8 optimizations) and a self-review of that pass (9
further fixes), plus one small overlay-behaviour improvement that opts into a
new upstream option. Typecheck, lint, the full test suite (215 tests), and
the build pass. Backwards compatible (additive type exports only; see
Added).

Changed

  • klinecharts ^10.0.1 → ^10.0.3 (dev dependency). Diffing the published
    .d.ts between 10.0.1 and 10.0.3 shows zero removed symbols and exactly
    one added field: Overlay.fixedZLevel (optional in OverlayTemplate /
    OverlayCreate); all symbols the library imports are preserved. No
    react-klinecharts bump is required — 1.0.1 depends on
    klinecharts ^10.0.1, which already resolves to 10.0.3, so the dependency
    tree keeps a single klinecharts copy. The peer ranges
    (klinecharts >=10.0.0, react-klinecharts >=1.0.0) are unchanged.

  • depthOverlay now declares fixedZLevel: true. klinecharts 10.0.3 added
    the fixedZLevel overlay option, which keeps an overlay at its configured
    zLevel while hovered instead of temporarily raising it above every other
    overlay. The depth overlay deliberately renders at zLevel: -1 (behind the
    candle series); fixedZLevel: true makes that placement sticky, so hovering
    can no longer lift the liquidity bars over the candles. On klinecharts
    < 10.0.3 the property is unknown to the runtime and ignored, so behaviour
    there is unchanged.

Fixed

A full-codebase audit (provider, hooks, overlays, indicators, data pipeline)
landed 19 fixes, each as a separate commit:

  • gannFan overlay was impossible to draw. totalStep counts points + 1,
    so totalStep: 2 finished the drawing after a single click; with
    p2 === p1 all nine ratio lines degenerated into one horizontal line.
    Now totalStep: 3.
  • elliottWave never collected its 6th point (totalStep: 6 → 5 points),
    leaving the (5) label branch unreachable. Now totalStep: 7, matching
    fiveWaves.
  • parallelogram vertex dragging was a silent no-op. The perform handlers
    assigned to a nonexistent point.price field (klinecharts points carry
    value), which also leaked an undefined price key into persisted overlay
    JSON. They now assign .value.
  • Alert crossings could fire spuriously after a symbol/period change. The
    reset effect cleared a ref that was never read; the poller's real per-alert
    baseline (prevValueByAlert Map) survived the change, so the new symbol's
    first close was compared against the old symbol's last one. The poller now
    reseeds on symbol/period change and the dead ref is removed.
  • Persisted alerts were never redrawn after a reload or chart remount. The
    list hydrated into state and the poller kept working, but no alertLine
    overlays existed and removeAlert silently no-oped. The provider recreates
    the overlays whenever the chart instance appears.
  • loadLayout destroyed alert lines and order lines — a bare
    removeOverlay() matches every overlay — and saveLayout serialized them
    as plain drawings, recreating them without id/groupId/lock (breaking the
    alert line↔state pairing and duplicating them on every save). Layouts now
    own only the drawing_tools group, restored drawings get the group id so
    useDrawingTools can manage them, and subsystem overlays
    (alertLine/orderLine/depthOverlay/simpleAnnotation) captured by
    pre-2.0.4 layouts are skipped on restore instead of resurrecting as ghost
    drawings.
  • updateIndicatorParams updated every same-named indicator (e.g.
    main_MA and sub_MA simultaneously) because it overrode by name only. It
    now derives the canonical id from the pane.
  • Starting a replay leaked the live bar subscription. The replay flag
    flips before resetData(), whose unsubscribe was swallowed by the loader's
    replay gate — live ticks streamed into the chart on top of the replayed
    prefix for the whole session, and a mid-replay symbol change leaked the old
    symbol's channel. unsubscribeBar now always reaches the datafeed.
  • A stale rejected data request could wipe the chart. The data loader's
    catch path ignored the stale-generation guard: a late init rejection emptied
    the freshly loaded chart, and a late forward rejection permanently disabled
    forward pagination until the next resetData.
  • useCompare.addSymbol raced itself. The duplicate guard was checked
    before the data fetch but written after it: a double-call registered two
    indicators, and a removal issued mid-flight was undone when the fetch
    resolved. A pending set now holds the slot for the whole flight.
  • Compare projections went stale on symbol/period change. The base prices
    and timestamp map are baked into the registered calc closure, so the old
    anchor's scale was drawn over the new symbol (or the line silently became
    nulls). Comparisons are now cleared on the change; re-adding re-anchors.
  • Script-editor indicators collided across provider instances. The
    template used one global registry name, so running a script on chart B
    recomputed chart A's indicator with B's code. The name is now salted per
    hook instance (same pattern as useCompare).
  • resetToDefaults desynced the indicator last-value toggle.
    setStyles(theme) restored klinecharts' built-in lastValueMark.show: false while the settings state kept true; the library default is now
    re-applied after the theme reset.
  • Symbol-search results resurrected after select/clear. Only setQuery
    cancelled the pending debounce/fetch; selectSymbol and clearResults now
    share the same cancel helper.
  • Global Ctrl+Z / Ctrl+Y hijacked text inputs. The undo/redo keydown
    handler preventDefault'd regardless of target, killing native text undo
    in the symbol search, layout rename and script editor. Inputs, textareas
    and contentEditable elements are now skipped.
  • Replay could not be restarted after finishing naturally (isReplaying
    stayed true, and startReplay bailed on it). The double-start guard now
    only blocks while unplayed bars remain.
  • Redo of overlays_removed could wipe every overlay on the chart. A
    failed restore (createOverlay returns null for an unregistered template)
    put an undefined id into the redo payload, and removeOverlay({ id: undefined }) matches all overlays. The redo payload now only contains
    successfully restored overlays, and redo skips entries without a string id.
  • Undoing an indicator removal restored it with library defaults. The
    payload now snapshots calcParams/styles/visible before removal, and
    the re-add paths apply them (hidden state is mirrored into the visibility
    map).
  • Ichimoku Chikou span was shifted 2× offset away from TradingView. The
    1.0.0 "look-ahead bias" fix read close[i - offset] (price line delayed,
    extending to the last bar); the canonical lagging span displays
    close[i + offset] at bar i and ends offset bars before the last bar —
    the displaced plot is the definition, and nothing unknown is shown at the
    right edge. The indicator and its test now assert TradingView parity.

Added

  • ReplayDataLoaderContext is now exported from the package root.
    createDataLoader was already public, but its options interface was not, so
    consumers building custom loaders could not type the replay refs. Purely
    additive.
  • New layouts storage namespace. useLayoutManager now persists layouts
    through the provider storage adapter (see the layouts bullet under
    Hardening), which required a namespace declaration in the storage
    contract. Apps that don't configure storage keep the previous direct
    localStorage keys, so existing saved layouts survive the upgrade.

Hardening

The audit's risk findings — states that were not outright bugs yet but could
corrupt data or destabilize the UI under real-world conditions — each as a
separate commit:

  • The data loader can no longer wedge the pipeline or misreport loading.
    Three related defects. (1) A forward request arriving before any data
    (oldestTimestamp === null) fell through without calling the callback, and
    klinecharts clears its _loading latch only inside the callback — one such
    request permanently blocked all future loads; a terminal callback now always
    answers. (2) The loading flag was a boolean, so with an init and a forward
    request in flight concurrently, whichever finished first flipped the UI to
    "loaded"; an in-flight counter drives the flag now. (3) The stale-generation
    guard was per-loader-instance: swapping the datafeed prop builds a new
    loader with its own counter, and an in-flight request from the old loader
    could still deliver old-feed bars onto the freshly reset chart. The
    generation counter is now a ref shared by every loader instance of one chart
    (passed from ChartCanvas; deliberately not module-global, so workspace
    charts never cross-invalidate each other).
  • RSI now seeds Wilder smoothing canonically. TA.rsi fed the running
    average a fake leading 0 change, so the seed averaged
    (0, chg₁ … chg_{p−1}) instead of the first period changes: values began
    one bar early and carried a decaying seed bias on every series with mixed
    moves. The first RSI value now lands on bar period with the canonical
    Wilder seed (hand-computed test included; RSI_TV inherits the fix).
  • Indicator move/reorder keeps the axis binding and visibility.
    moveToMain / moveToSub / reorderSubIndicator recreated the indicator
    without yAxisId or visible and never migrated the tracking maps: a bound
    indicator silently landed on the default axis while indicatorAxes kept
    pointing at the dead id, and a hidden indicator moved between panes
    resurrected visible while...
Read more

v2.0.3

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 31 Jul 22:16

Patch (dependency maintenance) release. No source code or public API changes — backs the klinecharts upstream patch (10.0.0 → 10.0.1) and the matching react-klinecharts wrapper (1.0.0 → 1.0.1). Typecheck, lint, the full test suite, the library build, and the examples/docs builds all pass against the bumped versions. Backwards compatible.

Changed

  • klinecharts ^10.0.0 → ^10.0.1 (dev dependency). 10.0.1 is a strictly additive patch on the public type surface — diffing the published .d.ts shows zero removed symbols and exactly one added type (IndicatorFigureStyleBase); all symbols the library imports (utils, registerFigure, registerIndicator, registerOverlay, and the OverlayTemplate / *Attrs / DeepPartial<Options> types) are preserved.

  • react-klinecharts 1.0.0 → 1.0.1 (dev dependency, and the same pin in the docs / examples workspace packages). 1.0.1 is itself a one-line release that raises its klinecharts dependency from ^10.0.0 to ^10.0.1. Bumping it here eliminates the duplicate klinecharts copy the dependency tree previously held: with 1.0.0 the tree resolved to klinecharts@10.0.1 (direct) and klinecharts@10.0.0 (transitive via react-klinecharts); with 1.0.1 both resolve to a single klinecharts@10.0.1. The react-klinecharts peer range (>=1.0.0) is unchanged.

Notable upstream behaviour in klinecharts 10.0.1 (picked up automatically)

These ship in klinecharts and apply through the chart instance — no library change is required to benefit:

  • Fixed a miscalculation in the built-in PVT indicator (the library exposes PVT as UI metadata over the built-in indicator, so the fix applies transparently).
  • Fixed rgbToHex using the red channel value when converting the green/blue channels, and regex errors in hsla validation and transparent-color detection.
  • Optimised Canvas rendering scheduling, resizing, and device-pixel-ratio handling; smoother/more consistent mobile inertial scrolling and touch handling that no longer drives page scroll or browser navigation gestures while dragging.

Full changelog: https://github.com/NemeZZiZZ/react-klinecharts-ui/blob/main/CHANGELOG.md

v2.0.2

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 14 Jul 21:54

Patch release with a bug fix for the multi-symbol comparison overlay. No new features; no public API changes (the hook's exported types and method signatures are unchanged). Backwards compatible.

Fixed

  • Comparison overlay no longer collapses the chart. useCompare drew each compared symbol as a line of raw percentages ({ pct }, e.g. ±5) stacked on the candle pane, whose Y-axis is in price units (e.g. ~60000). klinecharts v10 folds indicator figure values into the pane's auto Y-axis range (YAxisImp.createRangeImp), so a small-range series blended with the candle price range and flattened the candles. The indicator now projects each compare close onto the main symbol's price scale relative to a shared anchor bar (the first candle where both symbols have a quote):

    value = mainBase * (compareClose / compareBase)
    

    The drawn value lives in the main price domain and shares the candle Y-axis, so the line overlays the candles without rescaling them. The real percentage change is no longer drawn — it is surfaced in the indicator tooltip via a new createTooltipDataSource (e.g. ETHUSDT %: +10.00%). The indicator template now declares series: "price" so klinecharts syncs its precision to the main symbol's pricePrecision, matching the built-in MA / AVP indicators. Placement on the candle pane (paneId: "candle_pane", isStack: true) was already correct and is unchanged.

v2.0.1

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 14 Jul 17:08

Patch release with bug fixes. No new features; no runtime breakage for consumers using the library's UI helpers (compareRules / setCompareRule(cr.key)).

Fixed

  • CompareRule value corrected from "prev_close" to "previous_close". klinecharts 10.0.0 defines CandleColorCompareRule = "current_open" | "previous_close", so the previous "prev_close" literal was an invalid enum value that klinecharts silently ignored — selecting the "previous close" comparison rule did nothing. Consumers using compareRules / setCompareRule(cr.key) are unaffected; if you held the literal "prev_close" in your code, update it to "previous_close" (it never worked at runtime anyway).

  • Stale datafeed / onSettingsChange in the dispatch context. The context value memoized these through refs that were never re-read, so when a consumer swapped the datafeed prop at runtime (e.g. switching to an authenticated feed after login), useCompare, useSymbolSearch, useWatchlist, ChartCanvas, and useKlinechartsUISettings's onSettingsChange kept operating on the original value. Both props are now included in the memo dependency array. Note: if you pass an inline datafeed object or arrow-function onSettingsChange on every render, wrap them in useMemo / useCallback to avoid re-rendering context consumers each render.

  • CI: prefer-const lint error in useChartAxes.test.ts (let all → const all).

Full Changelog: v2.0.0...v2.0.1

v2.0.0 — Breaking: migrate to klinecharts 10.0.0 stable + react-klinecharts 1.0.0

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 11 Jul 01:59

Breaking Changes

Targets klinecharts ^10.0.0 (up from beta3) and react-klinecharts ^1.0.0 (up from 0.3.0). The klinecharts v10 stable release changed the createIndicator instance API and removed the imperative data API the replay hook relied on. Because this library exposes the raw Chart instance on its store (state.chart), those upstream changes are breaking for the public surface.

Migration Guide (1.x → 2.0.0)

  1. Update peer dependencies. Bump klinecharts to >=10.0.0 and react-klinecharts to >=1.0.0:

    npm install klinecharts@^10.0.0 react-klinecharts@^1.0.0
  2. createIndicator signature changed (klinecharts 10.0.0). The 2nd-argument options object { isStack, pane, yAxis } was removed; the 2nd argument is now a plain isStack: boolean, and paneId / yAxisId are properties of the IndicatorCreate value itself:

    -chart.createIndicator(
    -  { name, id: `main_${name}` },
    -  { isStack: true, pane: { id: "candle_pane" }, yAxis },
    -);
    +chart.createIndicator(
    +  { name, id: `main_${name}`, paneId: "candle_pane", yAxisId: yAxis?.id },
    +  true,
    +);
  3. createIndicator now returns the indicator id, not the pane id. Read the pane id back via chart.getIndicators({ id })[0].paneId (the canonical v10 pattern). The library's own hooks already do this internally.

  4. Removed v9 imperative data API. applyNewData, updateData, setPriceVolumePrecision no longer exist on the klinecharts Chart. Data flows through the DataLoader; precision is set via chart.setSymbol({ pricePrecision, volumePrecision }).

  5. Replay was rewritten (useReplay). It now drives the chart through a replay-aware intercept inside createDataLoader + chart.resetData(). The hook's public return type is unchanged.

Added

  • Multi-YAxis management API on useChartAxes — createYAxis(override), removeYAxis(filter), getYAxes(filter?) wrapping klinecharts 10.0.0 multi-YAxis support. New types YAxisFilter and YAxis re-exported from the package entry.

Changed

  • KlinechartsUIDispatchValue gained a replayActiveRef: RefObject<boolean> for synchronous replay-mode toggling (additive).
  • createDataLoader gained an optional 3rd argument replay?: ReplayDataLoaderContext wiring the replay-aware intercept. Omitting it yields the previous (non-replay) behaviour.

Tests

189 passing (+11). MockChart rewritten for v10 (resetData, createYAxis / removeYAxis / getYAxes, realistic createIndicator / getIndicators bookkeeping, live __data getter).

Full notes: see CHANGELOG.md → ## 2.0.0.

npm: react-klinecharts-ui@2.0.0

v1.2.0 — Per-drawing API + reactive overlays

Choose a tag to compare

@NemeZZiZZ NemeZZiZZ released this 09 Jul 16:57

What's New

  • Per-drawing API + reactive overlays (useDrawingTools) — individual drawing state management with reactive overlay tracking

npm: react-klinecharts-ui@1.2.0