// Seems like I can't change the underlying names of the columns
electric_by_day=Inputs.table(
d3.rollup(
electric,
(daily_total)=>d3.sum(daily_total,(d)=>d.Usage),
(usage_date)=>usage_date.Startdate
),
{
columns:["0","1"],
header:{
0:"usage_date",
1:"daily_usage_kwh"
}
}
)
// sigh. I give up. have tried like 10 things. I don't understand the syntax here. Observable seems to require / assume engineer-level javascript.
Plot.plot({
marks:[
Plot.ruleY([0]),
Plot.lineY(electric_by_day,{
x:electric_by_day["0"],
y:electric_by_day["1"]
})
]
})
Plot.plot({
marks:[
Plot.line(electric_by_day,{x:"0",y:"1"})
// Plot.ruleY([0])
],
width
})
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.