DocsChartsHierarchy
FlameGraphChart
React example follows below.
ts
import { FlameGraphChart } from "@grassroot/charts-react"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],}; <FlameGraphChart root={hierarchy} />ts
<script setup lang="ts">import { FlameGraphChart } from "@grassroot/charts-vue"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],};</script> <template> <FlameGraphChart :root='hierarchy' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootFlameGraphChart } from "@grassroot/charts-angular"; @Component({ selector: "app-flame-graph-chart-chart-demo", standalone: true, imports: [GrassrootFlameGraphChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-flame-graph-chart [root]='hierarchy' />`,})export class FlameGraphChartDemoComponent { readonly hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ], };} export default FlameGraphChartDemoComponent;ts
<script lang="ts"> import { FlameGraphChart } from "@grassroot/charts-svelte"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ], };</script> <FlameGraphChart root={hierarchy} />ts
/** @jsxImportSource solid-js */import { FlameGraphChart } from "@grassroot/charts-solid"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],}; export default function FlameGraphChartDemo() { return <FlameGraphChart root={hierarchy} />;}Installation
bash
pnpm dlx grassroot add chart/flame-graph-chartbash
npx grassroot@latest add chart/flame-graph-chartbash
yarn dlx grassroot add chart/flame-graph-chartbash
bunx grassroot add chart/flame-graph-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
rootrequired | HierarchyDatum | — |