Skip to content
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

Implement WebGL marker line joins #12055

Merged
merged 5 commits into from
Mar 23, 2022

Conversation

ianthomas23
Copy link
Member

This PR implements line joins for all WebGL markers, including quad and rect. WebGL markers now implement all visual properties except for line dashes which are silently ignored. I have also fixed the antialiasing width to be the same for all markers, as discussed in PR #12046, whilst I was changing the baseline images anyway.

The only thing I am not completely happy with is the appearance of square_pin and triangle_pin as I am using circular arcs instead of quadratic bezier curves because they are much faster to calculate but look slightly different from canvas/svg. I may return to this eventually but they are good enough for now.

New visual test image showing the 3 possible line joins (round, miter, bevel) for those markers for which it makes a difference:
Marker_glyph__should_support_line_join

There are two notable discrepancies here:

  1. SVG square glyphs don't use the line join at the top left hand corner.
  2. triangle_pin with line_join='miter' only has an upward spike for canvas/svg whereas I have implemented spikes on all 3 points because it is easier that way. Ideally they would all be the same, but which should be modified?

This work is part of the CZI round 3 extension.

@bryevdv
Copy link
Member

bryevdv commented Mar 22, 2022

I personally think the way you have rendered triangle_pin is preferable. I would also remind that these are typically used as scatter markers with relatively small fixed pixel sizes, though, so it's not necessarily a huge priority in my mind.

@ianthomas23
Copy link
Member Author

I tend to use large markers with big line widths as that is the only way I can tell if I am rendering them correctly. I accept that this is not a usual use case!

So probably we aren't concerned about the slight differences now and can reconsider it later if anyone has the time and/or inclination to do so. Hence I will tag this as ready for review.

@mattpap mattpap merged commit c93a1aa into branch-3.0 Mar 23, 2022
@mattpap mattpap deleted the ianthomas23/webgl_marker_line_join branch March 23, 2022 07:08
ianthomas23 added a commit that referenced this pull request May 16, 2022
* 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
@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants