I try to create a circle packing chart. My data is already in tree form. This is what I tried:
{
"width": 932,
"height": 932,
"data": {
"name": "tree",
"values": {
"name": "root",
"children" : [
{"name" : "leaf1", "value" : 100},
{"name" : "branch",
"children" : [
{"name" : "leaf2", "value" : 200},
{"name" : "leaf3", "value" : 300}
]}
]
},
"transform": [
{
"type": "pack",
"field": "value",
"size": [{"signal": "width"}, {"signal": "height"}]
}
]
},
"scales": [
{
"name": "color",
"type": "ordinal",
"domain": {"data": "tree", "field": "value"},
"range": {"data": "tree", "field": "value"}
}
]
}
Results in an Error [Error] w transform requires a backing tree data source.
Any pointers are appreciated.
Corresponding to the Vega documentation, the Pack Transform
therefore, I examined the stratify-test in the Vega repo and this is the generated data: