Public
Edited
Sep 26, 2023
1 fork
Insert cell
Insert cell
Insert cell
colorCategory = FileAttachment("colorCategory@1.json").json()
Insert cell
Plot.plot({
padding: 0,
width: 1000,
height: 800,
color: {
domain: Object.keys(colorCategory),
range: Object.values(colorCategory),
//legend: true,
},
legend: {
columns: 5,
rows: 3
},
y: {
label: "Color",
//reverse: false,
tickSize: 0,
axis: null,
//nice: true,
},
x: {
//nice: true,
label: "Year",
tickFormat: "",
interval: 2,
},
marks: [
Plot.cell(
data,
{
x: "year",
//y: "index_color",
y: (d) => parseInt(d.index_color),
fill: "color",
stroke: "white",
title: (d) => d.year + "\n" + d.color
}
)
],
tooltip: {
//fill: "red",
stroke: "blue",
r: 1
}
})

Insert cell
import {Plot} from "@mkfreeman/plot-tooltip"
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