Charts / React BI charts / Hierarchy
Decomposition tree
A KPI’s total broken down one dimension per column, expanding the member you click, with shares, connectors back to the parent, a breadcrumb and an AI split that picks the dimension for you.
React component DecompositionTree, data through props. Trees and nesting: treemaps, call stacks, clusters. Tags: decomposition, drill-down, tree, root-cause, power-bi, breakdown, kpi.
Install
npm i klar-charts
import 'klar-charts/styles.css'
import { ThemeScope, DecompositionTree } from 'klar-charts'
# or copy the source:
npx shadcn@latest add https://klar.run/r/bi-decomposition-tree.json
Usage
<DecompositionTree
key={mode}
rows={revenueFacts}
measure="revenue"
measureLabel="Revenue"
dimensions={revenueDims}
path={revenuePath}
expandBy={mode as 'next' | 'ai-high' | 'ai-low'}
format={(v) => `€${(v / 1e6).toFixed(v >= 1e7 ? 1 : 2)}M`}
height={500}
/>
Related decomposition tree charts
- Market treemap: Every stock in an index as a tile sized by market cap and coloured by its daily move, grouped into sectors with their weighted change.
- Bullet graphs: Each KPI against its target, its prior period and poor / satisfactory / good bands in one compact row, so a whole scorecard reads at a…
- Bump chart: Rank positions over eight quarters as smooth lanes, so you can follow who climbed, who slipped and when the order changed.
- Calendar heatmap: Every day of the year as a cell coloured by volume, with monthly totals beneath, so weekly rhythm, seasonality and one-off incidents all…
- Slope chart: Each line’s value in two years joined by a slope, coloured by direction against the median, so risers and fallers separate instantly.
- Dumbbell chart: Two values per row joined by a bar that shows the direction and size of the change, grouped with segment averages, for plan vs actual or…