pub enum ChartElement {
Svg {
viewbox: ViewBox,
width: Option<f64>,
height: Option<f64>,
class: String,
children: Vec<ChartElement>,
},
Group {
class: String,
transform: Option<Transform>,
children: Vec<ChartElement>,
},
Rect {
x: f64,
y: f64,
width: f64,
height: f64,
fill: String,
stroke: Option<String>,
class: String,
data: Option<ElementData>,
},
Path {
d: String,
fill: Option<String>,
stroke: Option<String>,
stroke_width: Option<f64>,
stroke_dasharray: Option<String>,
opacity: Option<f64>,
class: String,
data: Option<ElementData>,
},
Circle {
cx: f64,
cy: f64,
r: f64,
fill: String,
stroke: Option<String>,
class: String,
data: Option<ElementData>,
},
Line {
x1: f64,
y1: f64,
x2: f64,
y2: f64,
stroke: String,
stroke_width: Option<f64>,
stroke_dasharray: Option<String>,
class: String,
},
Text {
x: f64,
y: f64,
content: String,
anchor: TextAnchor,
dominant_baseline: Option<String>,
transform: Option<Transform>,
font_size: Option<String>,
font_weight: Option<String>,
fill: Option<String>,
class: String,
data: Option<ElementData>,
},
Div {
class: String,
style: HashMap<String, String>,
children: Vec<ChartElement>,
},
Span {
class: String,
style: HashMap<String, String>,
content: String,
},
}Expand description
The output of any ChartRenderer. Framework adapters walk this tree and produce framework-specific DOM/view output.
Variants§
Svg
Fields
§
children: Vec<ChartElement>Group
Rect
Fields
§
data: Option<ElementData>Path
Fields
§
data: Option<ElementData>Circle
Fields
§
data: Option<ElementData>Line
Fields
Text
Div
Non-SVG container (e.g., metric card uses div-based layout)
Span
Raw text node (for metric values, labels in div-based charts)
Trait Implementations§
Source§impl Clone for ChartElement
impl Clone for ChartElement
Source§fn clone(&self) -> ChartElement
fn clone(&self) -> ChartElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChartElement
impl Debug for ChartElement
Source§impl<'de> Deserialize<'de> for ChartElement
impl<'de> Deserialize<'de> for ChartElement
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
Auto Trait Implementations§
impl Freeze for ChartElement
impl RefUnwindSafe for ChartElement
impl Send for ChartElement
impl Sync for ChartElement
impl Unpin for ChartElement
impl UnsafeUnpin for ChartElement
impl UnwindSafe for ChartElement
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