Public
Edited
Jun 3, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
(line.radius((d) => {
return y(d.hsMean);
})(data)).split("L").map(d => d.split(','))
Insert cell
viewof selectionYear = Inputs.range([2006, 2023], {value: 2022, step: 1, label: "Year"})
Insert cell
outerRadius = width / 2 - margin
Insert cell
innerRadius = width / 5
Insert cell
margin = 10
Insert cell
height = width
Insert cell
line = d3
.lineRadial()
.curve(d3.curveLinear)
.angle((d) => {
return x(d.dayOfYear);
})
Insert cell
y(1)
Insert cell
y = d3
.scaleLinear()
.domain([d3.min(data, (d) => d.hsMin), d3.max(data, (d) => d.maxMax)])
.range([innerRadius, outerRadius])
Insert cell
x = d3
.scaleLinear()
.domain([1, 366])
.range([0, 2 * Math.PI])
Insert cell
area = d3
.areaRadial()
.curve(d3.curveBasis)
.angle((d) => x(d.dayOfYear))
Insert cell
data = rawdata.filter(d => d.year === selectionYear)
Insert cell
rawdata = FileAttachment("dailySubset.json").json()
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