#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct Figure {
#[builder(default, list(item(type = super::Trace)))]
#[serde(rename = "data", skip_serializing_if = "Vec::is_empty", default)]
data: Vec<super::Trace>,
#[builder(custom(type = super::Layout, convert = Box::new))]
#[serde(rename = "layout")]
layout: Box<super::Layout>,
#[builder(into)]
#[serde(rename = "plotlyConfig")]
plotly_config: String,
}
impl Figure {
#[inline]
pub fn new(layout: super::Layout, plotly_config: impl Into<String>) -> Self {
Self::builder().layout(layout).plotly_config(plotly_config).build()
}
#[inline]
pub fn data(&self) -> &[super::Trace] {
&*self.data
}
#[inline]
pub fn layout(&self) -> &super::Layout {
&*self.layout
}
#[inline]
pub fn plotly_config(&self) -> &str {
&*self.plotly_config
}
}