replot / replot-treemap

replot-treemap: Intelligent and customizable treemap components for react.
http://replot.io/treemap/
MIT License
1 stars 0 forks source link

Be smarter about minimum threshold so that a large part of the map is not "Other" #33

Closed sanjaypojo closed 6 years ago

askyel commented 6 years ago

add 'maxOtherSize' prop - how much of total other section should take up, recompute otherThreshold using it, prop type error if otherThreshold added as well

changing minThreshold doesn't work beyond a point due to rounding errors? e.g. .00001

fix rounding error in otherThreshold, a bunch of things go into other no matter how small the threshold

missing name, data where country is NULL -> drop nulls from being rendered (check at beginning if any of the keys are null)

sanjaypojo commented 6 years ago

Hey @askyel, I'm working on this issue FYI!

AlmahaAlmalki commented 6 years ago

@sanjaypojo @askyel did we add a new prop for the "total minimum threshold" to ensure that a large part of the map is not other?

sanjaypojo commented 6 years ago

Yes, I added and pushed this - the props are maxOtherSize and otherThreshold. @AlmahaAlmalki , let me know if it's working for you

AlmahaAlmalki commented 6 years ago

@sanjaypojo I tried the new prop, I'm not sure if it's not working or if I'm doing something wrong.

So in this example, I want anything less than or equal 2% to belong to other, but other should not exceed 5% of the total treemap size.

screenshot 2017-12-11 16 14 08
sanjaypojo commented 6 years ago

Hi @AlmahaAlmalki, you're right, at the moment, only otherThreshold works. maxOtherSize is yet to be pushed. I'll do it now and comment once it's pushed so that you can check!

sanjaypojo commented 6 years ago

@AlmahaAlmalki, just made the fix, see if it works for you. If you set maxOtherSize it should behave the right way 😸

AlmahaAlmalki commented 6 years ago

@sanjaypojo it's working perfectly, thanks