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

Rectangles use Bokeh quad not rect glyph #5664

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

ianthomas23
Copy link
Member

This fixes a bug using hv.Rectangles on logarithmic axes when using the Bokeh WebGL backend. Related Bokeh issue is bokeh/bokeh#12734. Here is an example of the problem:

Screenshot 2023-03-15 at 17 07 51

The cause of the problem is that hv.Rectangles, which are defined by min and max x and y values, are implemented using bokeh rect glyphs which use centre coordinates, width and height. The center coordinates are calculated as the means of the x and y coordinates, which makes sense for linear axes but not necessarily for logarithic. The solution is to use the Bokeh quad glyph instead which is characterised by min and max x and y so no transform of these parameters is required. Here is the output using this PR:

Screenshot 2023-03-15 at 17 07 16

quad glyph has been in Bokeh since at least version 1.4.0 (https://docs.bokeh.org/en/1.4.0/docs/reference/models/glyphs/quad.html?highlight=quad#bokeh.models.glyphs.Quad) in November 2019.

I haven't added a new test as I don't think there are any specific webgl tests implemented.

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #5664 (15de709) into main (df03b3d) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5664      +/-   ##
==========================================
- Coverage   88.30%   88.29%   -0.01%     
==========================================
  Files         302      302              
  Lines       62539    62541       +2     
==========================================
- Hits        55223    55219       -4     
- Misses       7316     7322       +6     
Impacted Files Coverage Δ
holoviews/plotting/mpl/geometry.py 35.29% <ø> (ø)
holoviews/plotting/bokeh/geometry.py 100.00% <100.00%> (ø)
holoviews/tests/plotting/bokeh/test_callbacks.py 98.65% <100.00%> (ø)

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@hoxbro
Copy link
Member

hoxbro commented Mar 16, 2023

It also looks good to me.

Is this ready to be merged?

@ianthomas23
Copy link
Member Author

Is this ready to be merged?

Yes.

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 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants