Repository navigation
Releases
FerroChart 0.6.0
Charts in app style: hidden axes and grid, padding, interaction switches,
a crosshair with a dot, themes as objects that change at run time, pools of
many small charts sharing one GPU device, and image export.
Added
-
Appearance. The price axis, the time axis and the grid lines can be
hidden, and the plot area can have padding:ChartOptions.appearance,
Chart::set_appearance,Appearance::sparkline()(no axes, no grid,
2 CSS px of padding). -
Interaction switches.
ChartOptions.interaction/
Chart::set_interactionturn panning, zooming and the crosshair off one
by one (InteractionOptions::none()for all three). Input a switched-off
gesture would take is reported as not consumed, so the page can scroll;
clicks are still reported. -
Crosshair style.
ChartOptions.crosshair_style/
Chart::set_crosshair_style: the vertical line, the horizontal line and
the axis labels each on or off, and an optional dot on the first series'
value (DotStyle, colored like the series at that value). -
Changing the theme.
Chart::set_themereplaces the theme of a chart
that already exists;Chart::themereads it. -
Shared GPU resources.
ferrochart_render_wgpu::SharedResources:
renderers on one device share pipelines and glyph atlases
(WgpuRenderer::offscreen_shared,with_surface_shared,
shared_resources), so many small charts do not each compile the shaders
and hold their own 8 MB of glyph textures. -
JavaScript look options.
FerroChart.createand the new
chart.applyOptionstakepriceAxis,timeAxis,grid,padding,
interaction,crosshairStyleandpreset: 'sparkline';themealso
takes an object of colors on abasetheme and can change after
creation.chart.options()reads them back. -
lightweight-charts compatibility: look options.
layoutcolors and
font size, grid visibility and color,rightPriceScale.visible,
timeScale.visible,handleScroll,handleScaleand the crosshair
lines'visible/labelVisiblenow map to FerroChart, increateChartand
inapplyOptions(layoutno longer has to be set at creation). -
Python look options.
Chart(theme=..., appearance=..., interaction=..., crosshair_style=..., preset="sparkline"),Chart.apply_options(**options)
andChart.options(): the JavaScript look options with snake_case keys;
themealso takes a dict of colors. They draw into_pngand windows and
reach the Jupyter widget. -
C look structs.
FerroChartTheme,FerroChartAppearance,
FerroChartInteractionandFerroChartCrosshairStyle, each with a setter
(ferrochart_set_theme, …) and a getter (ferrochart_theme, …);
ferrochart_theme_default(dark, out)fills a built-in theme to edit. -
Chart pools.
FerroChart.createPool({ renderer })returns a
ChartPoolwhosecreate(canvas, options)makes charts sharing one GPU
device: dozens of sparklines on a page no longer run into the browser's
WebGL context limit. Charts out of the viewport are not drawn.
Rust:ferrochart_render_wgpu::SharedSurfaceand
WgpuRenderer::for_shared_surface;GpuContextisClone. -
Snapshots.
chart.toImageBitmap()andchart.toBlob(type?, quality?)
(PNG, WebP or JPEG), also onFerroPlot.
Changed
- Python:
Chart(attribution_logo=...)defaults toNone: the Jupyter
logo follows the small-canvas rule of the JavaScript binding unless set. - The attribution logo is no longer shown by default on canvases smaller
than 320×160 CSS px (it follows the size);attributionLogo: trueor
setAttributionLogo(true)still shows it anywhere. - With panning or zooming switched off, the canvas'
touch-actionlets the
page take those gestures. - Breaking for Rust struct literals: new fields
appearance,
interactionandcrosshair_styleinChartOptions.
testing::quote_card_sceneis new.
Packages
- crates.io:
ferrochart-coreand the otherferrochart-*crates, 0.6.0 - npm:
@ferrochart/core@0.6.0 - PyPI: 0.6.0 wheels will follow once the Linux and Windows builds are ready;
ferrochart 0.4.0is the latest there.
FerroChart 0.5.0
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 tosetMarkersasmarker, 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 itsprice, 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, Pythonset_bar_flags, C
ferrochart_set_bar_flags).filled: a bar the data source filled in
without trades, drawn hollow infilledBarColor.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,
atPriceMiddleandatPriceBottomtoatPriceand 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. touchScrollcreation option in JavaScript ('chart', the default,
or'page') andsetTouchScroll: 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
inMarker(id,price),SeriesOptions(marker_cluster,
filled_bar_color),MarkerHit(id,bars),ClickTarget::Marker
(id) andClickTarget::MarkerOverflow(id,bars); a new
MarkerPosition::AtPrice. - C:
FerroChartMarker,FerroChartSeriesOptionsandFerroChartEvent
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,
PointerMoveandPointerUphave akind: PointerKindfield (Mouse,
Touch,Pen), and there is a newInputEvent::PointerCancel. In C,
FerroChartInputgainspointer_kindat 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_lastnow moves the interpolated points before the last one
with it, asset_dataof the same points would. It returns
DataChange::Replacein 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
- crates.io:
ferrochart-coreand the otherferrochart-*crates, 0.5.0 - npm:
@ferrochart/core@0.5.0 - PyPI: 0.5.0 wheels will follow once the Linux and Windows builds are ready;
ferrochart 0.4.0is the latest there.
FerroChart 0.4.0
Image markers, badges and text in any script.
Added
- Image markers. Markers take a
size(4–64 CSS px), anicon(an image
registered with the chart, clipped to a circle or square), alabel(up to
8 characters inside the shape, such asDB) and aborderring.
Chart::add_icon/remove_icon; JavaScriptregisterIcon(name, url | image | bitmap | ImageData | canvas)andunregisterIcon; Python
Chart.add_icon(array); Cferrochart_add_icon/ferrochart_remove_icon. - Folding. A per-series
markerStackLimit: crowded bars show the first
markers and a "+k" badge for the rest. Clicking the badge reports a
markerOverflowtarget. - Marker hover. A
markerHoverevent (RustChartEvent::MarkerHover,
Pythonmarker_hover, CFERROCHART_EVENT_MARKER_HOVER) with the marker or
badge under the pointer, its center and size, for tooltips. - Text in any script. Characters the bundled font lacks come from fallback
fonts (WindowOptions::fontsin winit,Chart(fonts=[...])in Python,
ferrochart_add_fontin C,TextEngine::add_fallback_fontin Rust), or on
the web from the browser's own fonts, including color emoji (feature
text-browser, on by default; no fonts are added to the package). A
character no font has is drawn as□. - Grapheme clusters. Text is laid out by grapheme cluster: on the web, an
emoji with a skin tone, a ZWJ sequence (families, professions), a flag or a
letter with a combining accent is drawn as one glyph. Rust:
TextEngine::glyphs, andGlyphSourceis called with a cluster (&str). - C ABI.
ferrochart_set_markerswithFerroChartMarker;
FerroChartSeriesOptions.marker_stack_limit. - Layer plugins'
iconcommand takes the sameimage,label,borderand
borderWidth. The lightweight-charts compatibility layer honors marker
size.
Changed
- Breaking for Rust struct literals (hence 0.4.0): new fields in
Marker,
SeriesOptions,IconInst,GlyphBitmap(rgba, for color glyphs) and
WindowOptions(fonts). The JavaScript, Python and C APIs only add.
Fixed
- A canvas hidden with
display: none(CSS size 0) no longer logs "invalid
render target size" on every change; the chart redraws when it is shown.
Known limitations
- No shaping or right-to-left layout: Arabic and Hebrew do not come out
right. Natively (without the browser), emoji sequences are drawn character
by character.
Packages
- crates.io:
ferrochart-coreand the otherferrochart-*crates, 0.4.0 - npm:
@ferrochart/core@0.4.0 - PyPI:
ferrochart 0.4.0(macOS, Linux, Windows wheels)