Skip to content

Added label filtering checkbox in search#202

Open
davidghobson1 wants to merge 2 commits into
TutteInstitute:mainfrom
davidghobson1:feature/filter_search_labels
Open

Added label filtering checkbox in search#202
davidghobson1 wants to merge 2 commits into
TutteInstitute:mainfrom
davidghobson1:feature/filter_search_labels

Conversation

@davidghobson1

Copy link
Copy Markdown

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=True in the label_text_and_polygon_dataframes call in create_plots.py. This then populates the relatedPoints field 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_points was originally set to
include_related_points = (True if render_html_kwds.get("topic_tree_kwds", {}).get("button_on_click") is not None else False) in create_plots.py. It was unclear to me what this was meant to do with the topic trees, but setting it to True seemed 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected text label behaviour when using search (points get filtered, labels do not)

1 participant