sparkline = (type) =>
Plot.plot({
style: {
display: "inline-block",
marginBottom: -1,
overflow: "visible",
zIndex: 2,
position: "relative"
},
x: { axis: null },
y: { axis: null },
width: 50,
height: 15,
margin: 1,
marks: [
Plot.areaY(electricity, { x: "date", y: type, fillOpacity: 0.1 }),
Plot.lineY(electricity, { x: "date", y: type, tip: true })
]
})