use crate::scene::{Circle, Element, Line, Rect, Text, TextAnchor};
pub(crate) fn rect(
(x, y, width, height): (f64, f64, f64, f64),
class: &'static str,
tooltip: Option<String>,
) -> Element {
Element::Rect(Rect {
x,
y,
width,
height,
class,
series_index: None,
style_index: None,
tooltip,
})
}
pub(crate) fn line((x1, y1): (f64, f64), (x2, y2): (f64, f64), class: &'static str) -> Element {
Element::Line(Line {
x1,
y1,
x2,
y2,
class,
})
}
pub(crate) fn text(
(x, y): (f64, f64),
anchor: TextAnchor,
class: &'static str,
content: impl Into<String>,
) -> Element {
Element::Text(Text {
x,
y,
class,
anchor,
content: content.into(),
})
}
pub(crate) fn circle(
(cx, cy, radius): (f64, f64, f64),
class: &'static str,
tooltip: Option<String>,
) -> Element {
Element::Circle(Circle {
cx,
cy,
radius,
class,
series_index: None,
style_index: None,
tooltip,
})
}