Skip to main content

Crate gpui_liveplot

Crate gpui_liveplot 

Source
Expand description

gpui_liveplot is a high-performance plotting library built for GPUI.

§Overview

  • Designed for append-only, high-throughput telemetry and sensor streams.
  • Plot-level axes with shared transforms across all series.
  • Viewport-aware decimation keeps rendering near O(width) for smooth interaction.
  • Interactive pan, zoom, box zoom, hover readout, and pin annotations via GPUI.

§Feature flags

  • None at the moment.

§Quick start

use gpui_liveplot::{LineStyle, Plot, Series, SeriesKind, Theme};

let mut plot = Plot::builder().theme(Theme::dark()).build();
let series = Series::from_iter_y(
    "sensor",
    (0..1000).map(|i| (i as f64 * 0.01).sin()),
    SeriesKind::Line(LineStyle::default()),
);
plot.add_series(&series);
plot.refresh_viewport(0.05, 1e-6);

§GPUI integration

Use gpui_backend::GpuiPlotView to render and interact with a plot inside a GPUI window. See the examples/ directory for complete runnable examples.

Re-exports§

pub use axis::AxisConfig;
pub use axis::AxisConfigBuilder;
pub use axis::AxisFormatter;
pub use axis::TickConfig;
pub use datasource::AppendError;
pub use geom::Point;
pub use interaction::Pin;
pub use plot::Plot;
pub use plot::PlotBuilder;
pub use render::Color;
pub use render::LineStyle;
pub use render::MarkerShape;
pub use render::MarkerStyle;
pub use series::Series;
pub use series::SeriesId;
pub use series::SeriesKind;
pub use style::Theme;
pub use view::Range;
pub use view::View;
pub use view::Viewport;
pub use gpui_backend::GpuiPlotView;
pub use gpui_backend::LinkMemberId;
pub use gpui_backend::PlotHandle;
pub use gpui_backend::PlotLinkGroup;
pub use gpui_backend::PlotLinkOptions;
pub use gpui_backend::PlotViewConfig;

Modules§

axis
Axis configuration, scaling, and formatting.
datasource
Data sources and append-only storage.
geom
Geometric primitives used by the plotting pipeline.
gpui_backend
GPUI integration for gpui_liveplot.
interaction
Interaction helpers for panning, zooming, and pin selection.
plot
Plot widget entry points and builders.
render
Rendering primitives and clipping helpers.
series
Data series configuration and storage.
style
Style and theming configuration.
transform
Coordinate transforms between data and screen space.
view
View models and data ranges.