Added label filtering checkbox in search#202
Open
davidghobson1 wants to merge 2 commits into
Open
Conversation
…ed out during search. Default is still to include them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #38.
I added a checkbox as a part of the search bar so that labels can be filtered during search. As per the issue discussion, this is unchecked by default so all labels are visible, but once checked, only labels associated with the search results are shown. Unchecking the box brings all labels back.
Summary of the code changes:
Most of the changes are just adding the checkbox in the right places and adding functionality to filter the labels. On the Python side, this only involved setting
include_related_points=Truein thelabel_text_and_polygon_dataframescall increate_plots.py. This then populates therelatedPointsfield in the label JSON to ensure that labels associated with the search points are the only ones visible.One thing to potentially flag,
include_related_pointswas originally set toinclude_related_points = (True if render_html_kwds.get("topic_tree_kwds", {}).get("button_on_click") is not None else False)increate_plots.py. It was unclear to me what this was meant to do with the topic trees, but setting it toTrueseemed necessary to enable the filtering. I've looked at examples with the topic tree both enabled and not and don't notice a difference qualitatively, but wanted to flag it anyway.