econ-dashboard / econ-dashboard.github.io

1 stars 0 forks source link

Create landing page #23

Closed rsyoh-97 closed 3 years ago

miguelito34 commented 3 years ago

What would be the best way to allow users to find their county? Drop down menu? Search bar? Am thinking through the best way/place to store all the counties we have data for. Having a single list (i.e. csv or txt file) and using that list to both:

  1. Iterate through the data pipeline/templating &
  2. Pull into the HTM/JS code for navigating

Would likely be useful.

zstumgoren commented 3 years ago

@miguelito34 I think a search menu will be the way to go since it will let you scale nationally without reworking the code (a dropdown list will contain far too many options when you go beyond the Bay Area). There's a handy library called fusejs that supports fuzzy search of structured data without any "backend" server. It should let you implement this feature in a relatively straightforward way by simply providing a JSON file or writing the JSON data into the page during preprocessing.

miguelito34 commented 3 years ago

Got it, thanks! Happy to chat in OH, but seems like we'd want something similar in practice to what's happening here or here. It's different library but I think it demonstrates the same idea.

We'd have a JSON list with the "display_name" being the county name and the "url" being the path to the relevant county's page? Am assuming we'd be able to make it such that if they clicked on that result it could take them to the relevant page.

zstumgoren commented 3 years ago

@miguelito34 +1 yes any library that allows you to load a basic JSON file and performs search is fine. The key is to keep it static -- i.e. no need for a backend web API or live database. If QuickScore is similar to Fuse in that it works client-side only, that's great!