Public
Edited
Feb 26, 2023
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
grid: true,
width: 900,
marginLeft: 50,
x: {
label: "Timestamp (GMT)"
},
y: {
label: "Lux (Illuminance) — one lumen per square metre"
},
marks: [
Plot.ruleY([0]),
Plot.lineY(
temp1.filter((d) => d.lux > 0),
{ x: "ts", y: "lux" }
)
]
})
Insert cell
temp = obsSt
.map((d) => d.obs[0])
.map((d) => ({
ts: new Date(d[0] * 1000),
tempF: (d[7] * 9) / 5 + 32,
lux: d[9]
}))
Insert cell
temp
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
obsSt = h.ndjson(await FileAttachment("obs-st@11.json").text())
Insert cell
temp1 = wx.sql`SELECT
TO_TIMESTAMP(ts) AS ts,
(temperature * 9) / 5 + 32 AS tempF,
cast(illuminance AS DOUBLE) AS lux
FROM obs`
Insert cell
temp1
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
wx = DuckDBClient.of({
obs: FileAttachment("obs-st@3.parquet")
})
Insert cell
Insert cell
h = require("hrbrbox@0.1.4")
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