Cheat Sheet:
3. How do you create a bivariate legend:
First, link the data to make the data match your map. This will make sure it correctly is matched with your map. There is a legend section later in this notebook. This part of the notebook was largely untouched.
Next, add in your testing variables. This is found later in the map. Add in your variable that connects the information and CSV data (GISJOIN). Then, add in the tested variables. After this add the variables being tested so it appears on the map. Add a title for each side of the legend and choose an appropriate name that is short but easy for the user to understand.
Next, move your bivariate legend. This is in the above code. I changed the line: .attr("transform", "translate(690,70)"); --> I did this so that the legend would appear next to the map in an appropriate spot. I moved the (x, y) coordinate so that the map was viewable.
Note:
Added black to polygons in the code above through the line: .attr("stroke", "Black")
I did this because the gray of the barrier lines was being hidden in the lighter colors.
4. How are attribute values displayed when hovering over each point?
- This happens through the Join later in this file with the GISJOIN attribute. This allowed for the counties to be connected with the attribute we are testing. The attribute values look like this "G53003: Queer Marriages : *high/low* Married Woman: *number*".
Here you can change the legend information. I made the lines on the legend thicker to match the map more. The Washington Map was large, and I wanted the legend to match.
In the above information is how to transform the legend. You can change the side of text, rotate, stroke line, and font of the legend.
Normalized Variables:
MARSS: Married Same Sex Couples
TOTALMAR: Total Married Couples in Washington per County
MARFF: Married Female (Same-Sex)
MARMM: Married Men (Same-Sex)
MARFF/MARSS = Married Female couples divided by total marriage of same sex couples
MARSS/TOTALMAR = Percentage of same sex couples from the total amount of married couples in Washington
Cheat Sheet:
2. Which colors are used for bivariate mapping in Observable?
--> Explain how to select or construct a bivariate color scheme
The colors I decided to use for the bivariate map was the BuPu scheme. This scheme is representative of the information. The blue and pink hues felt appropriate for the tested variables. Plus, these variables appear distinct against each other and do not blur together, especially with the black outlines.
To select a bivariate map, you should find a color scheme that is not distracting, representative of the information, and stands out against the background polygon lines. The other colors appeared poorly against the gray polygon lines and blurred with the dark black lines.
To construct a bivariate color scheme, you could choose a bivariate scheme from Colorbrewer.com. I also suggest exploring the color information on canvas or online to determine appropriate colors.
1. How do you join geometries from a TopoJSON file with attributes from a CSV file?
To join my GeoJSON to my CSV, I joined the file in QGIS. I added my Shapefile through selected QGIS along with my CSV file. After I converted projections, I right clicked on my US County Shapefile and found my way to the Join selection. There, I added my csv and chose the attribute GISJOIN to join the two features. This attribute is helpful for this function and was added above as the id attribute to join within the GeoJSON file. After I added this join, I created a new field name and ran the join. I checked my attribute table to ensure the join was correct.
In Observable:
To join the attributes, first you must find the property feature that is the connecting variable. To do this, you have to insert the polygon = fileattachment (json.). Then, once this is in you can go to properties and find one of the connecting variables. For me, this is GISJOIN. You add in the idAttribute where this comment is attached to.
Next, add the data to the file attachment. You can connect the different variables, including the idAttribute feature, GISJOIN. Now you can attach the CSV variables to test them against each other.
The geometries should be connected due to the attributes from the CSV file being joined (GISJOIN).