-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add HexTiles element #2482
Add HexTiles element #2482
Conversation
Ready to review, and can be merged once the corresponding bokeh PR is merge: bokeh/bokeh#7682. |
bfa39ef
to
6577280
Compare
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clear out this metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
holoviews/plotting/mpl/stats.py
Outdated
@@ -204,3 +205,49 @@ def teardown_handles(self): | |||
for group in self.handles['box'].values(): | |||
for v in group: | |||
v.remove() | |||
|
|||
|
|||
class HexTilesPlot(ColorbarPlot): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in stats.py
when the bokeh equivalent is in hex_tiles.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can create a new file here too, didn't seem worth it though given that it's fairly short and doesn't have to implement the aggregation/tiling code. Happy to move it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer consistency in structure when the elements supported match across backends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll move it.
All done, should be ready to merge when tests pass. |
Merging. |
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. |
This PR adds a HexTiles element which is very useful as a density map. The functionality is all there now, but this depends on the unmerged bokeh PR bokeh/bokeh#7682. So far bokeh does not yet support hexagons with unequal scales along the two axes which is required for consistency with matplotlib and for it to be generally useful.
By default hex bins simply count the values in each bin but it may also be used for weighted binning.
On an implementation level we are letting matplotlib handle the binning internally while in the bokeh case we generate the hex binning using a Compositor and an operation. Unlike in other cases this operation is not user facing since the hex coordinates are not useful to a user. To make the Compositor work just for the bokeh backend it now includes an option to apply the compositor only for certain backends.
Notebook with examples: https://anaconda.org/philippjfr/hextiles/notebook