altair icon indicating copy to clipboard operation
altair copied to clipboard

Treemap / Mosaic Chart Example

Open igorbrigadir opened this issue 4 years ago • 2 comments

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.

igorbrigadir avatar Apr 13 '21 14:04 igorbrigadir

Are there any news on this issue? It would be awesome if Altair could replicate vega-lite's mosaic charts.

yogabonito avatar Jan 03 '22 22:01 yogabonito

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.

jakevdp avatar Jan 04 '22 00:01 jakevdp

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.

mattijn avatar Nov 17 '22 22:11 mattijn