-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cleanup specs for BubbleOverlay #1688
Cleanup specs for BubbleOverlay #1688
Conversation
…ving empty bins interferes with this. See discussion in dc-js#1687
Thanks for pointing out the change in test result. This is why we have tests: not so much because we will immediately recognize what is the right result, but because when behavior changes we want to catch it and figure out why. The test is for elastic radius. That is, when the chart is drawn, the extent of the input values from radiusValueAccessor is calculated and used as the domain for the bubble radius scale r. Now I vaguely recall that when I lifted elasticRadius to the bubble mixin in #661, I had to add So to go to the root of the problem, #661 was not as simple as it looked. In order to implement elastic radius correctly on the bubble overlay chart, since it does not support Interestingly, the bubble mixin already has a special case for zeros when it sets the SVG radius: dc.js/src/base/bubble-mixin.js Lines 114 to 121 in 64716df
It passes the value into the radius scale, and then uses 0 if the result is NaN or the value is 0. To fix this, dc.js/src/base/bubble-mixin.js Lines 106 to 108 in 64716df
Something like return min(this.data().map(this.radiusValueAccessor()).filter(value => value > 0)) |
Tested the change and reverted the change to the test! Thanks @kum-deepak! |
Rats, this broke the iris tests of the bubble chart. I guess either choice might be valid, so I'm adding an option called However, there might be reasons why people like the old behavior, so a flag is the safest thing to do. By analogy, consider #667, where the current behavior is to always include zero in elasticY, but the issue asks to optionally not include zero, occasionally a valid choice. |
Wow! So many things going on while I thought it was a simple one 😄 |
Yeah, it seems to be the rule for charting libraries: features will interact in complex ways. 😔 |
BubbleOverlay expects data corresponding to each of the points - removing empty bins interferes with this. See discussion in #1687.
For some reason - one of the circles are now different size. The new one seems correct. I am wondering was the old one incorrect?