-
Notifications
You must be signed in to change notification settings - Fork 189
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
legend range does not update when clicking the additional values rectangle #509
Comments
I'm not following some of this, can you post a code snippit showing the problem? |
The below treemap definition is only part of what we use, but should be enough to explain this issue.
When we have a few hundred data points, the tree-map will have the 'others' rectangle. This appears to happen because the calculation of the legend occurs only after filtering the data to be displayed. This calculation is only performed once, so drilling in will not change the boundaries. The fix should be simple - consider all the data when deciding on the min/max values for the legend. |
If I'm understanding you correctly, this is expected behavior. Set aside the "threshold" option for a second, and consider simple nesting. Given this configuration: <div id="viz"></div> var data = [
{value: 10, parent: 1, id: "a"},
{value: 30, parent: 1, id: "b"},
{value: 20, parent: 2, id: "c"}
];
d3plus.viz()
.container("#viz")
.color("value")
.data(data)
.id("parent")
.size("value")
.type("tree_map")
.draw(); The visible color scale here goes from 20 to 40, which is correct given the groupings that are occurring. Even though there is a data point with a value of 10, it is being visually represented as it's parent group, which has a summed value of 40. |
My point is that the legend is incorrect, not the aggregation. |
Your example works as expected. What I see is the legend being drawn with values that don't include the actual data min and max. This could be fine as in my example min and max happen to be inside the In the general case, whether or not the |
Ahh I see, thanks for clarifying. I was able to fix it so that the legend scale updates when clicking on the |
I title pretty much says it all; the legend range might be incorrect when min/max is under the additional values rectangle.
I have a case where the size of the rectangles is based on field X and the legend on field Y.
It also happens that the objects with (both) min/max values of Y are small enough to be bundled under the 'Values < zzz' rectangle.
The legend displays the min/max as those of the shown values, which could be fine if the legend would update when drilling in, and that does not happen.
Since it makes sense that the legend boundaries are static, it should generate the ticks taking into account all objects, not only the displayed ones.
The text was updated successfully, but these errors were encountered: