Klar

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