Public
Edited
Apr 9, 2024
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chart = {

const svg = d3.select(DOM.svg(width, height));

svg.selectAll('path')
.data([data])
.enter()
.append('path')
.attr('d', (d) => line(d))
.attr("stroke-width", 2)
.attr('stroke', "steelblue")
.attr('fill', "none");

svg.append("path")
.attr("fill", "#ccc")
.attr("fill-opacity", 0.75)
.attr("stroke", "none")
.attr("d", area(selectedArea));
svg.append("g").call(xAxis);

svg.append("g").call(yAxis);

return svg.node()
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
format = d3.format(".1%")
Insert cell
area = d3.area()
.x(d => x(d.x))
.y0(d => y(0))
.y1(d => y(d.y)+1)
Insert cell
Insert cell
Insert cell
table = d3.csvParse(await FileAttachment("chi@3.csv").text(), ({df, chi, value}) => ({df: +df, chi: +chi, value: +value}))
Insert cell
Insert cell
Insert cell
Insert cell
import {plot} from "@toja/histogram-with-normal-distribution"
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