In this activity, you are going to try to follow along on creating a visualization with brushing and linking between maps and scatterplots during an in-class demonstration.
This activity is extra credit - it can be worth up to two missed in-class assignments. Making the map is worth one, and making the scatterplot and connecting it to the map is worth another. The solution will be posted after a few days so it cannot be handed in late.
We will be visualizing made up data about Aditeya's experience with various cities that he's visted. In particular, we are analyzing the relationship between perceived diversity, food, and geographic location.
-
Clone this repository to your local machine. E.g., in your terminal / command prompt
CDto where you want this the folder for this activity to be. Then rungit clone <YOUR_REPO_URL> -
CDor open a terminal / command prompt window into the cloned folder. -
Start a simple python webserver. E.g.,
python -m http.server,python3 -m http.server, orpy -m http.server. If you are using python 2 you will need to usepython -m SimpleHTTPServerinstead, but please switch to python 3. -
Wait for the output:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/). -
Now open your web browser (Firefox or Chrome) and navigate to the URL: http://localhost:8000
First, implement the map.
- First, we add an SVG for the map.
- Next, we add setup code for the projection.
- We'll load the topology file for the US (
us.json) and the cities visited files (cities-visited.csvandstatesvisited.csv). - Draw the map using the topology file (see our
in-class-programming-geoassignment for an example). - Draw the cities as points on a scatterplot.
- Add brushing on the map.
- Add a legend.
- Make the map responsive using a
viewbox.
Then, implement the scatterplot.
- Add a different SVG for the scatterplot.
- Define a margin.
- Create the x and y scales.
- Add circles to the scatterplot using the scales.
- Initiate the axis.
- Add a tooltip to the circles.
Publish your visualization to github pages and submit a link to your repository on Canvas.
