Skip to content

Map demo + Guide#2402

Merged
dawoodkhan82 merged 7 commits into
mainfrom
dawood/map-demo
Oct 12, 2022
Merged

Map demo + Guide#2402
dawoodkhan82 merged 7 commits into
mainfrom
dawood/map-demo

Conversation

@dawoodkhan82
Copy link
Copy Markdown
Collaborator

@dawoodkhan82 dawoodkhan82 commented Oct 6, 2022

Description

Created map demo with plotly, and an associated guide for it.

https://huggingface.co/spaces/dawood/NYC-Airbnb-Map

Please include:

  • relevant motivation
  • a summary of the change
  • which issue is fixed.
  • any additional dependencies that are required for this change.

Closes: #2338, #1993

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 6, 2022

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2402-all-demos

Copy link
Copy Markdown
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

Awesome demo @dawoodkhan82 ! 🗺️

I gave a sneak peek of this demo at the talk yesterday and people were into it.

I think there's a small bug in the tooltip text. Might be good to add this to the demos tab as well.

Comment thread guides/5)other_tutorials/plot_component_for_maps.md
@@ -0,0 +1,165 @@
# How to Use the Plot Component for Maps
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we upload this to the demos page under the tabular section? WDYT @dawoodkhan82 @aliabd ?

Comment thread guides/5)other_tutorials/plot_component_for_maps.md
Copy link
Copy Markdown
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

If we're worried about the size of the csv we can host on Hub datasets as well.


Above, we create a scatter plot on mapbox by passing it our list of latitudes and longitudes to plot markers. We also pass in our custom data of names and prices for additional info to appear on every marker we hover over. Next we use `update_layout` to specify other map settings such as zoom, and centering.

More info [here](https://plotly.com/python/scattermapbox/) on scatter plots using Mapbox and Plotly.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good to describe what other map types besides Scattermapbox are supported.

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Oct 7, 2022

If we're worried about the size of the csv we can host on Hub datasets as well.

Agreed, the CSV is rather large. You could even just include the python code to download the CSV file from the Kaggle link using the requests library as part of run.py and as part of the Guide.

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Oct 7, 2022

Otherwise, the Guide reads great! Nice work @dawoodkhan82

@dawoodkhan82 dawoodkhan82 merged commit 3a2de9b into main Oct 12, 2022
@dawoodkhan82 dawoodkhan82 deleted the dawood/map-demo branch October 12, 2022 03:51
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.

Create DS Demo: Map demo to plot geographic data

3 participants