nominal_api/conjure/objects/scout/chartdefinition/api/
figure.rs1#[derive(
3 Debug,
4 Clone,
5 conjure_object::serde::Serialize,
6 conjure_object::serde::Deserialize,
7 PartialEq,
8 Eq,
9 PartialOrd,
10 Ord,
11 Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct Figure {
17 #[builder(default, list(item(type = super::Trace)))]
18 #[serde(rename = "data", skip_serializing_if = "Vec::is_empty", default)]
19 data: Vec<super::Trace>,
20 #[builder(custom(type = super::Layout, convert = Box::new))]
21 #[serde(rename = "layout")]
22 layout: Box<super::Layout>,
23 #[builder(into)]
24 #[serde(rename = "plotlyConfig")]
25 plotly_config: String,
26}
27impl Figure {
28 #[inline]
30 pub fn new(layout: super::Layout, plotly_config: impl Into<String>) -> Self {
31 Self::builder().layout(layout).plotly_config(plotly_config).build()
32 }
33 #[inline]
34 pub fn data(&self) -> &[super::Trace] {
35 &*self.data
36 }
37 #[inline]
38 pub fn layout(&self) -> &super::Layout {
39 &*self.layout
40 }
41 #[inline]
44 pub fn plotly_config(&self) -> &str {
45 &*self.plotly_config
46 }
47}