Public
Edited
Jan 29
1 fork
Comments locked
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Ceci est une *cellule* **Markdown** ! Cliquez sur l'icône avec 4 lignes pour changer son type !
Insert cell
a = 'Ceci est une cellule JavaScript !'
Insert cell
// Une autre cellule JavaScript
function add(a, b) {
return a + b;
}
Insert cell
<p>Ceci est une cellule <i>HTML</i>
Insert cell
<svg width="200" height="100">
<ellipse rx="20" ry="14" cx="80" cy="30" fill="lightgreen" stroke="black" stroke-width="2.5"></ellipse>
<text y="70" font-size="14">
<tspan x="20" >Ceci est une cellule HTML</tspan>
<tspan x="20" dy="14">contenant un élément SVG</tspan>
</text>
</svg>
Insert cell
Insert cell
Insert cell
Insert cell
// Cette instruction va renvoyer l'erreur "SyntaxError: Unexpected token", mais n'empêche pas les autres cellules de fonctionner
,dfksdhgffgghfujfy
Insert cell
Insert cell
Insert cell
result = n1 + n2
Insert cell
n1 = 123
Insert cell
n2 = 13
Insert cell
Insert cell
c1 = c2 + 1
Insert cell
c2 = c1 + 1
Insert cell
Insert cell
dd = 12
Insert cell
dd = 19
Insert cell
Insert cell
randomVal = Math.random()
Insert cell
result2 = randomVal * 2 // Mis à jour automatiquement quand "randomVal" change
Insert cell
Insert cell
Insert cell
fetch('https://jsonplaceholder.typicode.com/todos/1').then((d) => d.json())
Insert cell
Insert cell
await fetch('https://jsonplaceholder.typicode.com/todos/1').then((d) => d.json())
Insert cell
Insert cell
// Sans await
fetch('https://jsonplaceholder.typicode.com/todos/1').then((d) => d.json()).title
Insert cell
// Avec await
(await fetch('https://jsonplaceholder.typicode.com/todos/1').then((d) => d.json())).title
Insert cell
Insert cell
'Ceci est une chaine de caractères'.split(' ')
Insert cell
Insert cell
variable = 12
Insert cell
Insert cell
{
const v = 'Ceci est une chaine de caractères';
let result = 0;
v.split('').forEach((char) => {
if (char === 'e') {
result += 1;
}
});
return `Il y a ${result} fois la lettre 'e'`;
}
Insert cell
Insert cell
res = {
const v = 'Ceci est une chaine de caractères';
let result = 0;
v.split('').forEach((char) => {
if (char === 'e') {
result += 1;
}
});
return `Il y a ${result} fois la lettre 'e'`;
}
Insert cell
Insert cell
pier = ({
age: 12,
name: 'Pier'
})
Insert cell
Insert cell
Insert cell
function sum(a, b) {
return a + b;
}
Insert cell
Insert cell
width
Insert cell
Insert cell
viewof n = Inputs.range([0, 255], {step: 1, label: "A number to be squared"})
Insert cell
`n au carré = ${n ** 2}`
Insert cell
viewof s = Inputs.select(['Entry 1', 'Entry 2', 'Entry 3'], {step: 1, label: "Select one item"})
Insert cell
The current item is: *${s}*
Insert cell
viewof checkboxes = Inputs.checkbox(["A", "B"], {label: "Select some", value: ["A"]})
Insert cell
checkboxes.map((d) => `La boite ${d} est sélectionnée`)
Insert cell
Insert cell
Insert cell
Inputs.table(olympians)
Insert cell
Insert cell
{
// On retourne 1 mais le code continue d'être exécuté ensuite
yield 1;
// On attend 1.5s
await Promises.delay(1500);
// Etc..
yield 2;
await Promises.delay(1500);
yield 3;
}
Insert cell
Insert cell
Insert cell
Insert cell
d3.schemeBuPu[5]
Insert cell
Insert cell
Plot.plot({
inset: 10,
title: 'Un graphique',
marks: [
Plot.dot([[1, 2], [1.4, 5], [2, 4], [2.5, 8], [3, 6], [3.5, 3], [4, 6], [5, 9]], { stroke: 'red' }),
Plot.frame()
]
})
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more