altair
altair copied to clipboard
Treemap / Mosaic Chart Example
Following on from #204: This kind of visualization is useful to have, and since altair is now using a more recent vega-lite it should be possible to produce this now - but i'm not sure how to do it myself yet
treemap is not supported by vega-lite still, but this Vega-Lite Example: https://vega.github.io/vega-lite/examples/rect_mosaic_labelled_with_offset.html should be, and is close enough.
Any pointers on how to do this myself also appreciated - only started reading into altair internals.
Are there any news on this issue? It would be awesome if Altair could replicate vega-lite's mosaic charts.
It would certainly be possible, but there is not really any easy way to create mosaic charts in Vega-lite, so the Altair version would be just as complicated as the Vega-lite version with all its nested encodings and transforms. I don’t know of anyone who has attempted it yet.
The attempt has made and is available in this file: https://github.com/altair-viz/altair/blob/master/altair/examples/mosaic_with_labels.py
Warning: it's not an entry level chart, one of the more complicated Altair examples I'm aware of.