Public
Edited
Sep 26, 2023
2 forks
5 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
insetLeft: 20,
insetRight: 20,
insetTop: 70,
marks: [
Plot.barX([26.2], {fill: "orange", fillOpacity: 0.1}),
Plot.ruleY(bbc_devicestats, {x1: 0, x2: "CostOnStandby", y: "Device", sort: {y: "x", reverse: true}, stroke: "#008080", opacity: 0.8, strokeWidth: 40}),
Plot.image(bbc_devicestats, {x: -1 , y: "Device",width: 50, src: "deviceurl"}),
Plot.text(bbc_devicestats,{x: d => d.CostOnStandby - .1 , y: "Device", fill: "white", opacity: 1, textAnchor: "end", fontSize: 20, text: "Costchar"}),
Plot.text(bbc_devicestats,{x: d => d.CostOnStandby + .3 , y: "Device", fill: "black", opacity: 0.8, textAnchor: "start", fontSize: 17, text: "Device"}),
Plot.text(bbc_devicestats,{x: 25.5 , y: "Device", fill: "#008080", text: "fact", opacity: 0.4, textAnchor: "end", fontSize: 40, filter: d => d.Device === "Shower", lineHeight: 1.2}),
Plot.text(bbc_devicestats,{x: 25 , y: "Device", fill: "black", text: "titletop", opacity: 1, textAnchor: "end", fontSize: 40, filter: d => d.Device === "TV", dy: -70}),
Plot.text(bbc_devicestats,{x: 26 , y: "Device", fill: "gray", text: "source", opacity: 0.6, textAnchor: "end", fontSize: 20, filter: d => d.Device === "Phone Charger", dy: 30}),
Plot.ruleX([0]),
Plot.axisY({ tickSize: 0, fontSize: 0}),
Plot.axisX({ tickSize: 0, fontSize: 0}),
],
height: 800, width: 1200
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bbc_devicestats.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
cagefreepercentage.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
cagefreepercentage
select *, REPLACE(CAST(year as varchar(10)), '.0', '') as 'Year of Production'
from cagefreepercentage
Insert cell
textemojis = d3
.scaleOrdinal()
.domain(["Eggs", "Hens"])
.range(["🥚", "🐔"])
Insert cell
Insert cell
Hybrid.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
hybrid
select *, 50 as yval
from hybrid
order by orderx
Insert cell
dog_breed_ranks.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
breed_ranks
Select -1*value as value, value as value_abs, REPLACE(CAST(year as varchar(10)), '.0', '') as yearchar, *
from breed_ranks
Insert cell
Washington_migration.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
wamigration
with data as
(Select GeographyA, GeographyB, -1*NetBtoA as value, 'Net Migration' as Category
from wamigration
union all
Select GeographyA, GeographyB, BtoA as value, 'Entering the state' as Category
from wamigration
union all
Select GeographyA, GeographyB, -1*AtoB as value, 'Leaving the state' as Category
from wamigration
)
Select * from data
where GeographyB in ('California', 'Oregon', 'Arizona', 'Texas', 'Idaho', 'Florida', 'Colorado', 'New York', 'Illinois', 'Utah')
order by value desc
Insert cell
Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
states = topojson.feature(us, us.objects.states)
Insert cell
1950-2021_all_tornadoes.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
tornadoes
select *
from tornadoes I
where date >= ('2020-01-01')
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