Public
Edited
Aug 7, 2023
Insert cell
Insert cell
viewof companiesRaw = Inputs.file({ label: "Companies list", accept: ".csv", required: true})
Insert cell
viewof metricsRaw = Inputs.file({ label: "Metrics Data", accept: ".csv", required: true })
Insert cell
Insert cell
metrics = metricsRaw.csv({ typed: true })
Insert cell
data = // Join the labels into the data, this is useful to get the categories on the data
metrics.map(d => {
const labels = companies.get(d.ciqId);

return { ...d, ...labels, year: 2023 - d.timing };
})
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
marginBottom: 110,
marginLeft: 50,
x: { tickRotate: 90 },
y: { grid: true, domain: [-0.2,0.5], ticks: 5 },
marks: [
Plot.boxY(
dataNot10,
{ fx: "timing", x: "category1", y: "roic" }
)
]
})
Insert cell
Plot.plot({
marginBottom: 50,
marginLeft: 50,
marginRight: 100,
x: { tickRotate: 90 },
y: { grid: true },
marks: [
Plot.line(
data,
{ ...grouped, strokeWidth: 3 }
),
Plot.text(
data,
Plot.selectLast({ ...grouped, stroke: "none", textAnchor: "start", dx: 5 })
)
]
})
Insert cell
normalized = Plot.map({ y: Plot.normalize("last") }, { x: "year", y: "revenue", z: "ticker" })
Insert cell
grouped = Plot.groupX(
{ x: "first", y: "mean", stroke: "first", text: "first" },
{ ...normalized, z: "category2", stroke: "category2", text: "category2" }
)
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