chartjs-chart-treemap
chartjs-chart-treemap copied to clipboard
FR: Support missing/partial groups in the data
Hi 👋
I'm using this library to visualize a coverage map for a project.
I'm mapping path folders to groups in order to have a hierarchical map, but folder nesting is not uniform, resulting in a weird result in the final map.
I've tried already to set thee missing group properties to ''
or undefined
but results were not as expected - lots of duplication.
It would be nice to natively support this kind of hierarchical grouping, or having a flag to enable it.
Example data:
[
{
folder: './src',
component: null,
subFolder: null,
file: 'index.js'
},
{
folder: './src',
component: 'A',
subFolder: null,
file: 'A.js'
}
...
]
Can you create a fiddle reproducing the issue?
🤦 the main problem I had was a typo in a group name. I noticed when creating the fiddle.
Anyway, this is a fiddle to reproduce the kind of visualization I'm trying to build: https://codesandbox.io/s/snowy-glade-bzg1t?file=/src/index.js
The data
structure was the one I had and that would be nice to support (IMHO), but I think the workaround used in dataOffset
can be ok.
Another nice feature, which probably can be tracked in another issue, is the possibility to express rect sizes with another property.
Another nice feature, which probably can be tracked in another issue, is the possibility to express rect sizes with another property.
Not sure I follow, opposed to color?
No.
For instance, using the US states demo: area
dimension property used for rect surface and the population
property used as color
Oh right, so that would need to be summed up too. Can you open another issue for that?
Still delaying this one to get other things out.