How do you determine the style, width and color of the polygon borders (outlines)?
I went to the code under legend that said svg.append and went to the attri() functions. The first line that says attr() determined the style and color (with the format being style, color). To determine the width, I put down to the attr() line that said "stroke-width", and after the comma I was able to put down a number to determine the width. The bigger the number the wider the outlines became.
How do you create a legend?
I created a legend by first importing legend by typing import {legend} from "@d3/color-legend". I then typed in legend ( which will take the code from the import) and then put ({}) and put in the following functions. I first put in color: color and the color function came from a line of code that contained the classification as the domain and then the range referring to another line of code (same one used in the natural breaks = code) which was blue scheme that listed all the colors needed in the proper order. I then put the title as the function data.title which refereed to this lien of code data = Object.assign(new Map(csv_data), {title: "% farmland"}). After that, I then put the tick format as .1f because I only wanted one decimal places but if I wanted more I could increase the number which would increase the decimal places.
How do the values get displayed when you hover over each polygon?
I did this by using the line of code that said .text (its one of the very last pieces of code) and then types in the value name which is percentage of farmland (in "" because it is string) I then used the data.get and put +d.protpeies.GEOID to associate the data value with the county.
What is SVG? How is it used in visualization?
SVG is coding website that lets you code different objects and this can be used to code points lines and polygons which is useful for GIS. This is used in visualization (especially for polygons) as a way to code polygons. The polygons used in the map were actually done by using SVG code.
How do you create and use colors on Observable? Explain how you map values to the fill colors of polygons?
I created colors on observable by simply typing in the name of the color using the function d3.colors(). I also can use more specific colors by going to color brewer and typing gin the HEX value of the color scheme I choose. I am able to fill colors into the polygon according to map values by using the classification function code. For this map, I choose natural breaks and within this code in the parenthesis I first named the value that I wanted to be classified. I listed blue scheme (the name of another line of code) to tell observable which colors I wanted to use. The blue scheme code had a list (in the order of least to greatest for data value) of colors that I wanted to use.
How do you join the geometries that come with the topojson file with the attributes that come with a csv file?
I joined the geometries of the topojson file with the attributes by using a value both data sets have in common. This happened to be GEOID. I actually joined them by listing GEOID (as numerical by using the +) in the code above to let observable know that the two data sets should be connected.