Rectangles use Bokeh quad not rect glyph #5664
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:The cause of the problem is that
hv.Rectangles
, which are defined by min and maxx
andy
values, are implemented using bokehrect
glyphs which use centre coordinates,width
andheight
. The center coordinates are calculated as the means of thex
andy
coordinates, which makes sense for linear axes but not necessarily for logarithic. The solution is to use the Bokehquad
glyph instead which is characterised by min and maxx
andy
so no transform of these parameters is required. Here is the output using this PR: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.