pub struct Render<C> {
pub aggregate: Aggregate,
pub width_hint: usize,
pub show_aggregate: bool,
pub abbreviate_breakdown: bool,
pub positive_marker: char,
pub negative_marker: char,
pub widget_config: C,
}Expand description
The general configuration for rendering a flat widget.
§Example
let config = Render {
aggregate: Aggregate::Average,
width_hint: 10,
show_aggregate: true,
abbreviate_breakdown: true,
positive_marker: '+',
negative_marker: '-',
widget_config: HistogramConfig::default(),
..Render::default()
};Fields§
§aggregate: AggregateThe function to apply when aggregating values in the widget.
Default: Aggregate::Sum.
width_hint: usizeThe hint to use to determine the width of the rendering.
Flat will try to make the rendering at most width_hint wide, with some exceptions:
- If the rendering can reasonably fit in a smaller width, the
width_hintis ignored. - If the rendering cannot reasonably fit the
width_hint, then it is minimally extended (such that a reasonable rendering may be produced).
Default: 160.
show_aggregate: boolWhether to show the aggregated result for the primary dimension of the dataset.
While the rendered data in flat uses a relative representation, this option extends the widget to show the absolute values of the data.
r#"
Show Aggregate | Rendering of Aggregate
aggregate([1, 2, 3, 4]) | aggregate([1, 2, 3, 4])"#In the case of a breakdown, this represents the aggregate applied to the breakdown aggregates.
r#"
Show Aggregate | Rendering of Aggregate of A | Rendering of Aggregate of B |
aggregate([aggregate([1, 2, 3]), aggregate([4])]) | aggregate([1, 2, 3]) | aggregate([4]) |"#Default: false.
abbreviate_breakdown: boolWhether to abbreviate the column headings (which come from dimensional values) in the breakdown or not.
Use this option when the breakdown dimensions have long std::fmt::Display forms.
Abbreviation is attempted irrespective of the width_hint.
Default: false.
positive_marker: charThe marker character for positive values of the rendering.
Default: '*'.
negative_marker: charThe marker character for negative values of the rendering.
Default: '⊖'.
widget_config: CThe widget specific rendering configuration.
Default: C::default().