Public
Edited
Dec 19, 2023
Insert cell
Insert cell
bd_observable_csv = FileAttachment("BD_Observable_CSV.csv").csv({ typed: true })

Insert cell
DT = d3.dsv(";", await FileAttachment("BD_Observable_CSV.csv").url(), d3.autoType)
Insert cell
DT
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
DT
SELECT "ID_T", "origine", "destination", "Trajet", "Vecteur 1", "Télétravail", "Echelle" FROM "DT"
Insert cell
data4
X
Télétravail
Y
Color
Télétravail
Size
Facet X
Vecteur 1
Facet Y
Mark
Auto
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
DT
SELECT Télétravail,
"Vecteur 1",
COUNT(*) AS Nombre_de_transport
FROM DT
GROUP BY Télétravail, "Vecteur 1";

Insert cell
data
X
Télétravail
Y
Nombre_de_transport
Color
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
DT
SELECT
"Vecteur 1",
COUNT(CASE WHEN Télétravail = 1 THEN 1 END) AS Nombre_transport_teletravail_1,
COUNT(CASE WHEN Télétravail = 0 THEN 1 END) AS Nombre_transport_teletravail_0
FROM
DT
GROUP BY
"Vecteur 1";

Insert cell
DT
X
Vecteur 1
Y
Nombre_transport_teletravail_1
Color
Size
Facet X
Facet Y
Mark
bar
Type Chart, then Shift-Enter. Ctrl-space for more options.

Insert cell
DT
SELECT
ID_T, "Vecteur 1" as v1, "Télétravail" as tele
FROM
DT;
Insert cell
Plot.plot({
marginBottom: 100,
fx: {padding: 0, label: null, tickRotate: 90, tickSize: 6},
x: {axis: null, paddingOuter: 0.2},
y: {grid: true},
color: {type: "categorical", scheme: "Category10", legend: true},
marks: [
Plot.barY(data4, Plot.groupX({y2: "count"}, {x: "tele", fx: "v1", fill: "tele"})),
Plot.ruleY([0])
]
})
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