To start this exercise, I reused the same dataset from Assignment 1 which included my TopoJSON file of Wisconsin county boundaries, and my csv file of county-level forest and land area attributes. I recreated the normalized variable than the previous one I had in exercise 1 (totalsurfacearea) and now used total forest percent (forest_pct) which is total forest acres/total acres. With this created, I was able to produce a ratio-level variable of 0 or 1 which will help me throughout this exercise where I have continuous and classified maps.
The first step that I took, outside of forking over exercise 1 and choosing a new normalized variable, I selected a sequential color to use from colorbrewer.org of Blues(3-class). I felt like this was the most appropriate color palette because I would have liked to use green to symbolize vegetation; however, that was the color palette used in the original lab. So in order to use a different color, I felt like blue was similar in representing vegetation in Wisconsin. Higher values in this dataset will be correlated to darker shades of blue, and I chose a sequential palette because it is ideal for unipolar ratio variables.
The next step I took was creating an Annex for myself that would include all of the javascript codes for this exercise. They are seen at the bottom of this document, but for chronological sake in this process I wanted to include it at the beginning. In the Annex I have javascript functions written out for numericSort, chart, and showScaleGrouping to help me move efficiently throughout the next steps.
To create the first mapping product of an unclassed (continuous) scale, I used the javascript function and entered in the linear function code (linear=d3.scaleLinear()) and set the domain and range seen. To touch on the first question asked in the assignment 2 instructions, a linear scale is used to map numeric input values into a clear and continuous color range, making the data easier to interpret. The domain includes all values from the min→ to the max of my normalized variable (forest_pct). The range was the output color scheme I chose which would be my shades of blue from colorbrewer.org. Which to briefly explain how this website works, after navigating to this website, I selected the sequential tab since that related the most to my data, chose a color scheme under the single-hue category, and then copy and pasted the corresponding ‘#color’ into my workspace.The scale is then used to interpolate smoothly between colors to convey results. I also generated 10 evenly spaced values that fall between the min. and max. of my data (forest_pct) and then applied the linear scale so I could see how the continuous colors behave. (Questions answered from assignment: 1 & 4)
Moving on to classified schemes, I chose to use 3 classes for all methods to ensure I could compare the results accurately across schemes. The number of classes is selected and subjected to data, in this case I only had around 74 entries, and therefore a large number of classes wasn’t needed to convey my results. If I used any more, I was afraid it would make my results more noisy and over-complex. My goal was to keep it simple and easily readable. (Question 2 & 3 answered here- Question 2 continues to be answered at the relevant classified method comments).
To create a Quantile classification I used the javascript code “quantile_scale=d3.scaleQuantile()”). The purpose behind this classification is so that each class can contain the same number of observations. The domain contains the full dataset, breaks/quantiles are divided into 3 classes. The color scale chosen, once again, was blue where the domain here is forest_pct) and the range is d3.schemeBlue(3).
To create a natural breaks classification I used the javascript code displayed. The purpose of this tool is to minimize variance occurring within classes, but maximize the variance occurring between classes. This is done by having the domain include the full dataset, have breaks be optimized clusters, which therefore makes these results slightly better for clustered and more uneven data. I continued to use my single-hue, 3 class, blue color scheme.
To create an Equal Interval classification I used the javascript code”quantize=d3.scaleQuantize()). The purpose of this result method is to divide the number range into equal sized bins. Here, the domain is the range from min. to max. values, the breaks are all evenly spaced, so this classification is better for evenly distributed data. For the color scheme here, I used a single-hue purple color palette with three classes at this step.
To create a manual classification I chose manual breaks based on the patterns shown from the histogram. To achieve this step, I identified that “forest_pct” is right skewed and that many counties looked like they were clustering below 0.3. Knowing that, I decided to double the threshold up to 0.8, which allows for me to determine jumps in the data for my interpretation of the results. This method also includes the maximum value. I continued with my single-hue blue color scheme here as well.
To answer the final question from the assignment 2 instructions, map values/classes to color scales are chosen by entering a javascript code of “d3.scaleThreshold().domain(breaks).range(colors) and that provides color scales. Then using the code of “colorScale(value)” it returns the correct color for that class.