Skip to content

Fix webgl line NaN handling #11829

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

Merged
merged 2 commits into from
Nov 22, 2021
Merged

Fix webgl line NaN handling #11829

merged 2 commits into from
Nov 22, 2021

Conversation

ianthomas23
Copy link
Member

Fixes 8th item of issue #11050.

The previous WebGL solution for NaNs in lines wasn't good enough. NaNs are not suitable for use in WebGL shaders due to their reduced floating-point precision, so the previous solution used a large negative number to represent NaNs. This worked for many use cases but not for x, y values near that large negative number or when zooming in by many orders of magnitude. This solution uses a new show array to indicate which segments should be shown, and is similar to the WebGL rect/marker handling of indices.

There are already a couple of visual tests for NaNs in WebGL lines. I have added a new one that shows the bug before this fix and the correct solution after this fix.

Before:
before

After:
after

@mattpap mattpap added this to the 3.0 milestone Nov 22, 2021
@mattpap
Copy link
Contributor

mattpap commented Nov 22, 2021

I didn't have a chance to review this.

@bryevdv
Copy link
Member

bryevdv commented Nov 22, 2021

I didn't have a chance to review this.

And that's OK. You don't have to be responsible for very single merge. Old and new tests pass, the person who is by far more of an expert at WebGL than either of us is happy with it, the code was completely self-contained to their area of expertise, and it had no obvious other problems.

bryevdv pushed a commit that referenced this pull request Dec 13, 2021
* Fix webgl line nan handling

* Add baseline images
ianthomas23 added a commit that referenced this pull request May 16, 2022
* Fix webgl line nan handling

* Add baseline images
@ianthomas23 ianthomas23 modified the milestones: 3.0, 2.4.3 May 16, 2022
bryevdv pushed a commit that referenced this pull request May 16, 2022
* 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>
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants