Published unlisted
Edited
Mar 15, 2022
1 star
Insert cell
Insert cell
Insert cell
data = FileAttachment("texasHourTempEnergy.csv").csv({ typed: true })
Insert cell
Insert cell
Changed in target
viewof selectTimes = Inputs.select(
-
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+
d3.range(0, 24),
{ multiple: true, label: "Select times (control-click for multiple selections)" } )
Insert cell
Changed in target
// Type code here Plot.plot({ marks: [ Plot.dot(data, { x: "temp", y: "demand", fill: "lightgrey", fillOpacity: 0.2, r: 2 }), Plot.dot(data, {
-
filter: (d) => d.hour == selectTimes,
+
filter: (d) => selectTimes.includes(d.hour),
x: "temp", y: "demand", fill: "hour", fillOpacity: 0.8, r: 3 }) ], marginLeft: 60 })
Insert cell
Insert cell
Insert cell
Insert cell
import {
Q,
A,
styles
} with { renderSnippetOverride as renderSnippet } from "@observablehq/plot-exploration-penguins"
Insert cell
styles
Insert cell