Getting Started
Charts
- Charts
- Line Chart
- Bar Chart
- Area Chart
- Scatter Chart
- Pie Chart
- Donut Chart
- Dot Plot Chart
- Lollipop Chart
- Dumbbell Chart
- Slope Chart
- Range Chart
- Histogram Chart
- Box Plot Chart
- Violin Chart
- Polar Chart
- Parallel Coordinates
- SPLOM Chart
- Parcats Chart
- Candlestick Chart
- OHLC Chart
- Waterfall Chart
- Funnel Chart
- Heatmap Chart
- Contour Chart
- Density Chart
- Ternary Chart
- Radar Chart
- Treemap Chart
- Sunburst Chart
- Sankey Chart
- Gauge Chart
- Bullet Chart
- Icicle Chart
- Network Graph
- Dendrogram
- Choropleth Chart
"use client"
import { Dendrogram } from "@/components/ui/charts/specialized/dendrogram"
const taxonomyData = {
name: "Life",
children: [
{
name: "Animals",
children: [
{
name: "Mammals",
children: [
{ name: "Dog", value: 85 },
{ name: "Cat", value: 72 },
{ name: "Whale", value: 95 },
],
},
{
name: "Birds",
children: [
{ name: "Eagle", value: 68 },
{ name: "Penguin", value: 62 },
],
},
],
},
{
name: "Plants",
children: [
{
name: "Trees",
children: [
{ name: "Oak", value: 120 },
{ name: "Pine", value: 95 },
],
},
{
name: "Flowers",
children: [
{ name: "Rose", value: 45 },
{ name: "Tulip", value: 38 },
],
},
],
},
],
}
export function DendrogramDemo() {
return (
<div className="mx-auto w-full max-w-2xl">
<Dendrogram
data={taxonomyData}
orientation="horizontal"
showLabels
showValues
/>
</div>
)
}
About
A Dendrogram is a tree diagram showing hierarchical relationships. It's commonly used for displaying taxonomies, organizational structures, and hierarchical clustering results. Nodes are positioned using cluster layout to evenly distribute leaf nodes.
Installation
pnpm dlx shadcn@latest add https://ui.simplifying.ai/r/dendrogram.json
Usage
import { Dendrogram } from "@/components/ui/charts"
const data = {
name: "Root",
children: [
{
name: "Branch A",
children: [
{ name: "Leaf 1", value: 10 },
{ name: "Leaf 2", value: 15 },
],
},
{ name: "Leaf 3", value: 20 },
],
}
export function Example() {
return <Dendrogram data={data} />
}Variants
Vertical Orientation
Display the tree from top to bottom.
"use client"
import { Dendrogram } from "@/components/ui/charts/specialized/dendrogram"
const orgData = {
name: "CEO",
children: [
{
name: "CTO",
children: [
{ name: "Engineering Lead", value: 8 },
{ name: "DevOps Lead", value: 4 },
{ name: "QA Lead", value: 5 },
],
},
{
name: "CFO",
children: [
{ name: "Accounting", value: 3 },
{ name: "Finance", value: 4 },
],
},
{
name: "CMO",
children: [
{ name: "Marketing", value: 6 },
{ name: "Sales", value: 12 },
],
},
],
}
export function DendrogramVertical() {
return (
<div className="mx-auto w-full max-w-xl">
<Dendrogram
data={orgData}
orientation="vertical"
showLabels
showValues
colorScheme={["#0891b2", "#06b6d4", "#22d3ee", "#67e8f9", "#a5f3fc"]}
/>
</div>
)
}
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| data | DendrogramNode | required | Root node of the tree |
| orientation | "horizontal" | "vertical" | "horizontal" | Tree orientation |
| nodeRadius | number | 5 | Node circle radius |
| showLabels | boolean | true | Show node labels |
| showValues | boolean | false | Show node values |
| linkColor | string | "#94a3b8" | Color for connecting lines |
| colorScheme | string[] | blue palette | Colors by depth level |
Notes
- The dendrogram uses D3's cluster layout algorithm to evenly distribute leaf nodes
- Node colors are automatically assigned based on tree depth level
- Horizontal orientation is recommended for taxonomies with long labels
- Vertical orientation works well for organizational charts
- Each node can optionally have a
valueproperty that can be displayed whenshowValuesis enabled
Deploy and Scale Agents with Simplifying AI
Simplifying AI delivers the infrastructure and developer experience you need to ship reliable audio & agent applications at scale.
Talk to an expert