Expand description
Desktop host for FerroChart on winit + wgpu.
showopens a window with the defaults and shows a chart until it is closed.runopens a window with a wgpu surface and drives the chart: winit events becomeInputEvents, frames are built and rendered only whenChart::needs_redrawsays so (which includes kinetic scrolling), chart events are handed to yourChartApp, andChartApp::updatecan ask to be woken at a given time (e.g. for a real-time feed).InputConverteris the event conversion on its own, for hosts that own the event loop themselves (an egui app, a custom window).
All times passed to the chart (InputEvent::time_ms, build_frame) come
from one monotonic clock: milliseconds since run started.
§Examples
use ferrochart_core::{Chart, ChartOptions};
use ferrochart_winit::{ChartApp, WindowOptions, run};
struct App;
impl ChartApp for App {}
run(WindowOptions::default(), Chart::new(ChartOptions::default()), App)?;Re-exports§
Structs§
- Input
Converter - Converts winit window events into
InputEvents. Keeps the state winit does not put on each event: modifiers, the pointer position, and the last press (to synthesizeInputEvent::DoubleClick). - Window
Options - Window settings for
run.
Enums§
Traits§
Functions§
- cursor_
icon - The winit cursor for a chart cursor.
- run
- Opens a window showing
chartand runs until it is closed. - show
- Opens a window with the default options and shows
chartuntil the window is closed:runwithWindowOptions::defaultand no callbacks.