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

Added dropdown links to download API calls from the API page. #3406

Merged
merged 9 commits into from
Oct 25, 2023

Conversation

davphan
Copy link
Collaborator

@davphan davphan commented Oct 17, 2023

Resolves #3237

Non-technical users were having trouble downloading API data for external usage. Dropdown buttons were added to the three major API calls (attributes with labels, score streets, and score neighborhoods) with one-click download options for CSV, Shapefile, and GeoJSON format.

GeoJSON format links to the JSON in browser rather than downloading a JSON file.

Before/After screenshots (if applicable)

Before:
image

After:
image

Testing instructions
  1. Go the API page by clicking the "API" tab from the navbar.
  2. Under each of the three main API call sections, click on the dropdown button and try clicking each of the three download options (CSV, Shapefile, GeoJSON).
Things to check before submitting the PR
  • I've written a descriptive PR title.
  • I've added/updated comments for large or confusing blocks of code.
  • I've included before/after screenshots above.

Copy link
Member

@misaugstad misaugstad left a comment

Choose a reason for hiding this comment

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

The functionality seems great! Most of these edits have to do with rewriting some of the text and such on the API page to accommodate the changes you've made!

  1. Let's have separate widgets for /attributes and /attributesWithLabels

  2. The lat/lng bounds should be listed as "Optional" instead of "Required". This just means removing the entire "Required" category and moving the lat/lngs part inside the "Optional" section.

  3. In places where you see this sentence

    If you need data for the entire city, you can use the parameters below

    Replace it with

    If you need data for the entire city, you can use the download button above or you can simply exclude the lat/lng parameters.

  4. There are more changes to make given that the params are now optional... Just use your best judgement and try to get the page to work with the now optional parameters and download widgets!

  5. The download widgets are kinda floating way higher than the titles that are in the same row. Can you add some margin to the buttons or something to move them more in line with the text? It just looks kinda clunky rn

  6. Let's also open the URLs in the widgets in a new tab!

public/javascripts/developer.js Outdated Show resolved Hide resolved
@davphan
Copy link
Collaborator Author

davphan commented Oct 24, 2023

@misaugstad Ready for another review!

@misaugstad misaugstad merged commit 3914b8e into develop Oct 25, 2023
@misaugstad misaugstad deleted the 3237-api-widget branch October 25, 2023 00:17
@misaugstad misaugstad mentioned this pull request Nov 1, 2023
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.

Add widget to download data on API page
2 participants