Skip to content

FerroChart 0.5.0

Choose a tag to compare

@0x0077 0x0077 released this 24 Nov 07:36
· 1 commit to main since this release

Markers that carry your data, clustering across bars, bar quality flags
and touch screens.

Added

  • Marker ids. Markers take an id (u64; in JavaScript an integer up
    to 2^53−1) that click and hover events report. In JavaScript the events
    also hand back the very object passed to setMarkers as marker, with
    any fields of your own.
  • Markers at a price. A third position, atPrice (Rust
    MarkerPosition::AtPrice, Python "at_price", C
    FERROCHART_MARKER_AT_PRICE), centers a marker on its price, for fills
    and other events at an exact price. These markers are not stacked or
    clustered.
  • Clustering across bars. A per-series markerCluster (CSS px; Python
    marker_cluster): when bars get closer than that, each side of a bucket
    of bars shows its first marker and a "+k" badge. Buckets are aligned to
    the logical index, so panning does not regroup. Click and hover events
    for a badge report the bars it stands for (bars: { from, to }).
  • Bar quality flags. setBarFlags([{ time, filled?, clipped? }]) (Rust
    Chart::set_bar_flags, Python set_bar_flags, C
    ferrochart_set_bar_flags). filled: a bar the data source filled in
    without trades, drawn hollow in filledBarColor. clipped: a bar whose
    outlier wick you clipped (keep the raw values for your tooltip); a tick
    marks each end of the wick. The flags survive level-of-detail merging.
  • The lightweight-charts compatibility layer maps v5 atPriceTop,
    atPriceMiddle and atPriceBottom to atPrice and passes numeric ids.
  • Examples: a meme token's reality layer (filled and clipped bars,
    clustered wallet avatars, wallet cards from the clicked marker) and an LP
    risk canvas (range, hedge liquidation, events at their price).
  • Touch screens. On phones, tablets and touch laptops: two fingers zoom
    and pan, a long press (500 ms) shows the crosshair, which stays after the
    finger lifts until the next tap, and drawings, handles and markers are
    easier to hit with a finger. A double tap is a double click. Plots zoom
    and pan with two fingers and show the hovered element under the finger.
  • touchScroll creation option in JavaScript ('chart', the default,
    or 'page') and setTouchScroll: with 'page' a vertical swipe scrolls
    the page, so charts inside articles no longer trap scrolling.
  • Desktop windows (winit, Python) now handle touch input.

Changed

  • Breaking for Rust struct literals and matches (hence 0.5.0): new fields
    in Marker (id, price), SeriesOptions (marker_cluster,
    filled_bar_color), MarkerHit (id, bars), ClickTarget::Marker
    (id) and ClickTarget::MarkerOverflow (id, bars); a new
    MarkerPosition::AtPrice.
  • C: FerroChartMarker, FerroChartSeriesOptions and FerroChartEvent
    have new fields, so programs built against 0.4 must be recompiled with
    the new header. The JavaScript and Python APIs only add.
  • Breaking for Rust code that builds input events: PointerDown,
    PointerMove and PointerUp have a kind: PointerKind field (Mouse,
    Touch, Pen), and there is a new InputEvent::PointerCancel. In C,
    FerroChartInput gains pointer_kind at the end (programs built with the
    shorter struct keep working as mouse input) and
    FERROCHART_INPUT_POINTER_CANCEL.
  • In the browser a cancelled pointer (the page took the gesture over) no
    longer counts as a click.

Fixed

  • Real-time updates of sparse line series (#1).
    On a line, area or baseline series with points on only some bars,
    update_last now moves the interpolated points before the last one
    with it, as set_data of the same points would. It returns
    DataChange::Replace in that case, since more than the last value
    changed. Histograms keep their gaps.
  • Gann fan labels that would overlap near the origin are not drawn.
  • Plot: the left and right axes are wide enough for their rule labels.
  • Jupyter: the operations recorded for a live chart stay bounded, so
    views opened later load quickly.

Packages