Klar

Charts / React engineering charts / Hierarchy

Flame graph

A sampled call tree as nested bars sized by CPU time, so the hot paths through a service are obvious and one click zooms into any frame.

React component FlameGraph, data through props. Trees and nesting: treemaps, call stacks, clusters. Tags: flame-graph, profiler, call-stack, cpu, icicle, performance, zoom.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, FlameGraph } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/tech-flame-graph.json

Usage

<FlameGraph
  root={flameProfile}
  orientation={o}
  format={(v) => `${fmt.int(v)} · ${(v / 100).toFixed(2)} s`}
  ruler={(v) => `${(v / 100).toFixed(v % 100 ? 1 : 0)} s`}
/>

Related flame graph charts