-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to display nested / hierarchical data? #81
Comments
this is actually one of the features missing for me to start using this library. I see no replies are here since Feb :( |
I have created a codepen https://codepen.io/stockinail/pen/MWGazpr with some function to transform an object (a tree) in an array acceptable by the treemap chart. Out-of-the-box creates objects with: {
g0: '',
g1: '',
...
g(n-1): ''
name: [item in the tree where the "key" is set, in the example 'value']
} the groups: ['g0', 'g1', 'name'], These function could be included in the treemap controller as feature and activated when the tree is an object instead of an array. @kurkle @Potherca @dannypk what do you think? I have already added the feature in my fork of the project. If make sense, I can try to submit a PR. |
hi @stockiNail ! Great job and thanks for your contribution. Speaking of functionality, you can achieve something like that using the groups of tree charts. What I am more interested in is, having regions like ASIA | EUROPE | AMERICAS and then, when clicking on Europe expanding like UK, GERMANY, FRANCE and then when I click on Germany seeing like BAVARIA, BERLIN, etc. So kind of multi-level tree chart that has the option to click and dive in, right click and dive out. Play a bit with https://plotly.com/python/treemaps/ .. Thanks! |
@dannypk thank you very much for feedback. With the PR, the drill down on the tree is doable . |
@stockiNail Great stuff! Looks like that solves my usecase. 👍 Great to have the codepen example as well, gives me something to play around with. |
@stockiNail that's great!! Let's see if the PR gets approved, if not I guess we'll all for the PR 😄 |
@Potherca @dannypk thank you very much for feedback. The PR is still in draft because I recognized a possible issue on |
The documentation states:
Everything works fine with flat / single-depth data, but I am having trouble understanding how to make a hierarchical structure work.
I've studied the examples (
sample/
directory) but they've not given me enough insight 😞Simplified, the data I have is:
This should give a Treemap similar to this:
The only thing I have found is to keep adding
groups
:But that looks like a hack to me, which would indicate that there is probably a better way to do this?
I've got a CodePen with what I have thus far: https://codepen.io/potherca/pen/qBVXmRz
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: