Published
Edited
Sep 1, 2020
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
yAxis = (g,scale, label) => {
g
.call(d3.axisLeft(scale).ticks(10).tickSize(width).tickFormat(d3.format("$.0f")))
.attr('transform', `translate(${margin.left + width+5}, 0)`)
.call(g => g.selectAll(".domain").remove())
g
.append("text")
.text(label)
.attr("fill", "#333")
.attr("text-anchor", "middle")
.style("font-size", 15)
.attr('transform', `translate(${margin.left*.5}, ${scale.range()[0]/2}) rotate(-90)`)

}
Insert cell
Insert cell
profitScale = d3.scaleLinear()
.domain([profitExtent[0] - profitExtent[1]*.1, profitExtent[1] + profitExtent[1]*.1])
Insert cell
partScale = d3.scaleLinear()
.domain([0, d3.max(data, d => +d.participants)])
Insert cell
Insert cell
hourScale = d3.scaleLinear()
.domain([hourExtent[0] - hourExtent[1]*.1, hourExtent[1] + hourExtent[1]*.1])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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