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>,
rx: Option<f64>,
ry: Option<f64>,
class: String,
data: Option<ElementData>,
animation_origin: Option<(f64, f64)>,
},
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>,
animation_origin: Option<(f64, f64)>,
},
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 {Show 14 fields
x: f64,
y: f64,
content: String,
anchor: TextAnchor,
dominant_baseline: Option<String>,
transform: Option<Transform>,
font_family: Option<String>,
font_size: Option<String>,
font_weight: Option<String>,
letter_spacing: Option<String>,
text_transform: 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
rx: Option<f64>Corner radius on the x axis. When None, no rx attribute is
emitted (preserving byte-identical output for un-themed charts).
Wired from Theme::bar_corner_radius in Phase 5 — bars emit
Some(v) when bar_corner_radius is Uniform(v) with v > 0.0,
else None. Top-only rounding is emitted as a Path instead of
a Rect (see BarCornerRadius::Top).
data: Option<ElementData>animation_origin: Option<(f64, f64)>CSS transform-origin anchor for entrance animations, in the
element’s own coordinate space (absolute SVG coords). Populated
by bar emission sites in chartml-chart-cartesian/src/bar.rs so
the renderer never has to guess orientation/sign. None for
every non-bar Rect — the renderer falls back to its legacy
behavior, preserving byte-identical SVG output for all
pre-existing baselines (see backward_compat_goldens_byte_identical).
Path
Fields
data: Option<ElementData>animation_origin: Option<(f64, f64)>See ChartElement::Rect::animation_origin. Populated by
build_bar_element for top-rounded bars (BarCornerRadius::Top),
which are emitted as Path instead of Rect because SVG <rect>
can’t round only two corners. None for every other Path.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more