Public
Edited
Oct 12, 2023
Importers
4 stars
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.line(sftemp.slice(-90, -10), {
x: "date",
y: "high",
stroke: "red",
marker: (color) => htl.svg`<marker
viewBox="-4 -4 8 8"
style="overflow: visible; fill-opacity: 0.2;"
><ellipse rx=20 ry=8 stroke="${color}" fill="${color}">`
}),
]
})
Insert cell
Insert cell
tick = (size = 5) =>
(color) =>
htl.svg`<marker
viewBox="${-size} ${-size} ${2 * size} ${2 * size}"
markerWidth=${2 * size}
markerHeight=${2 * size}
stroke-linecap=square
orient=auto
stroke=${
"red" // Using "red" for visibility, normally you would use color, as above
}
><line y1=${-size} y2=${size}>`
Insert cell
Plot.plot({
inset: 10,
marks: [
Plot.line(sftemp.slice(-90, -10), {
x: "date",
y: "high",
stroke: "currentColor",
markerEnd: tick(5)
})
]
})
Insert cell
Plot.plot({
inset: 20,
marks: [
Plot.line(d3.range(0, 2*Math.PI, 0.05), {
x: Math.sin,
y: d => Math.cos(3*d),
curve: "basis-closed",
stroke: "currentColor",
marker: tick(5)
})
]
})
Insert cell
sftemp = FileAttachment("sf-temperatures.csv").csv({typed: true})
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more