# Indented tree

> Use an indented tree to show a hierarchy as an outline people can scan and open, with a value bar on every row.

- Data type: Groups within groups (`hierarchy`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`hierarchy`)
- Example: **Two in five mammal species are rodents, and more than one in five is a bat** (6,791 living mammal species by order and family; bars count species)
- How to read it: Each row is an order of mammals with its species count; click an order to open its families, indented beneath it.
- Interactive: expand
- Phone: Adapts to mobile (Draws its own phone layout below 520px) · Video formats: none passed; closest 9:16

## Use it when
- a hierarchy with long names that people read like a list
- every node has a value worth comparing
- readers open one branch at a time

## Avoid it when
- the overall shape matters more than the names (use a treemap or sunburst)
- only one level (use sorted bars)
- a very deep tree (the indents run off the page)

## Fields (data.json)
- `name` (category): an order or a family
- `value` (number, unit "species", format count): a family's number of living species
- `children` (id): an order's families

Units are the example's: with your own data, set each number field's `unit` and `format` (percent, count, decimal, currency, compact) in the meta you pass to mount, or `chartreuse render --unit field=text --format field=count`. Scales and labels follow your data.

## Interactions, motion, sound
- click an order to open or close its families
- hover or tap a row to read its count and share
- Motion: Bars grow from the left on arrival; opening an order slides its families out from under it.
- Sound: A pop on hover. Quiet while it draws and between steps; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "indented-tree",
  "title": "Two in five mammal species are rodents, and more than one in five is a bat",
  "subtitle": "6,791 living mammal species by order and family; bars count species",
  "data": "/charts/indented-tree.data.json"
}
```

## Source
Mammal Diversity Database (mdd.csv), American Society of Mammalogists, Mammal Diversity Database (CC BY 4.0), retrieved 2026-12-01: https://www.mammaldiversity.org/

Note: Living species only. In this taxonomy whales and dolphins sit inside Artiodactyla, with hippos and other even-toed hoofed mammals. Common names for orders are added for reading.

Live: /charts/indented-tree · Manifest: /charts/indented-tree.json · Tags: indented tree, outline, collapsible, hierarchy, animals, mammals, biodiversity
