How do you create an unclassed map on Observable?
By using the line of code linear= d3.scaleLinear() is the line of code that actually tells observable this map will be unclassed. The domain is used to tell the minimum and maximum value of the data. This can be done by using d3.min(data file name) which will find the minimum data point for you or you can type in a number as well (this also works the same for maximum). It should be noted that the brackets are used to tell that what's in between the parentheses is a list of things. The range is used for the visual variable which in the case is color. The rand acts like the domain because the first color listed is assigned to the minimum value and the second color listed is assignment to the greatest value. This means that everything in-between is a mix between the minimum and maximum colors according to how close they are. The chart function below is used just to make a visual chart of the map using the parentheses as: (data, type of classification).
How to use Equal Interval Classification?
First use the code = d3.scaleQuantize and then for the domain put in d3.min(data value name) for minimum value and the same for the maximum value used (same as what I did in unclassed). For the range, it is the same as equal interval which is the number of colors used equals the number of classes.
How to use natural breaks?
First type in the code = simple.ckmeans( data value name, number of classes wanted).map v. pop()). Also include .scaleThreshold because the breaks are almost manual because they are personal to the data unlike equal interval or quantile which is just a simple math formula. Then put in the colors for the range but make sure the number of colors used is equal to the number of classes and is in order from the min to max value.
How to use quantile?
First put in the code of d3.scaleQuantile() then put in the domain (data value used). After that put in the colors you want to use in the range but the number of different colors you choose will also be the number of classes represented in the data.
How do you use classification on Observable?
To use classification on observable you first have to pick which type of classification you want to use which depending on what you want will change the line of code used. You then fill out the domain line which just the file name so it has the data information or the max and min amount like how it was done on the unclassified map (again depends on the type of classification). Then the range value is used to display color and the order that the colors are will match up with the order of the values listed in the domain code ( so the first listed value of domain will match with the first listed color on the range).
How do you create and use colors on Observable? Explain how you map (scale) values to color schemes.
To create colors on observable just enter in a color name in the code that has the range (it will look like this: .range(["color","color2"]). You can do this by entering the color name like red or blue or going to a site like color brewer and finding the HEX number for each color and putting that instead of the name.