Published
Edited
Aug 15, 2022
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
gistemp = FileAttachment("gistemp.csv").csv({typed: true})
Insert cell
Insert cell
Inputs.table(gistemp)
// 这是一个使用的例子,将上面加载进来的 csv 文件,显示为表格。
Insert cell
Insert cell
// 使用例子,将我们之前加载的 csv 文件用 plot 函数显示出来。
Plot.plot({
marks: [Plot.dot(gistemp, { x: "Date", y: "Anomaly" })]
})
Insert cell
Insert cell
viewof scheme = Inputs.select(["rdbu", "piyg", "rdgy"], {
label: "Color scheme"
})
Insert cell
// 使用 前面我们加载的 csv 进行画图。
// 并且将上面我们下拉框中 选择的内容用作 scheme 属性。
Plot.plot({
color: {
type: "diverging",
scheme: scheme,
reverse: true
},
marks: [Plot.dot(gistemp, { x: "Date", y: "Anomaly", stroke: "Anomaly" })]
})
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