{% import '_tree_table.html' as tree_table with context %}

<svelte-component type="charts"><script type="application/json">{{
  [
    chart_api.net_worth(),
    chart_api.hierarchy(ledger.options['name_assets']),
    chart_api.hierarchy(ledger.options['name_liabilities']),
    chart_api.hierarchy(ledger.options['name_equity']),
  ]|tojson
}}</script></svelte-component>

{% set root_tree_closed = g.filtered.root_tree_closed %}
{% set invert = ledger.fava_options.invert_income_liabilities_equity %}

<div class="row">
  <div class="column">
    {{ tree_table.tree(root_tree_closed.get(ledger.options['name_assets'])) }}
  </div>
  <div class="column">
    {{ tree_table.tree(root_tree_closed.get(ledger.options['name_liabilities']), invert=invert) }}
    {{ tree_table.tree(root_tree_closed.get(ledger.options['name_equity']), invert=invert) }}
  </div>
</div>
