Public
Edited
Oct 31, 2022
1 star
Insert cell
Insert cell
import {data1} from "69f4a62c86868085"
Insert cell
import {data2} from "69f4a62c86868085"
Insert cell
import {data} from "69f4a62c86868085"
Insert cell
Plot.plot({
marginRight: 150,
height: 600,
inset: 10,
x: { tickFormat: String, label: "NutriScore (higher is less nutritious) →" },
y: {
type: "log",
ticks: [0.3, 1, 3, 10, 30],
tickFormat: String,
label: "↑ Environmental impact"
},
color: { legend: true },
marks: [
// Plot.voronoi(data, {
// x: "NutriScore_Scaled",
// y: "Tot_env_100g_scaled",
// fillOpacity: 0.2,
// fill: "Colour"
// }),
Plot.dot(data, {
x: "NutriScore_Scaled",
y: "Tot_env_100g_scaled",
fill: "Colour"
}),
Plot.text(data, {
x: "NutriScore_Scaled",
y: "Tot_env_100g_scaled",
fill: "Colour",
text: "Aisle",
dx: 4,
textAnchor: "start"
})
]
})
Insert cell
Insert cell
vegs = FileAttachment("vegs.csv").csv()
Insert cell
fruits = FileAttachment("fruits.csv").csv()
Insert cell
Plot.plot({
marks: [
Plot.dot(fruits, {x: "energy (kcal/kJ)", y: "water (g)"}),
Plot.text(fruits, {text: "name", x: "energy (kcal/kJ)", y: "water (g)", dy: -8})
]
})
Insert cell
Plot.plot({
marks: [
Plot.dot(vegs, {x: "energy (kcal/kJ)", y: "water (g)"}),
Plot.text(vegs, {text: "name", x: "energy (kcal/kJ)", y: "water (g)", dy: -8})
]
})
Insert cell
Insert cell
cropswater1 = FileAttachment("cropswater@1.csv").csv()
Insert cell
Plot.plot({
marks: [
Plot.dot(cropswater1, {x: "min(mm)", y: "max(mm)"}),
Plot.text(cropswater1, {text: "Crops", x: "min(mm)", y: "max(mm)", dy: -8})
]
})
Insert cell
cropsdays = FileAttachment("cropsdays.csv").csv()
Insert cell
Plot.plot({
marks: [
Plot.dot(cropsdays, {x: "mindays", y: "maxdays"}),
Plot.text(cropsdays, {text: "Crop", x: "mindays", y: "maxdays", dy: -8})
]
})
Insert cell
Insert cell
temp = FileAttachment("temp.csv").csv()
Insert cell
Plot.plot({
marks: [
Plot.dot(temp, {x: "Month", y: "Max Temp"}),
Plot.text(temp, {text: "Month", x: "Month", y: "Max Temp", dy: -8})
]
})
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