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

Adding 2 examples on using custom svg shapes #2454

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

armsp
Copy link

@armsp armsp commented Apr 10, 2021

Last year I was able to get some cool graphs using custom SVG shapes with @jakevdp 's help. I eventually ended up emulating a lot of cool graphs and put them on my project website: https://armsp.github.io/covidviz/

This is a PR that adds simplified examples of just the maps with custom SVG markers.

Example 1: custom_svg_mark_geospatial.py

This example shows how to use custom SVG shapes as marks on Geospatial plots.

Since the data for this plot is not available in vega-datasets, you'd have to download the data hosted on my personal repo - https://github.com/armsp/datasets/blob/master/covid_cases_april_6.csv

Example 2: interactive_time_series_geospatial_chart.py

This example shows how to use range slider that lets you choose a day which is used by the selection to select data only for that day to visualize surge in per-capita cases of covid-19. The marks are custom SVG shapes (a vertical line) on a geospatial plot (it looks like a bar plot on a map). Slide the slider knob to see how the selection changes the data and hence the plot.

Since the data for this plot is not available in vega-datasets, you'd have to download the data hosted on my personal repo - https://github.com/armsp/datasets/blob/master/past_2_weeks_per_capita.csv

Some Issues

There are some guidelines on things to take care of when adding examples. Unfortunately I have broken a few of them. I do not know the best way to fix them. So I am hoping that the maintainers would guide me on the best possible way to fix them so that the PR is in a state that can be merged for the next release cycle.

Things I believe I have not followed -

  1. The data for the states base layer is requested from the CDN providers for us-atlas project : external calls to data
  2. The data for plots is hosted on my personal repo : external calls to data
  3. I am not sure of the category of the first plot - maps OR other charts

@armsp
Copy link
Author

armsp commented Apr 13, 2021

Maintainers, do you have any suggestions for how to replace the external data sources, or will you be willing to add new datasets?

This is how the graphs look -

  1. custom_svg_mark_geospatial.py
    custom_svg

  2. interactive_time_series_geospatial_chart.py
    custom_svg_ts

@mattijn
Copy link
Contributor

mattijn commented Dec 27, 2022

Thanks for this PR @armsp. I like the visz on your project website: https://armsp.github.io/covidviz/, but I do feel that this PR is a bit complex, contains similar information to the existing isotype example: https://altair-viz.github.io/gallery/isotype_grid.html and is dependent on external data outside vega_datasets.

Therefor I'm tempted to say to not accept this PR for the documentation. Let me leave it open for a bit if others are opinionated differently.

@joelostblom
Copy link
Contributor

I am on the edge with this one, but think I agree with you @mattijn. Especially the calls to external data sources is problematic and makes this a better fit for #2697 in my opinion. I think the viz is cool and it would be great to mention a short description with a link in that issue @armsp so that it can be showcased once we add this new page to the docs.

@armsp
Copy link
Author

armsp commented Jan 3, 2023

Thanks for this PR @armsp. I like the visz on your project website: https://armsp.github.io/covidviz/, but I do feel that this PR is a bit complex, contains similar information to the existing isotype example: https://altair-viz.github.io/gallery/isotype_grid.html and is dependent on external data outside vega_datasets.

Therefor I'm tempted to say to not accept this PR for the documentation. Let me leave it open for a bit if others are opinionated differently.

I understand...I just think that covid viz kind of became ubiquitous and will be so for years to come...especially when teaching visualizations because they provide so many different ways to viz essentially the same phenomenon. It kind of makes sense to add those datasets in vega-lite. And perhaps update the map base layer, or if I am not wrong then maybe I could just use the base layer provided by vega which IMO is not as aesthetically pleasing as what I have used.

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.

None yet

3 participants