Menu

Organisation charts and trees

A hierarchy is cards and the arrows from each parent to its children. With join="trunk", the arrows of one parent share a trunk and branch out, the way organisation charts are drawn.

{"skemo":1,"name":"org-chart.skemo","source":"//- An organisation chart: shared trunks from each manager\ndiagram(dir=\"down\")\n\n card#ceo.lead(icon=\"crown\") Camille Martin\n | Chief executive\n to(cto cfo cpo join=\"trunk\")\n\n card#cto.manager Alex Moreau\n | Engineering\n to(platform apps join=\"trunk\")\n card#cfo.manager Robin Petit\n | Finance\n card#cpo.manager Sam Leroy\n | Product\n to(design research join=\"trunk\")\n\n card#platform.team Platform team\n | 8 people\n card#apps.team Apps team\n | 12 people\n card#design.team Design\n | 4 people\n card#research.team User research\n | 2 people\n","css":[{"name":"org-chart.css","content":".lead { --c: #7048E8; --label: \"Executive\"; }\n.manager { --c: #3E6FC4; --label: \"Manager\"; }\n.team { --c: #2F9E44; --label: \"Team\"; }\n"}],"theme":"light"}EXECUTIVECamille MartinChief executiveMANAGERAlex MoreauEngineeringMANAGERRobin PetitFinanceMANAGERSam LeroyProductTEAMPlatform team8 peopleTEAMApps team12 peopleTEAMDesign4 peopleTEAMUser research2 people
{"skemo":1,"name":"org-chart.skemo","source":"//- An organisation chart: shared trunks from each manager\ndiagram(dir=\"down\")\n\n card#ceo.lead(icon=\"crown\") Camille Martin\n | Chief executive\n to(cto cfo cpo join=\"trunk\")\n\n card#cto.manager Alex Moreau\n | Engineering\n to(platform apps join=\"trunk\")\n card#cfo.manager Robin Petit\n | Finance\n card#cpo.manager Sam Leroy\n | Product\n to(design research join=\"trunk\")\n\n card#platform.team Platform team\n | 8 people\n card#apps.team Apps team\n | 12 people\n card#design.team Design\n | 4 people\n card#research.team User research\n | 2 people\n","css":[{"name":"org-chart.css","content":".lead { --c: #7048E8; --label: \"Executive\"; }\n.manager { --c: #3E6FC4; --label: \"Manager\"; }\n.team { --c: #2F9E44; --label: \"Team\"; }\n"}],"theme":"dark"}EXECUTIVECamille MartinChief executiveMANAGERAlex MoreauEngineeringMANAGERRobin PetitFinanceMANAGERSam LeroyProductTEAMPlatform team8 peopleTEAMApps team12 peopleTEAMDesign4 peopleTEAMUser research2 people
org-chart.skemo
//- An organisation chart: shared trunks from each manager
diagram(dir="down")

  card#ceo.lead(icon="crown") Camille Martin
    | Chief executive
    to(cto cfo cpo join="trunk")

  card#cto.manager Alex Moreau
    | Engineering
    to(platform apps join="trunk")
  card#cfo.manager Robin Petit
    | Finance
  card#cpo.manager Sam Leroy
    | Product
    to(design research join="trunk")

  card#platform.team Platform team
    | 8 people
  card#apps.team Apps team
    | 12 people
  card#design.team Design
    | 4 people
  card#research.team User research
    | 2 people
org-chart.css
.lead { --c: #7048E8; --label: "Executive"; }
.manager { --c: #3E6FC4; --label: "Manager"; }
.team { --c: #2F9E44; --label: "Team"; }

How it is written

  • diagram(dir="down"): the root on top, each level one row lower.
  • to(cto cfo cpo join="trunk") under the root draws one trunk to its three reports. Each report still has its own arrow, so it can have its own style or animation marker.
  • Children keep the order you wrote them in. A parent is centred over its children.
  • A type per level (.lead, .manager, .team) colours the levels and writes their category above the name.

Name your types after what they mean (.manager, .team). A few class names belong to the drawing itself and would style a part of every card: avoid .head, .title and .line as types.

Other trees

The same writing draws any hierarchy: a product breakdown, a decision tree, a file layout. Without join, plain arrows from one card to several cards of the next row also fork:

{"skemo":1,"name":"trunk.skemo","source":"diagram(dir=\"down\")\n card#ceo CEO\n to(cto cfo coo join=\"trunk\")\n card#cto CTO\n card#cfo CFO\n card#coo COO\n","theme":"light"}CEOCTOCFOCOO
{"skemo":1,"name":"trunk.skemo","source":"diagram(dir=\"down\")\n card#ceo CEO\n to(cto cfo coo join=\"trunk\")\n card#cto CTO\n card#cfo CFO\n card#coo COO\n","theme":"dark"}CEOCTOCFOCOO
trunk.skemo
diagram(dir="down")
  card#ceo CEO
    to(cto cfo coo join="trunk")
  card#cto CTO
  card#cfo CFO
  card#coo COO

For a tree that grows from a central idea in both directions, use a mind map.

See also