series: &BTreeMap<&str, Series>,
dims: &mut [Dim],
data: &mut HashMap<Vec<usize>, Value>,
+ footnotes: &pivot::Footnotes,
) {
let mut wheres = Vec::new();
let mut alternating = false;
self.major_ticks,
self.frame,
&look.areas[Area::Labels(axis)],
+ footnotes,
);
}
}
self.major_ticks,
self.frame,
&look.areas[Area::Data(RowParity::Even)],
+ footnotes
);
}
}
&series,
dims.as_mut_slice(),
&mut data,
+ &footnotes
);
}
}
None,
None,
&look.areas[Area::Data(RowParity::Even)],
+ &footnotes,
);
}
}
&& let Ok(index) = usize::try_from(index)
&& let Some(footnote) = footnotes.get(index)
{
- value = value.with_footnote(footnote);
+ value.add_footnote(footnote);
}
}
value
fg: Option<&Style>,
bg: Option<&Style>,
base_style: &AreaStyle,
+ footnotes: &pivot::Footnotes,
) {
if let Some(sf) = sf {
- let format = match &sf.child {
- Some(SetFormatChild::Format(format)) => Some(format.decode()),
- Some(SetFormatChild::NumberFormat(format)) => {
- Some(SignificantNumberFormat::from(format).decode())
- }
- Some(SetFormatChild::StringFormat(_)) => None,
- Some(SetFormatChild::DateTimeFormat(format)) => Some(format.decode()),
- Some(SetFormatChild::ElapsedTimeFormat(format)) => Some(format.decode()),
- None => None,
- };
- if let Some(format) = format
+ if let Some(child) = &sf.child
+ && let Some(format) = child.decode_format()
&& let Some(datum_value) = value.inner.as_datum_value_mut()
{
match &datum_value.datum {
}
}
}
+ if let Some(child) = &sf.child {
+ for affix in child.affixes() {
+ if let Some(index) = affix.defines_reference.checked_sub(1)
+ && let Ok(index) = usize::try_from(index)
+ && let Some(footnote) = footnotes.get(index)
+ {
+ value.add_footnote(footnote);
+ }
+ }
+ }
}
if fg.is_some() || bg.is_some() {
ElapsedTimeFormat(ElapsedTimeFormat),
}
+impl SetFormatChild {
+ fn decode_format(&self) -> Option<format::Format> {
+ match self {
+ SetFormatChild::Format(format) => Some(format.decode()),
+ SetFormatChild::NumberFormat(format) => {
+ Some(SignificantNumberFormat::from(format).decode())
+ }
+ SetFormatChild::StringFormat(_) => None,
+ SetFormatChild::DateTimeFormat(format) => Some(format.decode()),
+ SetFormatChild::ElapsedTimeFormat(format) => Some(format.decode()),
+ }
+ }
+ fn affixes(&self) -> &[Affix] {
+ match self {
+ SetFormatChild::Format(format) => &format.affixes,
+ SetFormatChild::NumberFormat(number_format) => &number_format.affixes,
+ SetFormatChild::StringFormat(string_formats) => {
+ string_formats.first().map_or(&[], |first| &first.affixes)
+ }
+ SetFormatChild::DateTimeFormat(date_time_format) => &date_time_format.affixes,
+ SetFormatChild::ElapsedTimeFormat(elapsed_time_format) => &elapsed_time_format.affixes,
+ }
+ }
+}
+
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
struct SetFrameStyle {