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

Add HexTiles element #2482

Merged
merged 20 commits into from
Mar 29, 2018
Merged

Add HexTiles element #2482

merged 20 commits into from
Mar 29, 2018

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 24, 2018

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.

screen shot 2018-03-24 at 2 28 15 pm

screen shot 2018-03-24 at 3 05 28 pm

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

@philippjfr philippjfr added the type: feature A major new feature label Mar 24, 2018
@philippjfr
Copy link
Member Author

Ready to review, and can be merged once the corresponding bokeh PR is merge: bokeh/bokeh#7682.

@philippjfr philippjfr force-pushed the hex_tiles branch 4 times, most recently from bfa39ef to 6577280 Compare March 28, 2018 20:03
}
},
"nbformat": 4,
"nbformat_minor": 2
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do.

@@ -204,3 +205,49 @@ def teardown_handles(self):
for group in self.handles['box'].values():
for v in group:
v.remove()


class HexTilesPlot(ColorbarPlot):
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

@philippjfr
Copy link
Member Author

All done, should be ready to merge when tests pass.

@jlstevens
Copy link
Contributor

Merging.

@jlstevens jlstevens merged commit c1bf5b8 into master Mar 29, 2018
@philippjfr philippjfr deleted the hex_tiles branch March 31, 2018 21:54
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 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature A major new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants