feat: add Axis::None for hidden dimensions with implicit aggregation
Categories on the None axis are excluded from the grid and cell keys. When evaluating cells, values across hidden dimensions are aggregated using a per-measure function (default SUM). Adds evaluate_aggregated to Model, none_cats to GridLayout, and 'n' shortcut in TileSelect. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -291,7 +291,7 @@ impl<'a> GridWidget<'a> {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let value = self.model.evaluate(&key);
|
||||
let value = self.model.evaluate_aggregated(&key, &layout.none_cats);
|
||||
|
||||
let cell_str = format_value(value.as_ref(), fmt_comma, fmt_decimals);
|
||||
let is_selected = ri == sel_row && ci == sel_col;
|
||||
@ -378,7 +378,7 @@ impl<'a> GridWidget<'a> {
|
||||
}
|
||||
let total: f64 = (0..layout.row_count())
|
||||
.filter_map(|ri| layout.cell_key(ri, ci))
|
||||
.map(|key| self.model.evaluate_f64(&key))
|
||||
.map(|key| self.model.evaluate_aggregated_f64(&key, &layout.none_cats))
|
||||
.sum();
|
||||
let total_str = format_f64(total, fmt_comma, fmt_decimals);
|
||||
buf.set_string(
|
||||
|
||||
Reference in New Issue
Block a user