US-5.11 Hierarchical legend with group toggle in drill-down
As a user who drills down into a category with many subcategories I want the legend to group subcategories hierarchically (e.g. all `groceries:*` entries under a "groceries" header) and let me toggle an entire group with a double-click while still toggling individual items with a single click so that I can quickly hide or show groups of related subcategories without clicking each one individually.

Acceptance Criteria

  • Subcategory bars are grouped by their first hierarchy segment (e.g. `groceries:lidl` and `groceries:jumbo` share group `groceries`).
  • A group header is only shown when the group contains at least 2 children.
  • Single-click toggles one trace; double-click toggles the entire group.
  • Lines (totals, averages, cumulative) appear in a separate legend on the left; subcategories appear on the right.
  • Totals and Averages are each a group on the left legend with their own group toggle.
  • Categories at the same tree level are sorted together so the legend reads as a coherent hierarchy, not interleaved alphabetically.
No DAG diagram: UI presentation feature on the Plotly chart layer; no data-flow change.
Demo video coming soon

DAG Diagram