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

Fixes for Polygons plotting with holes #3409

Merged
merged 6 commits into from
Jan 17, 2019
Merged

Fixes for Polygons plotting with holes #3409

merged 6 commits into from
Jan 17, 2019

Conversation

philippjfr
Copy link
Member

The PolygonPlot implementation switched between the MultiPolygons and Patches glyphs depending on whether the polygons have holes or not. The problem with that is that in a dynamic plot or HoloMap the returned data format may therefore change but the glyph is only initialized once, so a MultiPolygons glyph could end up with the data format for the Patches glyph and vice versa. This PR ensures that Polygons are always plotted using the MultiPolygons glyph unless a PolyDraw or PolyEdit stream is attached to the plot, which do not yet support holes. This ensures backwards compatibility while also fixing the bug.

  • Adds unit tests

@philippjfr philippjfr added type: bug Something isn't correct or isn't working tag: backend: bokeh labels Jan 17, 2019
@@ -284,7 +284,7 @@ def range(self, dim, data_range=True, dimension_range=True):
return (None, None)
elif all(util.isfinite(v) for v in dim.range) and dimension_range:
return dim.range
elif dim in self.dimensions() and data_range and len(self):
elif dim in self.dimensions() and data_range and bool(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is mainly an optimization, computing the length on a Polygons/Path can be very expensive, bool(self) is equivalent but a much quicker way to check whether the element is empty.

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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: backend: bokeh type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant