Public
Edited
Feb 24, 2023
1 fork
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
svg`<svg width=16 height=16>
<circle cx=8 cy=8 r=4></circle>
</svg>`
Insert cell
Insert cell
import { ramp } from "@mbostock/ramp"
Insert cell
plasma = d3.interpolatePlasma
Insert cell
ramp(plasma)
Insert cell
Insert cell
Insert cell
svg`<svg width=${width} height=60>
${circles.map(
(d, i) => svg`
<circle
cx=${8 + i * (d3.max(circles) * rMultiplier * 2)}
cy=30
r=${d * rMultiplier}
fill=${plasmify ? plasma(i / (circles.length - 1)) : "#000"}
></circle>
`
)}
</svg>`
Insert cell
Insert cell
viewof rMultiplier = Inputs.range([1, 6], { value: 3 })
Insert cell
Insert cell
viewof plasmify = Inputs.toggle({ label: "Plasmify", value: false })
Insert cell
Insert cell
moment = require("moment")
Insert cell
dj2023 = moment.duration(moment("2023-02-01T00:00:00").diff(moment(now)))
Insert cell
Insert cell
Insert cell
Insert cell
athletes = FileAttachment("athletes.csv").csv({ typed: true })
Insert cell
athletes
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
dotplot = Plot.dot(athletes, { x: "weight", y: "height", stroke: "sex" }).plot()
Insert cell
dotplot.legend("color")
Insert cell
Plot.rect(
athletes,
Plot.bin({ fillOpacity: "count" }, { x: "weight", y: "height", fill: "sex" })
).plot()
Insert cell
Plot.plot({
grid: true,
marks: [
Plot.rectY(
athletes,
Plot.binX({ y: "count" }, { x: "weight", fill: "sex", fy: "sex" })
),
Plot.ruleY([0])
]
})
Insert cell
Plot.plot({
x: { label: "medal count" },
marks: [
Plot.barX(
athletes,
Plot.groupY(
{ x: "count" },
{ y: "nationality", sort: { y: "x", reverse: true, limit: 10 } }
)
),
Plot.ruleX([0])
]
})
Insert cell
Insert cell
chart
Insert cell
import { chart } from "@d3/bivariate-choropleth"
Insert cell
map
Insert cell
import { map } from "@neocartocnrs/bars-pubs-in-paris"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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