chartjs-chart-treemap icon indicating copy to clipboard operation
chartjs-chart-treemap copied to clipboard

FR: Support missing/partial groups in the data

Open dej611 opened this issue 3 years ago • 6 comments

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'
  }
  ...
]

dej611 avatar Oct 04 '21 07:10 dej611

Can you create a fiddle reproducing the issue?

kurkle avatar Oct 04 '21 07:10 kurkle

🤦 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.

dej611 avatar Oct 05 '21 07:10 dej611

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?

kurkle avatar Oct 06 '21 09:10 kurkle

No. For instance, using the US states demo: area dimension property used for rect surface and the population property used as color

dej611 avatar Oct 08 '21 12:10 dej611

Oh right, so that would need to be summed up too. Can you open another issue for that?

kurkle avatar Oct 08 '21 13:10 kurkle

Still delaying this one to get other things out.

kurkle avatar Jan 24 '23 21:01 kurkle