-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
scattergl lazy init #1444
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
scattergl lazy init #1444
Conversation
- instead, create them on update when needed - this should speed up scattergl plotting especially when multiple traces are present - TODO: we'll need to reorder the trace object when adding a a 'mode' or an error bar to make sure e.g. lines are always drawn below scatter pts.
- at end of .update step - to preserve order on updates
// - errorX | ||
// - errorY | ||
// - markers | ||
this.scene.glplot.objects.sort(function(a, b) { |
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.
This part isn't quite right. We'll have to consider trace order too, fix coming on Monday.
The same technique might be extended to 3D to fix #1267
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.
done in 81d3bf6
src/traces/scattergl/convert.js
Outdated
obj._index = objIndex; | ||
} | ||
obj.update(options); | ||
return obj; |
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.
what are the return obj
statements for? Seems like it's meant for method chaining, but then wouldn't it be return _this
? This way seems dangerous to me since obj
can be (and very often is) null
.
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.
or no, I guess not _this
, but the object you create and return below
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.
Ha good eyes. I should've 🔪ed before pushing. We don't need to support method chaining here (why we anyone clear and/or update and/or dispose in the same statement?)
🔪 🔪 🔪
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.
done in 34ea31e
💃 nice 🐎 ! |
Instead of initialising 1
gl-line2d
, 2gl-error2d
, 1gl-scatter2d
and 1gl-scatter2d-(fancy|sdf)
object perscattergl
why not intialize only the part(s) we need?On a 5-trace graph of 10,000 pts each, that amounts to a ~300ms-faster
plot
call 🐎