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

[RFC] Add a territory selector widget #474

Open
efernandezleon opened this issue Oct 5, 2022 · 3 comments
Open

[RFC] Add a territory selector widget #474

efernandezleon opened this issue Oct 5, 2022 · 3 comments

Comments

@efernandezleon
Copy link

efernandezleon commented Oct 5, 2022

Target Use Case

Many projects from PS need the functionality of filtering some layers (and widgets) based on territory (state, city, county, DMA, FSA, ...). Some examples of projects that use this feature would be Telus Insight or Radarview, where a user wants to focus the data exploration on a specific geometry that comes from a well-known territory.

Implementation Proposal

To cover this functionality, the framework C4R could provide a widget composed of a UI component to select a territory (single dropdown select or autocomplete) that uses a source to show the geometry in the map by using the Spatial Filter to filter some layers. An extra ball for business strategy could be to support directly territory geometries from the DO, like https://carto.com/spatial-data-catalog/browser/geography/cdb_block_96b823a2/ or https://carto.com/spatial-data-catalog/browser/geography/mbi_counties_46ea8aaa

Some options for this widget can be:

  • Filtered sources: list of sources to be filtered when a territory is selected
  • Show the contour: boolean to indicate if the contour of the geometry should be shown or not
@padawannn
Copy link
Contributor

padawannn commented Oct 5, 2022

You can load a GeoJson layer that represents the territory selected and add the spatial filter using the addSpatialFilter action

@efernandezleon
Copy link
Author

@padawannn Yes, that would be the under-the-hood implementation, we can develop a reusable widget with minimum configuration to cover the feature. The point is if you think this widget could be interesting to add as an official C4R widget.

@alasarr
Copy link
Contributor

alasarr commented Oct 22, 2022

+1 to this feature. Can you go further and define how the API will look like for this widget?

I will keep this very simple right now. You should need from the user:

  • A table
  • The geom column of the table
  • The column name to get the filter.

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

No branches or pull requests

3 participants