fava icon indicating copy to clipboard operation
fava copied to clipboard

Limit depth of treemap account hierarchy

Open asciipip opened this issue 5 years ago • 2 comments

It would be nice to limit the maximum depth of the accounts shown in the treemap view. At the moment, it just shows all leaf accounts.

More concretely, consider this treemap:

example treemap

The lefthand side has four boxes all named "VIRSX", representing the four accounts:

  • Assets:Retirement:Broker-1:Employer-1:PreTax:VIRSX
  • Assets:Retirement:Broker-1:Employer-1:Match:VIRSX
  • Assets:Retirement:Broker-1:Employer-2:PreTax:VIRSX
  • Assets:Retirement:Broker-1:Employer-2:Match:VIRSX

The treemap would me more useful to me if the maximum-depth squares were aggregated at either the employer or broker depth (and aggregation at my asset classification depth, "Retirement", would be useful, too).

I'm not entirely sure how the UI would work best for this. A simplistic approach would be to have a drop-down menu simply choosing a maximum aggregation depth. (The default would be "0" for "infinite".) That only works if every part of the account hierarchy has roughly the same things at each level. A possible alternative would be to have some metadata attached to particular accounts saying, basically, "fava, aggregate at this account." That, of course, would make it more difficult to change the aggregation level dynamically. (In my example, I'd have to choose between always aggregating at either the broker or employer level.)

asciipip avatar Feb 20 '20 17:02 asciipip

We currently have the collapse-pattern fava-option that allows one to have accounts be collapsed in the account trees. I think that corresponds to a similar desire to have accounts aggregated at some level. So I think we could reuse the same option to determine whether to aggregate an account in the treemaps (and maybe also sunburst charts)

yagebu avatar Feb 27 '20 16:02 yagebu

A PR for this would be welcome :)

yagebu avatar May 26 '23 16:05 yagebu