You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe treemaps could deserve to be supported natively as a new type instead of having to precompute the rectangles and add them as shapes.
One reason is that using shapes prevents us from directly using a colorscale on another trace attribute (since the shapes' fillcolor attribute only accepts a color value).
There are three possible visual forms that are in principle treemap-like, but whose intent and natural input format differ:
Hierarchical part-of-whole represented as nested rectangles, with various algorithmic approaches, like optimizing for square aspect, or slice-and-dice etc
Let's focus strictly on number 1 in this case, assuming that this is a trace-with-its-own-domain like sunburst and that it does not have cartesian axes.
Within that, there are a bunch of dimensions to explore, requirements-wise (these may overlap a lot, naturally):
Color: there are many charts in the wild, especially financial ones, that use continuous color on treemaps (e.g. https://finviz.com/map.ashx)
'headers' for the rectangles that show the names of the containing ones. Note: this messes with the strict area calculations a little bit! (e.g. https://finviz.com/map.ashx) ... some implementations put the containing header in the top-left and the contained name in the bottom-right for example http://bl.ocks.org/ganeshv/6a8e9ada3ab7f2d88022
Independently of headers, we might want to allow nesting borders or padding around the boxes and that messes with the math a bit also in terms of layout. I don't think we should do the "cushion gradient" effect that some implementations use. Here's an example of 'padding' https://observablehq.com/@d3/nested-treemap
Mouseover behaviour to show hierarchy (i.e. adding borders to all containing rectangles on hover)
Click to zoom in... double-click to zoom out? If there are 'headers' then you could click on the header to zoom out, similar to the way you click on the center of the sunburst to zoom out
tweening when zooming in and out, keeping in mind that the aspect ratio will change while zooming
text/hover info/templates, to show the percentage of whole, percentage of parent, name etc
Click to zoom in... double-click to zoom out? If there are 'headers' then you could click on the ...
Implementing double-click may not be a good idea noting that on some device e.g. iPad the hover event is triggered by single click and the click event is triggered by double click.
Activity
rodrigomurta commentedon Nov 3, 2017
It would be nice to have support to R too. Now treemaps are restricted to Python and Matlab.
jackparmer commentedon Mar 13, 2019
(Related: #2221)
nicolaskruchten commentedon Jul 4, 2019
There are three possible visual forms that are in principle treemap-like, but whose intent and natural input format differ:
parcoordsone (see https://www.perceptualedge.com/articles/visual_business_intelligence/are_mosaic_plots_worthwhile.pdf for commentary)Let's focus strictly on number 1 in this case, assuming that this is a trace-with-its-own-domain like
sunburstand that it does not have cartesian axes.Within that, there are a bunch of dimensions to explore, requirements-wise (these may overlap a lot, naturally):
There's lots of d3 prior art here... https://www.d3indepth.com/layouts/
Other implementations:
[-]Native support for treemap chart types[/-][+]Treemap trace[/+]archmoj commentedon Aug 21, 2019
Implementing double-click may not be a good idea noting that on some device e.g. iPad the hover event is triggered by single click and the click event is triggered by double click.
archmoj commentedon Aug 30, 2019
Is it useful to display node's current/full path on hover?
nicolaskruchten commentedon Sep 4, 2019
Would be useful to have as an option in
hovertemplateyes! By default I would say no.