-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add an option to bin the data before generating a heatmap #579
Conversation
Current coverage is 73.12%@@ master #579 diff @@
==========================================
Files 82 82
Lines 7148 7216 +68
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 5208 5276 +68
Misses 1940 1940
Partials 0 0
|
Thanks @manthey I will have a look at it. |
This is faster for large data sets, as fewer images are drawn to the canvas. It is slower for small data sets, as the binning takes some time. The default setting 'auto' will only bin if there are fewer bins than data points. The bin size may be auto-calculated (1/8 of the point radius) or set explicitly. Setting it explicitly to larger values will be faster but more and more wrong.
@@ -26,6 +26,11 @@ var transform = require('./transform'); | |||
* be computed. | |||
* @param {number} [updateDelay=1000] Delay in milliseconds after a zoom, | |||
* rotate, or pan event before recomputing the heatmap. | |||
* @param {boolean|number|'auto'} [binned='auto'] If true or a number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manthey could we make it (binned) false by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
I thought auto would be a better default, since based on the rest of our default values, binning probably won't occur until you have ~200,000 data points (depending on screen size), at which point the speed improvement is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I can see both sides. What happens if a user has dynamic update and let's say their number of points changes from 100,000 to 200,000 in that case now they will see a different behavior. Binning introduces / increases the visualization error (lack of a better word), that's why I thought that it should be false by default but I am with auto as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree -- either would be fine as the default. auto
definitely introduces a discontinuity in the visualization as the number of points crosses the threshold (resizing the window could also do this). On the other hand, if you have a million data points, binning will be much faster. Your call on which should be the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go with auto 👍 we can always change it later depending on user's feedback.
Explicitly set the default example binning to 'auto' in case we ever change the default in the heatmap class.
Oddly, travis failed on the branch test but succeeded in the PR test. I'll make the numbner point based on the reported viewport to see if that makes Travis happy.
LGTM 👍 |
This is faster for large data sets, as fewer images are drawn to the canvas. It is slower for small data sets, as the binning takes some time. The default setting 'auto' will only bin if there are fewer bins than data points. The bin size may be auto-calculated (1/8 of the point radius) or set explicitly. Setting it explicitly to larger values will be faster but more and more wrong.
This is currently based on other PRs. It could be isolated if necessary.