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 TagFilterButton plugin #1343

Merged
merged 15 commits into from Nov 10, 2022

Conversation

Waffleboy
Copy link
Contributor

@Waffleboy Waffleboy commented Jun 2, 2020

A very useful (and even basic) feature for interactive maps is dynamic filtering of points.

There's a plugin for leaflet called Tag Filter Button which does precisely that, add a button that will dynamically filter the maps based on a feature.

Demo available here

Link to plugin

I have built the plugin for folium, sans the test and examples. If this is chosen to be added, I'll add them as well

EDIT: Tests and examples added as well.

folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
folium/plugins/tag_filter_button.py Outdated Show resolved Hide resolved
@Conengmo Conengmo added the waiting for review PR is waiting to be reviewed label Jun 2, 2020
tests/plugins/test_tag_filter_button.py Outdated Show resolved Hide resolved
tests/plugins/test_tag_filter_button.py Show resolved Hide resolved
tests/plugins/test_tag_filter_button.py Outdated Show resolved Hide resolved
@Waffleboy
Copy link
Contributor Author

Added Examples and Tests.

Copy link
Member

@Conengmo Conengmo left a comment

Choose a reason for hiding this comment

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

Good work! I updated the PR based on some improvements that came available later.

Link to example notebook: https://nbviewer.org/github/Waffleboy/folium/blob/tagfilterbutton/examples/TagFilterButton.ipynb

I removed the version for the plugin CDN link, so we'll always use the latest version.

I removed the onSelectionComplete argument, since this refers to a Javascript function. This might confuse our Python users. Power users can still pass this through the kwargs.

Let's merge this when the tests pass.

@Conengmo Conengmo changed the title Add TagFilterButton as a Folium Plugin Add TagFilterButton plugin Nov 10, 2022
@Conengmo Conengmo added ready PR is ready for merging and removed waiting for review PR is waiting to be reviewed labels Nov 10, 2022
@Conengmo Conengmo merged commit 79f4599 into python-visualization:main Nov 10, 2022
@Conengmo
Copy link
Member

Thank you @Waffleboy for your PR! Sorry it took so long to get processed. It will be included in the next folium release, 0.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PR is ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants