Public
Edited
Apr 5, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Voici du texte en *italic* ou en __gras__ avec un [lien](https://observablehq.com/).
Insert cell
Insert cell
c = \pm\sqrt{a^2 + b^2}
Insert cell
Insert cell
<div>ceci est du texte surligné en <span style="background-color:tomato; color:white">rouge</span>.</div>
Insert cell
<canvas id="myCanvas" width="100" height ="100" style="border:1px
solid #000000; background-color: steelblue;"></canvas>
Insert cell
Insert cell
Insert cell
a = 10
Insert cell
b = 20
Insert cell
c = a + b
Insert cell
Insert cell
d = {
let a = 8;
let b = 7;
return a * b;
}
Insert cell
Insert cell
function sum(a, b) {
return a + b;
}
Insert cell
sum(10, 30)
Insert cell
multi = (a, b) => a * b
Insert cell
multi(3, 8)
Insert cell
Insert cell
result = val1 * val2
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, 500, 60])
.style("background-color", "#CCC");

let moncercle = svg
.append("circle")
.attr("cx", 50)
.attr("cy", 30)
.attr("r", 25)
.attr("fill", "#e04a28");

if (anim) {
moncercle
.transition()
.duration(2000)
.attr("cx", 450)
.transition()
.delay(2000)
.duration(3000)
.attr("cx", 50)
.attr("r", 10)
.attr("fill", "blue")
.transition()
.attr("r", 25)
.attr("fill", "#e04a28");
}
return svg.node();
}
Insert cell
Insert cell
Insert cell
geo = require("geotoolbox")
Insert cell
Insert cell
Insert cell
viewof button = Inputs.button("Click me")
Insert cell
button
Insert cell
viewof colors = Inputs.checkbox(["red", "green", "blue"], { label: "color" })
Insert cell
colors
Insert cell
viewof rayon = Inputs.range([0, 100], { label: "Rayon du cercle", step: 1 })
Insert cell
surface = Math.PI * rayon ** 2
Insert cell
viewof text = Inputs.text({ value: "text" })
Insert cell
Voici mon texte (<ins>**${text}**</ins>) en gras et souligné en markdown
Insert cell
Insert cell
viewof col = Inputs.color({ label: "couleur", value: "#4682b4" })
Insert cell
viewof cx = Inputs.range([50, 450], {label: "position", step: 1})
Insert cell
viewof r = Inputs.range([10, 30], { label: "rayon", step: 1 })
Insert cell
{
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, 500, 60])
.style("background-color", "#CCC");

svg
.append("circle")
.attr("cx", cx)
.attr("cy", 30)
.attr("r", r)
.style("fill", col);

return svg.node();
}
Insert cell
Insert cell
Insert cell
manifs = FileAttachment("manifs_retraites-2-1-1-1.csv").csv({ typed: true })
Insert cell
Insert cell
Inputs.table(manifs)
Insert cell
Insert cell
manifs_retraites-2-1-1-1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
world = FileAttachment("world.json").json()
Insert cell
Insert cell
Insert cell
Insert cell
viewof csvfile = Inputs.file({
label: "CSV file",
accept: ".csv",
required: true
})
Insert cell
Inputs.table(csvfile.csv())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
nborg = manifs
.map((d) => ({ date: d.date, nombre: +d.organisateurs }))
.filter((d) => d.nombre > 1000)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
manifs
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
newmanifs
Insert cell
Insert cell
Insert cell
Insert cell
dt.array("ISO3")
Insert cell
dt.rename({ ISO3: "id" }).objects()
Insert cell
dt.select("NAMEen", "region").objects()
Insert cell
dt.derive({ pdppercapita: (d) => d.gdp / d.pop }).objects()
Insert cell
dt.orderby("pop").objects()
Insert cell
summary = dt
.rollup({
min: (d) => aq.op.min(+d["pop"]),
max: (d) => aq.op.max(+d["pop"]),
mean: (d) => aq.op.mean(+d["pop"]),
median: (d) => aq.op.median(+d["pop"]),
sum: (d) => aq.op.sum(+d["pop"]),
stdev: (d) => aq.op.stdev(+d["pop"]),
count: (d) => aq.op.count()
})
.fold(aq.range(0, 7))
Insert cell
Insert cell
Insert cell
Insert cell
maddison.csv
select "country", "pop" from "maddison.csv" where "year" = 2010 order by "pop" desc
Insert cell
mydata[0].toJSON()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tbl = FileAttachment("mydata.csv").csv({ typed: true })
Insert cell
Plot.plot({
marks: [Plot.dotX(tbl, Plot.dodgeY({ x: "gdppc", fill: "black" }))],
height: 450
})
Insert cell
Plot.plot({
grid: true,
marginLeft: 50,
facet: {
data: tbl,
y: "region"
},
marks: [Plot.boxX(tbl, { x: "gdppc", fill: "red" })]
})
Insert cell
Insert cell
Insert cell
manifs
X
date
Y
organisateurs_paris
Color
#ff5375
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
bertin = require("bertin")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
choro = bertin.draw({
params: { projection: "Eckert3" },
layers: [
{
type: "layer",
geojson: world,
fill: {
type: "choro",
values: "gdppc",
nbreaks: nbreaks,
method: method,
//pal: pal,
colors: pal,
leg_round: -2,
leg_title: `GDP per inh
(in $)`,
leg_x: 100,
leg_y: 200
},

tooltip: ["$name", "$gdppc", "(current US$)"]
},
{ type: "graticule" },
{ type: "outline" }
]
})
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
autralia = FileAttachment("autralia.geojson").json()
Insert cell
import { sketch } from "@neocartocnrs/cartographic-doodles"
Insert cell
Insert cell
Insert cell
s = sketch(autralia, {
paper: true,
k: 0.05,
stroke: "none",
fill: "#193c75",
overflow: true,
roughness: roughness,
hachureGap: 2.5,
fillWeight: 0.5,
fillStyle: "zigzag",
bowing: bowing
})
Insert cell
Insert cell
import { SummaryTable } from "@observablehq/summary-table"
Insert cell
SummaryTable(manifs)
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