pub struct PlotSpec {
pub method: String,
pub kind: PlotKind,
pub series: Vec<PlotSeriesSpec>,
}Expand description
Backend-neutral plot request produced by plot() hooks.
Fields§
§method: String§kind: PlotKind§series: Vec<PlotSeriesSpec>Implementations§
Source§impl PlotSpec
impl PlotSpec
Sourcepub fn to_svg(&self) -> Result<String, FrameError>
pub fn to_svg(&self) -> Result<String, FrameError>
Render this spec to a deterministic SVG document (style floor: axes, ticks, gridlines, legend; see module docs). Fails closed on non-numeric series or all-missing data; never panics.
Sourcepub fn to_svg_bytes(&self) -> Result<Vec<u8>, FrameError>
pub fn to_svg_bytes(&self) -> Result<Vec<u8>, FrameError>
PlotSpec::to_svg as UTF-8 bytes (convenience for write/HTTP paths).
Sourcepub fn to_html(&self) -> Result<String, FrameError>
pub fn to_html(&self) -> Result<String, FrameError>
Wrap the deterministic SVG in an HTML figure container suitable for embedding into notebooks, dashboards, or web pages.
Sourcepub fn to_html_page(&self, title: Option<&str>) -> Result<String, FrameError>
pub fn to_html_page(&self, title: Option<&str>) -> Result<String, FrameError>
Render this spec to a complete, self-contained HTML5 page document.
Sourcepub fn to_markdown(&self) -> Result<String, FrameError>
pub fn to_markdown(&self) -> Result<String, FrameError>
Render this spec to Markdown-compatible HTML embedding.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlotSpec
impl<'de> Deserialize<'de> for PlotSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PlotSpec
Auto Trait Implementations§
impl !RefUnwindSafe for PlotSpec
impl !UnwindSafe for PlotSpec
impl Freeze for PlotSpec
impl Send for PlotSpec
impl Sync for PlotSpec
impl Unpin for PlotSpec
impl UnsafeUnpin for PlotSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more