Public
Edited
May 7
Insert cell
Insert cell
Insert cell
Insert cell
color1 = d3.scaleDiverging([-20, 0,20], d3.interpolateRdBu)
Insert cell
color2 = d3.scaleSequential([0, 10], d3.interpolateReds);
Insert cell
color1(5)
Insert cell
Bourse US - Depuis_mercredi.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
{
let data_bourse_s2 =
data_bourse.map(
function (d) {
let evolution_parsed = +(d.New_evo2.replace(',', '.').replace('%', ''))
let thisObj = {}
thisObj['ticker'] = d.ticker
thisObj['name'] = d.names
thisObj['Evolution'] = evolution_parsed
thisObj['color'] = color1(evolution_parsed)
return thisObj
})
const out = html`<div><p></p></div>`
yield out;
let this_text = (data_bourse_s2.map(d=> `${d.name}: ${d.color}`).join('<br>'))
out.querySelector("p").innerHTML=this_text
}
Insert cell
data_secteurs = FileAttachment("Bourse US - Feuille 4 (2).csv").csv()
Insert cell
{
let data_secteurs2 =
data_secteurs.map(
function (d) {
let evolution_parsed = +(d.Evolution.replace(',', '.').replace('%', ''))
let thisObj = {}
thisObj['secteur'] = d.secteur
thisObj['Evolution'] = evolution_parsed
thisObj['color'] = color1(evolution_parsed)
return thisObj
})
const out = html`<div><p></p></div>`
yield out;
let this_text = (data_secteurs2.map(d=> `${d.secteur}: ${d.color}`).join('<br>'))
out.querySelector("p").innerHTML=this_text
}
Insert cell
data_industries = FileAttachment("Bourse US - Feuille 5 (1).csv").csv()
Insert cell
{
let data_industries2 =
data_industries.map(
function (d) {
let evolution_parsed = +(d.Evolution.replace(',', '.').replace('%', ''))
let thisObj = {}
thisObj['Categorie'] = d.Categorie
thisObj['Evolution'] = evolution_parsed
thisObj['color'] = color1(evolution_parsed)
return thisObj
})
const out = html`<div><p></p></div>`
yield out;
let this_text = (data_industries2.map(d=> `${d.Categorie}: ${d.color}`).join('<br>'))
out.querySelector("p").innerHTML=this_text
}
Insert cell
Accidents du travail - Feuille 14@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
accidentsDuTravailFeuille14
Insert cell
{
let data_accidentsL =
accidentsDuTravailFeuille141.map(
function (d) {
let evolution_parsed = +(d.ratio.replace(',', '.').replace('%', ''))
let thisObj = {}
thisObj['Libelles'] = d.Typologie
thisObj['Evolution'] = evolution_parsed
thisObj['color'] = color2(evolution_parsed)
return thisObj
})
const out = html`<div><p></p></div>`
yield out;
let this_text = (data_accidentsL.map(d=> `${d.Libelles}: ${d.color}`).join('<br>'))
out.querySelector("p").innerHTML=this_text
}
Insert cell
Accidents du travail - Feuille 14@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
color2(7.486268607)
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