The JSON-stat format allows providers to declare hierarchical relationships between categories in a dimension using the child property.
This visualization uses hierarchy.json, a sample JSON-stat file that contains the Australian Bureau of Statistics’ Consumer Price Index (CPI) Commodity Classification.
It shows how to build a tree structure with the JSON-stat Javascript Toolkit using a recursive function (the tree function). The new structure is then displayed as a collapsible tree in D3 using the same code in Mike Bostock’s block #4339083.
Click on the nodes to expand or collapse.