Per Node Size

Card size per node: node.size(node) by level (executive 260 × 84, VPs 220 × 68, teams 168 × 52) plus a data override (size: { width, height }) on the Platform lead; the layout keeps the cards apart by their own widths and aligns cards on their level line.

Chart type
Tree tree
Tier
Premium
Collection
Tree
Render
Live, site theme
View .md Agent setup
LIVE/tree/per-node-size13 of 37 in Tree

Configuration

Raw Standalone
const options = {
  chart: {
    height: 560,
    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
                    }
                  ],
                  size: {
                    width: 230,
                    height: 76
                  }
                },
                {
                  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: 2
      },
      node: {
        size: (d) => (d.title === 'Chief Executive' ? { width: 260, height: 84 } : /^(VP|CFO)/.test(d.title) ? { width: 220, height: 68 } : { width: 168, height: 52 })
      }
    }
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()

This example uses Premium modules. Compare licences · Embedding in a distributed product?