Bundle The SDL2 backend of System.Plot: it draws the same PlotScene the SVG writer does, to a window you can zoom, pan and hover, or to a PNG file. Compile with -lib plot_sdl,plot,sdl2,gen_collect. Saving a PNG needs no window and no display; a window needs one. Not available in the web playground. Design: docs/PLOT_DESIGN.md.
PlotView
Zoom and pan state for a window, kept apart from SDL so it can be tested without one: how much one mouse-wheel notch zooms, and what a readout says.
Operations
Readout # function
The text a hover shows for a data position.
function : Readout(at:Float[]) ~ String
Parameters
| Name | Type | Description |
|---|
| at | Float | [x, y] as Axes->DataAt returns it |
Return
| Type | Description |
|---|
| String | for example "x = 2.5 y = 0.31" |
WheelFactor # function
The zoom factor of one mouse-wheel notch: 1.25 in, and the reciprocal out.
function : WheelFactor(notches:Int) ~ Float
Parameters
| Name | Type | Description |
|---|
| notches | Int | wheel movement, positive zooms in |
Return
| Type | Description |
|---|
| Float | the factor to hand to Axes->Zoom |