Collapse Badges
Collapsed nodes show how many nodes are hidden below (+N).
Open the chart without page chrome ↗Drawing width at least 1,000 px. Scroll within the chart on smaller screens.
const options = {
chart: {
height: 360,
toolbar: {
show: false
},
type: "tree"
},
series: [
{
data: [
{
id: "p26",
name: "Kira Lund",
title: "Chief Executive",
children: [
{
id: "p9",
name: "Maya Grieve",
title: "VP Engineering",
children: [
{
id: "p4",
name: "Yara Quist",
title: "Platform lead",
children: [
{
id: "p1",
name: "Ava Holm",
title: "Site reliability",
children: undefined
},
{
id: "p2",
name: "Zane Quist",
title: "Infrastructure",
children: undefined
},
{
id: "p3",
name: "Vik Thorne",
title: "Developer tools",
children: undefined
}
]
},
{
id: "p8",
name: "Elif Oakes",
title: "Product engineering",
children: [
{
id: "p5",
name: "Vik Grieve",
title: "Web",
children: undefined
},
{
id: "p6",
name: "Sana Faro",
title: "Mobile",
children: undefined
},
{
id: "p7",
name: "Ben Ivers",
title: "API",
children: undefined
}
]
}
]
},
{
id: "p15",
name: "Ben Oakes",
title: "VP Product",
children: [
{
id: "p12",
name: "Dev Castell",
title: "Design lead",
children: [
{
id: "p10",
name: "Sana Oakes",
title: "Research",
children: undefined
},
{
id: "p11",
name: "Cleo Dorsey",
title: "Visual design",
children: undefined
}
]
},
{
id: "p13",
name: "Rafa Marlow",
title: "PM, Billing",
children: undefined
},
{
id: "p14",
name: "Tomas Quist",
title: "PM, Growth",
children: undefined
}
]
},
{
id: "p22",
name: "Pia Rook",
title: "VP Sales",
children: [
{
id: "p18",
name: "Elif Jarl",
title: "EMEA",
children: [
{
id: "p16",
name: "Iris Faro",
title: "Account exec.",
children: undefined
},
{
id: "p17",
name: "Tomas Sorel",
title: "Account exec.",
children: undefined
}
]
},
{
id: "p20",
name: "Pia Thorne",
title: "Americas",
children: [
{
id: "p19",
name: "Yara Arden",
title: "Account exec.",
children: undefined
}
]
},
{
id: "p21",
name: "Dev Faro",
title: "APAC",
children: undefined
}
]
},
{
id: "p25",
name: "Elif Rook",
title: "CFO",
children: [
{
id: "p23",
name: "Rafa Thorne",
title: "Controller",
children: undefined
},
{
id: "p24",
name: "Wren Faro",
title: "FP&A",
children: undefined
}
]
}
]
}
]
}
],
plotOptions: {
tree: {
collapse: {
initialDepth: 1
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'
WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
const options = {
chart: {
height: 360,
toolbar: {
show: false
},
type: "tree"
},
series: [
{
data: [
{
id: "p26",
name: "Kira Lund",
title: "Chief Executive",
children: [
{
id: "p9",
name: "Maya Grieve",
title: "VP Engineering",
children: [
{
id: "p4",
name: "Yara Quist",
title: "Platform lead",
children: [
{
id: "p1",
name: "Ava Holm",
title: "Site reliability",
children: undefined
},
{
id: "p2",
name: "Zane Quist",
title: "Infrastructure",
children: undefined
},
{
id: "p3",
name: "Vik Thorne",
title: "Developer tools",
children: undefined
}
]
},
{
id: "p8",
name: "Elif Oakes",
title: "Product engineering",
children: [
{
id: "p5",
name: "Vik Grieve",
title: "Web",
children: undefined
},
{
id: "p6",
name: "Sana Faro",
title: "Mobile",
children: undefined
},
{
id: "p7",
name: "Ben Ivers",
title: "API",
children: undefined
}
]
}
]
},
{
id: "p15",
name: "Ben Oakes",
title: "VP Product",
children: [
{
id: "p12",
name: "Dev Castell",
title: "Design lead",
children: [
{
id: "p10",
name: "Sana Oakes",
title: "Research",
children: undefined
},
{
id: "p11",
name: "Cleo Dorsey",
title: "Visual design",
children: undefined
}
]
},
{
id: "p13",
name: "Rafa Marlow",
title: "PM, Billing",
children: undefined
},
{
id: "p14",
name: "Tomas Quist",
title: "PM, Growth",
children: undefined
}
]
},
{
id: "p22",
name: "Pia Rook",
title: "VP Sales",
children: [
{
id: "p18",
name: "Elif Jarl",
title: "EMEA",
children: [
{
id: "p16",
name: "Iris Faro",
title: "Account exec.",
children: undefined
},
{
id: "p17",
name: "Tomas Sorel",
title: "Account exec.",
children: undefined
}
]
},
{
id: "p20",
name: "Pia Thorne",
title: "Americas",
children: [
{
id: "p19",
name: "Yara Arden",
title: "Account exec.",
children: undefined
}
]
},
{
id: "p21",
name: "Dev Faro",
title: "APAC",
children: undefined
}
]
},
{
id: "p25",
name: "Elif Rook",
title: "CFO",
children: [
{
id: "p23",
name: "Rafa Thorne",
title: "Controller",
children: undefined
},
{
id: "p24",
name: "Wren Faro",
title: "FP&A",
children: undefined
}
]
}
]
}
]
}
],
plotOptions: {
tree: {
collapse: {
initialDepth: 1
}
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export tree-collapse-badges.json --out tree-collapse-badges.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/tree/collapse-badges/index.md … This example uses Premium modules. Compare licences · Embedding in a distributed product?