-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Support multiple marker types in WebGL scatter #11840
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
Conversation
Argh, I forgot to set the labels yet again 😲 |
@ianthomas23 is this |
@ianthomas23, does this approach preserve z-order of consecutive data points? |
I don't see how it could, webgl naturally wants to draw the same things in batches. Assuming that is so, I am definitely in favor of simply documenting that trade-off and letting users make the decision that fits their needs accordingly. |
Not always.
Correct. The marker WebGL shaders can only render a single marker type at a time. The rendering of a It doesn't have to be this way. It would not be difficult to rewrite the code to render each group of contiguous marker types in order. But it is easy to invent some pathological cases for which the performance would be atrocious, e.g. a single |
@ianthomas23 can you add a note to the |
Yes, I will do that tomorrow. |
I would prefer all backends to have principally the same semantics, so if we allow grouped renderer of scatter markers in webgl, then we should allow that in canvas and svg as well. Though this is a topic for a broader discussion; for the time being, this PR is fine. |
* Support multiple marker types in WebGL scatter * Update macos/windows baseline images * Changes following review * Add docs about different render order
* Support multiple marker types in WebGL scatter * Update macos/windows baseline images * Changes following review * Add docs about different render order
* Fix webgl line NaN handling (#11829) * Fix webgl line nan handling * Add baseline images * Support multiple marker types in WebGL scatter (#11840) * Support multiple marker types in WebGL scatter * Update macos/windows baseline images * Changes following review * Add docs about different render order * Remove temporary webgl circle fix (#11849) * Add regression test for updating webgl line (#11884) * Add regression test for updating webgl line (issue #8346) * Update macos and windows baseline images * Unify WebGL markers and rects (#12040) * Unify markers and rects * Baseline images * Consistent code style * WebGL typescript refactor and add quad glyph (#12046) * SingleMarkerGL for rect and quad * MarkerGL inherits from BaseMarkerGL * Better class hierarchy * Test WebGL quad glyph * Separate CircleGL class * Avoid use of any * Remove code duplication * Implement WebGL marker line joins (#12055) * Line joins for markers * Use same antialiasing width for all webgl markers * Correct size hints * Baseline image changes * Marker glyph should support line join test * WebGL support for HBar VBar and HexTile glyphs (#12061) * Add WebGL HBar and VBar glyphs * Add WebGL HexTile glyphs * Visual test changes * Include rotation in should_support_Rect test * Minor WebGL line refactor (#12120) * Fix Wedge and AnnualWedge glyph hitboxes (#12071) * Fix Wedge and AnnualWedge glyph hitboxes * Hitbox tests for Wedge and AnnualWedge glyphs Co-authored-by: Michael Brown <michael@msbrown.net>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Previously if you used the WebGL backend and called
scatter
with more than one marker type, e.g.then rendering would drop back to using canvas. This PR addresses this, fixing item 4 of discussion #11369.
Changes:
MarkerGL
used to accept themarker_type
in its constructor. This is no longer required.MarkerGL
identifies the unique marker types it needs to render, and calls the ReGL rendering function once for each type. All but one array/buffer is common in these calls so the data transfer to GPU is minimal, only theshow
array/buffer is different each time.ScatterView
no longer checks for the type of marker to change the underlyingglglyph
, it keeps the sameglglyph
.ScatterView
assumes thatMarkerGL
can render all marker types, so I have removed theis_supported
function. If a new marker type is added for canvas it must also be added for WebGL. This may need discussion.and after
The WebGL-trained eyeball will note that in the before image the webgl output is the same as canvas, but it is different in the after image as the antialiasing is different for webgl: the cross is darker and the dots are lighter for example. Any future regression of webgl back to canvas will be caught by this test.
I have kept the handling of both
circle
andscatter
markers inMarkerGL
even though it is a bit clunky (it always was, and dates back to "before my time" here). I intend to refactor this when I combinecircle
,scatter
andrect
into a single united implementation, presumably through a more sensible class hierarchy in the webgl code.