Public
Edited
Sep 14, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
HTL-MAR-FiddlerCrabBodySize.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
crabs[0]
Insert cell
Insert cell
Insert cell
crabsJS = crabs.map(d => ({lat: d.Latitude,
site: d["Site "],
sizeMm: d.carapace_width,
airTempC: d.MATA,
waterTempC: d.MATW
}))
Insert cell
Insert cell
Insert cell
Insert cell
crabsJS
X
airTempC
Y
sizeMm
Color
#ff77a7
Size
Facet X
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Plot.plot({
color: { legend: true },
x: { label: "Air Temperature (c)" },
y: { label: "Carapace Size (mm)" },
marks: [
Plot.dot(crabsJS, {
x: "airTempC",
y: "sizeMm",
fill: function (d) { return d.waterTempC >= pickSize ? "steelblue" : "grey"},
r: 6,
opacity: 0.5,
tip: true
})
]
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ML = require("https://www.lactame.com/lib/ml/6.0.0/ml.min.js")
Insert cell
Insert cell
crabsLM = new ML.SimpleLinearRegression(
crabsJS.map(d => d.lat),
crabsJS.map(d => d.sizeMm))
Insert cell
The slope es ${crabsLM.slope.toFixed(3)}.
Insert cell
Insert cell
Plot.plot({
marginLeft: 30,
marks: [
Plot.dot(crabsJS, {x: "lat", y: "sizeMm", tip: true, fill: "steelblue"}),
Plot.linearRegressionY(crabsJS, {x: "lat", y: "sizeMm", stroke: "orange"}),
Plot.frame()
],
x : {label: "Latitude", labelOffset : 25},
y : {label: "Size (mm)"}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
maxTemp = d3.max(crabsJS, (d) => d.waterTempC)
Insert cell
minTemp = d3.min(crabsJS, function(d) {
return d.waterTempC;
});
Insert cell
tempMin = d3.min(crabsJS.map(d => d.waterTempC))
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more