Skip to main content

plot

Function plot 

Source
pub fn plot(spec: PlotSpec) -> El
Expand description

A 2D plot: line/scatter data over auto-scaled, pannable/zoomable axes.

Backed by crate::plot::PlotSpec — a fluent builder of marks + axis scales — and resolved (in draw_ops) to an orthographic DrawOp::Scene3D data layer plus themed axis/grid/crosshair chrome (see docs/PLOT2D_PLAN.md). Fills its area like chart3d; give it a .key(...) so its pan/zoom crate::plot::PlotView persists across rebuilds and can be read back for the virtual-data pull.

use damascene_core::prelude::*;
use damascene_core::plot::{PlotSpec, Scale};

let spec = PlotSpec::new().x(Scale::time()).line(&cpu).line(&mem);
let _ = plot(spec).key("metrics");