1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Data model for Mermaid `pie` charts.
//!
//! `pie` is the simplest of Mermaid's diagram types: an optional title, an
//! optional `showData` flag, and a list of labelled positive numeric slices.
//! In the web Mermaid renderer these become a circular pie chart with
//! coloured slices; in this crate they render as a horizontal bar chart
//! (much more legible in monospace text — see [`crate::render::pie`]).
/// One slice of a [`PieChart`]. The label is the user-supplied display
/// string (everything between the first pair of double-quotes on a data
/// line) and `value` is its numeric weight (`f64` to support decimal
/// inputs like `"X" : 12.5`).
/// A parsed `pie` chart.
///
/// Constructed by [`crate::parser::pie::parse`] and consumed by
/// [`crate::render::pie::render`]. `title` is the text after `pie title …`
/// (or `None` when omitted). `show_data` mirrors Mermaid's `showData`
/// keyword — when `true` the renderer includes the raw value next to
/// the percentage.