class

Egui::Plot

Inherits Egui::Widget < Reference < Object

Constants

SERIES_COLORS = ->(v : Visuals, i : Int32) do palette = {v.selection_fill, v.hyperlink_color, Color32.rgb(200, 100, 30), Color32.rgb(120, 180, 60), Color32.rgb(180, 60, 160)} palette[i % palette.size] end

Constructors

new(id : String, height : Float64 = 200.0, animated : Bool = false, draggable : Bool = true, reset_button : Bool = true)
Source

Instance methods

animated(flag : Bool = true) : Plot

Live-plot mode: pan/zoom deviate from the default view, and a reset pill (or a double-click) returns to it.

Source
draggable(flag : Bool = true) : Plot

Read-only mode: keep the default view (no pan, no wheel zoom, no reset pill); the plot still repaints every frame when animated.

Source
fixed_bounds(min_x : Float64, min_y : Float64, max_x : Float64, max_y : Float64) : Plot

Pin the visible data rectangle instead of auto-fitting (used for live-scrolling plots). Ignored once the user pans or zooms — interaction takes over, exactly like with auto-fit.

Source
line(name : String, points : Array(Point), color : Color32 | Nil = nil) : Nil

color overrides the palette color for this series.

Source
points(name : String, points : Array(Point), color : Color32 | Nil = nil) : Nil
Source
reset_button(flag : Bool = true) : Plot

Show the reset pill once the view deviates from the default (default true). reset_button(false) hides it — then only a double-click (animated plots) can restore the default view.

Source
reset_label(text : String) : Plot

Custom text for the reset pill (default "Reset view").

Source
show(ui : Ui) : Response
Source
ui(ui : Ui) : Response

Widget entry point (ui.add / ui.plot); the series-collection block has already run by the time #show draws.

Source

Nested types