Un aperçu des métadonnées de la presse numérisées
Informations du catalogue général
Code
Code
Volumétrie des fascicules sur Gallica
Code
{
const data = await db.query(`
SELECT
COUNT(*) AS Fascicules,
COUNT(*) FILTER (WHERE meta.ocr_mean) AS 'Fascicules OCRisés',
COUNT(*) FILTER (WHERE meta.intramuros) AS Intramuros,
COUNT(*) FILTER (WHERE meta.retronews) AS Retronews,
MIN(date.year) AS 'Date début',
MAX(date.year) AS 'Date de fin',
FROM
fascicules
WHERE
ark_catalogue= ?
`, [ark])
return Inputs.table(data, {locale:"fr"})
}Code
{
const data = await db.query(`
SELECT
date.year AS Année,
COUNT(*) AS Fascicules,
COUNT(*) FILTER (WHERE meta.ocr_mean) AS 'Fascicules OCRisés',
COUNT(*) FILTER (WHERE meta.intramuros) AS Intramuros,
COUNT(*) FILTER (WHERE meta.retronews) AS Retronews,
FROM
fascicules
WHERE
ark_catalogue= ?
GROUP BY
date.year
ORDER BY date.year
`, [ark])
//| label: fig-lacroix-ocr
//| fig-cap: "Répartition du taux d'OCR moyen pour le journal La Croix"
return Plot.plot({
...theme,
grid: true,
color: {
legend: true,
domain: ["#dbc257", "#db5f57"],
range: ["#dbc257", "#db5f57"],
tickFormat: (d) =>
d === "#dbc257"
? "Fascicules OCRisés"
: d === "#db5f57"
? "Fascicules"
: "you shouldn't be here"
},
marks: [
Plot.lineY(data,
{
x:"Année",
y:"Fascicules OCRisés",
curve: "catmull-rom",
marker:"circle-stroke",
tip:"x",
stroke:"#dbc257"
}
),
Plot.lineY(data,
{
x:"Année",
y:"Fascicules",
curve: "catmull-rom",
marker:"circle-stroke",
tip:"x",
stroke:"#db5f57",
label: "Nombre de fascicules total"
}),
Plot.axisX(
{
anchor: "bottom",
marginBottom:60,
tickSpacing: 80,
tickFormat: ".2d"
}),
],
})
}Qualité de l’OCR
Code
{
const data = await db.query(`
SELECT
date.year,
meta.ocr_mean
FROM
fascicules
WHERE
ark_catalogue= ?
AND meta.ocr_mean
`, [ark])
return Plot.plot({
...theme,
grid: true,
x:{label:"OCR Moyen (%)"},
y:{label:"Nombre de fascicules"},
marks: [
Plot.rectY(
data,
Plot.binX({y:"count"},{x: "ocr_mean",tip:"x"})),
Plot.ruleY([0]),
Plot.axisX(
{
anchor: "bottom",
marginBottom:40,
tickSpacing: 80,
}),
Plot.axisY(
{
marginLeft:50,
tickSpacing: 80,
tickFormat: ".2d",
}),
]
})
}Code
{
const data = await db.query(`
SELECT
date.year,
meta.ocr_mean
FROM
fascicules
WHERE
ark_catalogue= ?
AND meta.ocr_mean
`, [ark])
return Plot.plot({
...theme,
grid: true,
color: { zero: true, scheme: "Cividis",legend:true},
width:800,
height:1500,
facet:{
data: data,
marginLeft: 80,
y: "year",
},
x:{label:"OCR Moyen (%)", axis:"both"},
marks:[
Plot.barX(
data,
Plot.binX({fill:"proportion-facet"},
{
x:"ocr_mean",
tip:"x",
sort:{x:"fill"}
}
)
),
Plot.axisX(
{
anchor: "bottom",
marginBottom:40,
tickSpacing: 80,
}),
]
})
}