Public
Edited
Mar 15, 2023
Insert cell
Insert cell
VDreponses = FileAttachment("VDreponses4.csv").csv({typed: true})
Insert cell
viewof view1 = Inputs.table(VDreponses)
Insert cell
{
const [Horodateur, Nom, Diplome, Visualisation, Exemples, Attentes, Supplement, Consentement, Annee, Ville, OS, Langage, Motivation] = []
return VDreponses.columns
}
Insert cell
viewof date = Inputs.date({label: "Start", value: "2023-02-22"})
Insert cell
viewof time = Inputs.datetime({label: "Start", value: "2023-02-22T08:40Z"})
Insert cell
// YYYY-MM-DDTHH:mm:ss.sssZ

dates = VDreponses.map(reponse => {
const datetime = reponse.Horodateur.split(" ")
let [year, month, day] = datetime[0].split(".").reverse()
if (year < 100) {
year = Number(year) + 2000
}
const date = `${year}-${month}-${day}`
let [hour, minute, second] = datetime[1].split(":")
if (typeof second === "undefined") {
second = "00"
}
let remaining = null
if (second.includes(".")) {
[second, remaining] = second.split(".")
}
const time = (remaining) ?
`${hour}:${minute}:${second}.${remaining}Z`
:`${hour}:${minute}:${second}Z`
return new Date(`${date}T${time}`)
})
Insert cell
dates
Insert cell
_ = require("lodash")
Insert cell
delays = dates.map(x => (x - new Date("2023-02-22T09:30Z")) / 1000 / 60)
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.dotY(VDreponses, {x: "Nom", y: "Annee", fill: "Annee", label: "Annee", sort: {x: "y"}}),
Plot.text(VDreponses, {x: "Nom", y: "Annee", text: "Annee"}),
Plot.ruleY([d3.min(VDreponses.map(r => r.Annee))]),
],
style: {
background: d3.hsl(0,0,0.25),
color: "whitesmoke",
strokeWidth: 0.6,
},
y: {
label: "Année",
axis: null,
},
color: {
type: "categorical",
scheme: "accent",
},
marginTop: 60,
marginBottom: 50,
})
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(VDreponses, {x: "Nom", y: delays, fill: VDreponses, sort: {x: "y", reverse: false}}),
Plot.ruleY([0]),
],
style: {
background: d3.hsl(0,0,0.25),
color: "whitesmoke",
strokeWidth: 0.6,
},
caption: "Meilleur en bas",
y: {
label: "t (min)",
},
color: {
type: "categorical",
scheme: "accent",
},
marginTop: 60,
marginBottom: 50,
})
Insert cell
diplomes = _.partition(VDreponses, r => r.Diplome.toUpperCase().includes("CFC"))

Insert cell
VDdiplomes = [
{diplome: "CFC", count: diplomes[0].length},
{diplome: "Autre", count: diplomes[1].length},
]
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.barY(VDdiplomes, {x: "diplome", y: "count", fill: "diplome", sort: {x: "y", reverse: false}, sort: {x: "y", reverse: true}}),
Plot.text(VDdiplomes, {x: "diplome", y: "count", text: "count", dy: -10}),
Plot.ruleY([0]),
],
style: {
background: d3.hsl(0,0,0.25),
color: "whitesmoke",
strokeWidth: 0.6,
},
x: {
label: "Diplome",
},
y: {
nice: true,
ticks: 3,
padding: 0,
margin: 0,
label: "Total",
axis: null,
},
color: {
type: "categorical",
scheme: "accent",
},
marginTop: 50,
})
Insert cell
windows = _.partition(VDreponses, r => r.OS.toLowerCase().includes("windows"))[0]
Insert cell
linux = _.partition(VDreponses, r => r.OS.toLowerCase().includes("linux"))[0]
Insert cell
macos = _.partition(VDreponses, r => r.OS.toLowerCase().includes("macos"))[0]
Insert cell
VDoses = [
{os: "Windows", count: windows.length},
{os: "GNU/Linux", count: linux.length},
{os: "MacOS", count: macos.length}
]
Insert cell
Plot.plot({
marks: [
Plot.barY(VDoses, {x: "os", y: "count", fill: "os", sort: {x: "y", reverse: false}, sort: {x: "y", reverse: true}}),
Plot.text(VDoses, {x: "os", y: "count", text: "count", dy: -10}),
Plot.ruleY([0]),
],
style: {
background: d3.hsl(0,0,0.25),
color: "whitesmoke",
strokeWidth: 0.6,
},
x: {
label: "OS",
},
y: {
nice: true,
ticks: 3,
padding: 0,
margin: 0,
label: "Total",
axis: null,
},
color: {
type: "categorical",
scheme: "accent",
},
marginTop: 50,
})
Insert cell
VDlangages = [
{lang: "Enseignés dans l'école", count: VDreponses.length},
{lang: "Non enseignés dans l'école", count: 2},
]
Insert cell
Plot.plot({
marks: [
Plot.barY(VDlangages, {x: "lang", y: "count", fill: "lang", sort: {x: "y", reverse: false}, sort: {x: "y", reverse: true}}),
Plot.text(VDlangages, {x: "lang", y: "count", text: "count", dy: -10}),
Plot.ruleY([0]),
],
style: {
background: d3.hsl(0,0,0.25),
color: "whitesmoke",
strokeWidth: 0.6,
},
caption: "Tendances en matière de langage de programmation",
x: {
label: "Langages",
},
y: {
nice: true,
ticks: 3,
padding: 0,
margin: 0,
label: "Total",
axis: null,
},
color: {
type: "categorical",
scheme: "accent",
},
marginTop: 50,
})
Insert cell
Insert cell
htl.html`<iframe src="https://www.google.com/maps/d/embed?mid=1HDKfqIx-_h17FXL03m9dbyocPkFkjTs&ehbc=2E312F" width="640" height="480"></iframe>`
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