Skip to content
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

Tree and data must be overridden in order to update the chart #172

Open
stockiNail opened this issue Dec 12, 2022 Discussed in #171 · 1 comment
Open

Tree and data must be overridden in order to update the chart #172

stockiNail opened this issue Dec 12, 2022 Discussed in #171 · 1 comment
Labels
bug Something isn't working

Comments

@stockiNail
Copy link
Collaborator

Discussed in #171

Originally posted by stockiNail December 12, 2022
Going to the last version, I have discovered that if you change the values of the tree (or data) without instantiating new object (or array), the chart will not be updated.

This is because the tree is stored in the controller and checked with new one at every update:

if (this._rectChanged || this._key !== key || arrayNotEqual(this._groups, groups) || this._prevTree !== tree) {

Maybe it's implemented as designed. But maybe it could be better to check not the instance but the content of the tree.

@stockiNail stockiNail added the bug Something isn't working label Dec 12, 2022
@Offbeatmammal
Copy link

a problem I've encountered with this is that it's very hard to filter the data and have the treemap re-draw, without a more complex setup.

in my particular scenario my data has three categories (eg cars, motorbikes, trucks) and I want to be able to quickly filter, turning any category on/off. With some graph types I can just splice the data array, but with treemap I have to rebuild for each filter operation. Not a huge issue but would be nice to find a solution (would actually love to keep the current vals array and just replace elements in the array with NaN (or eg -1) to turn off the box and then on a chart.update() recalculate the layout (I'm lazy, means I can leave my tooltip arrays unfiltered as the indexes will stay matching!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants