From e19e3aeb968112641cdeec4fcee50453bc20473c Mon Sep 17 00:00:00 2001 From: alexture Date: Fri, 21 Aug 2026 19:52:19 +0200 Subject: [PATCH] =?UTF-8?q?Initial=20commit:=20spec=20+=20squelette=20site?= =?UTF-8?q?=20+=20donn=C3=A9es=20causes/facteurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Site perso comparant causes de décès réelles (CépiDc/CIM-10) et positions des partis sur leurs facteurs de risque, en vue des présidentielles 2027. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BfMPw3qHuYEtf1msg2DhfE --- CLAUDE.md | 41 ++++++++++++ app.js | 116 ++++++++++++++++++++++++++++++++ data/cause_facteurs.json | 79 ++++++++++++++++++++++ data/causes.json | 139 +++++++++++++++++++++++++++++++++++++++ data/facteurs.json | 29 ++++++++ data/partis.json | 8 +++ data/positions.json | 50 ++++++++++++++ index.html | 27 ++++++++ specs.md | 39 +++++++++++ style.css | 110 +++++++++++++++++++++++++++++++ 10 files changed, 638 insertions(+) create mode 100644 CLAUDE.md create mode 100644 app.js create mode 100644 data/cause_facteurs.json create mode 100644 data/causes.json create mode 100644 data/facteurs.json create mode 100644 data/partis.json create mode 100644 data/positions.json create mode 100644 index.html create mode 100644 specs.md create mode 100644 style.css diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ce4da00 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,41 @@ +# Vibecoded Stuff — Project Guidelines + +## Context +This is a personal project folder. Everything built here is for personal use only — no need for production hardening, public documentation, or sharing considerations. + +## Before Building Anything +**Ask questions first. Build last.** +- Clarify all specs before writing a single line of code. +- Keep asking until the goal, inputs, outputs, and edge cases are fully clear. +- Only start building once we both agree the spec is complete. + +## Project Structure +- Each project gets its own folder: `/home/alex/Documents/vibecoded-stuff//` +- No nested complexity — keep folder structures flat and simple. + +## Language Preferences +- **Default to Python** for scripts, tools, automation, data, and CLIs. +- **Use JS/TS** when building frontends or when it's clearly a better fit (e.g., browser-based tools, Node CLIs). +- Avoid introducing other languages unless there's a compelling reason. + +## Design Principles +- **Easy to run locally** — no cloud services, no complex infrastructure unless explicitly asked. +- **Easy to use** — the user is non-technical. Favor simple interfaces, clear prompts, and sensible defaults. +- **No unnecessary complexity** — no Docker, no ORMs, no frameworks heavier than the task warrants. +- **Frontends only when requested** — default to CLI or script unless the spec says otherwise. +- **Use established libraries, don't reinvent them** — if something is already industry standard or has a solid, widely-used reference library or open-source project for it, adopt that instead of writing a custom implementation from scratch. This is about supporting the open-source ecosystem, not duplicating or copying its work. + +## Style Guide (frontend/HTML/CSS work) +- `/home/alex/Documents/vibecoded-stuff/style.css` is the site style guide. Always use it for any HTML/CSS work in this repo — link it or reuse its tokens/classes instead of inventing new colors, fonts, or spacing. +- Design tokens (colors, fonts, max-width, padding) live in its `:root` block — reuse those vars, don't hardcode values that already have a token. +- Match its existing patterns (section structure, button/card/hero conventions) for new pages instead of introducing a new visual style. + +## Data Access +- **Never scrape a website if there's another way to get the data** — check for an official API, RSS/Atom feed, or documented export first, and use that instead. +- Scraping is a last resort, only when no such alternative exists. Prefer it to be low-frequency and respectful (reasonable delays, caching results, honoring robots.txt) rather than repeated/greedy polling. + +## Code Style +- No docstrings, no type annotations, no comments unless the logic genuinely needs explanation. +- No extra error handling for impossible scenarios. +- No abstractions for hypothetical future needs. +- Keep dependencies minimal. diff --git a/app.js b/app.js new file mode 100644 index 0000000..9ab7bc8 --- /dev/null +++ b/app.js @@ -0,0 +1,116 @@ +async function loadJSON(name) { + const res = await fetch(`data/${name}`); + return res.json(); +} + +const STANCE_LABEL = { pour: 'Pour', contre: 'Contre', divise: 'Divisé' }; + +function buildCauseNode(cause, causes, partis, facteurById, causeFacteurs, positions) { + const children = causes.filter(c => c.parent_id === cause.id); + const details = document.createElement('details'); + const summary = document.createElement('summary'); + summary.textContent = `${cause.nom} (${cause.code_cim10})`; + details.appendChild(summary); + + if (children.length) { + for (const child of children) { + details.appendChild(buildCauseNode(child, causes, partis, facteurById, causeFacteurs, positions)); + } + } else { + details.appendChild(buildFacteurTable(cause.id, partis, facteurById, causeFacteurs, positions)); + } + return details; +} + +function buildFacteurTable(causeId, partis, facteurById, causeFacteurs, positions) { + const table = document.createElement('table'); + const facteurIds = causeFacteurs[causeId] || []; + + const thead = document.createElement('tr'); + thead.innerHTML = 'Facteur de risque' + + partis.map(p => `${p.nom}`).join(''); + table.appendChild(thead); + + for (const facteurId of facteurIds) { + const tr = document.createElement('tr'); + const facteurCell = document.createElement('td'); + facteurCell.textContent = facteurById[facteurId].nom; + tr.appendChild(facteurCell); + + for (const parti of partis) { + const td = document.createElement('td'); + td.style.background = `${parti.couleur}22`; + const pos = positions.find(p => p.cause_id === causeId && p.facteur_id === facteurId && p.parti_id === parti.id); + if (pos) { + td.classList.add('pos-cell'); + td.innerHTML = `${STANCE_LABEL[pos.stance]}`; + td.addEventListener('click', () => showDetail(parti.nom, pos)); + } else { + td.textContent = '—'; + } + tr.appendChild(td); + } + table.appendChild(tr); + } + return table; +} + +function buildFacteursTable(facteurs, causeFacteurs, causes) { + const byId = Object.fromEntries(causes.map(c => [c.id, c])); + const causesByFacteur = {}; + for (const [causeId, facteurIds] of Object.entries(causeFacteurs)) { + for (const facteurId of facteurIds) { + (causesByFacteur[facteurId] ??= []).push(causeId); + } + } + + const rows = facteurs + .map(f => ({ facteur: f, causeIds: causesByFacteur[f.id] || [] })) + .filter(r => r.causeIds.length > 1) + .sort((a, b) => b.causeIds.length - a.causeIds.length); + + const table = document.getElementById('facteurs-table'); + const thead = document.createElement('tr'); + thead.innerHTML = 'Facteur de risqueNb causes touchéesCauses concernées'; + table.appendChild(thead); + + for (const row of rows) { + const tr = document.createElement('tr'); + const names = row.causeIds.map(id => byId[id].nom).join(', '); + tr.innerHTML = `${row.facteur.nom}${row.causeIds.length}${names}`; + table.appendChild(tr); + } +} + +async function main() { + const [causes, partis, facteurs, causeFacteurs, positions] = await Promise.all([ + loadJSON('causes.json'), + loadJSON('partis.json'), + loadJSON('facteurs.json'), + loadJSON('cause_facteurs.json'), + loadJSON('positions.json'), + ]); + + const facteurById = Object.fromEntries(facteurs.map(f => [f.id, f])); + const chapitres = causes + .filter(c => c.parent_id === null) + .sort((a, b) => (a.rang ?? 999) - (b.rang ?? 999)); + + const tree = document.getElementById('causes-tree'); + for (const chapitre of chapitres) { + tree.appendChild(buildCauseNode(chapitre, causes, partis, facteurById, causeFacteurs, positions)); + } + + buildFacteursTable(facteurs, causeFacteurs, causes); +} + +function showDetail(partiNom, pos) { + document.getElementById('detail-title').textContent = partiNom; + document.getElementById('detail-text').textContent = pos.position; + const source = document.getElementById('detail-source'); + source.href = pos.source_url; + source.textContent = pos.source_url; + document.getElementById('detail').showModal(); +} + +main(); diff --git a/data/cause_facteurs.json b/data/cause_facteurs.json new file mode 100644 index 0000000..400dcde --- /dev/null +++ b/data/cause_facteurs.json @@ -0,0 +1,79 @@ +{ + "c-01-01-01": ["infections_virales", "drogues", "precarite", "acces_soins"], + "c-01-01-02": ["infections_virales", "drogues", "acces_soins"], + "c-01-02-01": ["infections_virales", "precarite", "acces_soins"], + "c-01-03-01": ["precarite", "acces_soins"], + "c-01-04-01": ["acces_soins", "precarite"], + "c-01-05-01": ["acces_soins", "precarite"], + + "c-02-01-01": ["cadmium", "tabac", "alcool", "obesite", "genetique"], + "c-02-01-02": ["alimentation", "alcool", "obesite", "tabac", "genetique", "acces_soins"], + "c-02-01-03": ["tabac", "alcool"], + "c-02-01-04": ["alimentation", "tabac", "precarite"], + "c-02-01-05": ["alcool", "infections_virales", "obesite"], + "c-02-02-01": ["tabac", "pollution_air", "amiante", "radon", "hydrocarbures"], + "c-02-02-02": ["tabac", "alcool"], + "c-02-03-01": ["genetique", "alcool", "obesite", "acces_soins"], + "c-02-04-01": ["genetique", "alimentation", "acces_soins"], + "c-02-04-02": ["genetique"], + "c-02-04-03": ["infections_virales", "acces_soins"], + "c-02-05-01": ["tabac", "hydrocarbures"], + "c-02-05-02": ["tabac", "obesite", "hypertension"], + "c-02-06-01": ["tabac", "alcool"], + "c-02-07-01": ["rayonnement_ionisant", "hydrocarbures"], + "c-02-07-02": ["pesticides", "infections_virales"], + "c-02-07-03": ["genetique", "pesticides"], + "c-02-08-01": ["uv", "genetique"], + "c-02-09-01": ["rayonnement_ionisant", "genetique"], + + "c-03-01-01": ["alimentation", "precarite"], + + "c-04-01-01": ["obesite", "alimentation", "precarite", "genetique"], + "c-04-01-02": ["genetique"], + + "c-05-01-01": ["alcool", "precarite", "isolement_social"], + "c-05-01-02": ["drogues", "precarite", "isolement_social"], + "c-05-02-01": ["genetique", "isolement_social", "acces_soins"], + + "c-06-01-01": ["genetique", "isolement_social"], + "c-06-01-02": ["pesticides", "genetique"], + "c-06-01-03": ["genetique", "pesticides"], + + "c-07-01-01": ["tabac", "hypertension", "cholesterol", "obesite", "alimentation", "precarite"], + "c-07-01-02": ["hypertension", "cholesterol", "tabac"], + "c-07-02-01": ["hypertension", "tabac", "obesite", "alcool"], + "c-07-03-01": ["hypertension", "obesite", "alcool"], + "c-07-03-02": ["alcool", "obesite", "hypertension"], + "c-07-04-01": ["alimentation", "obesite", "alcool", "precarite"], + "c-07-05-01": ["obesite", "genetique"], + + "c-08-01-01": ["tabac", "pollution_air", "conditions_travail"], + "c-08-02-01": ["precarite", "acces_soins", "pollution_air"], + "c-08-03-01": ["pollution_air", "qualite_air_interieur", "conditions_travail"], + + "c-09-01-01": ["alcool", "infections_virales", "obesite"], + "c-09-02-01": ["genetique", "alimentation"], + + "c-10-01-01": ["hypertension", "obesite", "cadmium", "acces_soins"], + + "c-11-01-01": ["genetique", "alcool", "pesticides", "pollution_air"], + + "c-12-01-01": ["vitesse_routiere", "conduite_stupefiants", "alcool"], + "c-12-02-01": ["isolement_social", "precarite", "conditions_travail", "acces_soins", "armes_a_feu"], + "c-12-03-01": ["armes_a_feu", "precarite"], + "c-12-04-01": ["isolement_social", "precarite"], + "c-12-05-01": ["precarite"], + "c-12-06-01": ["drogues", "precarite"], + "c-12-07-01": ["precarite"], + + "c-13-01-01": ["precarite", "acces_soins"], + + "c-14-01-01": ["genetique"], + + "c-15-01-01": ["precarite", "acces_soins"], + + "c-16-01-01": ["precarite", "acces_soins", "tabac", "alcool"], + + "c-17-01-01": ["tabac", "precarite"], + "c-17-01-02": ["acces_soins"] +} diff --git a/data/causes.json b/data/causes.json new file mode 100644 index 0000000..860f210 --- /dev/null +++ b/data/causes.json @@ -0,0 +1,139 @@ +[ + { "id": "c-01", "code_cim10": "A00-B99", "nom": "Maladies infectieuses et parasitaires", "parent_id": null, "rang": 8 }, + { "id": "c-01-01", "code_cim10": "B15-B19", "nom": "Hépatites virales", "parent_id": "c-01" }, + { "id": "c-01-01-01", "code_cim10": "B17.1/B18.2", "nom": "Hépatite C", "parent_id": "c-01-01" }, + { "id": "c-01-01-02", "code_cim10": "B16/B18.1", "nom": "Hépatite B", "parent_id": "c-01-01" }, + { "id": "c-01-02", "code_cim10": "B20-B24", "nom": "VIH/Sida", "parent_id": "c-01" }, + { "id": "c-01-02-01", "code_cim10": "B20-B24", "nom": "VIH/Sida", "parent_id": "c-01-02" }, + { "id": "c-01-03", "code_cim10": "A15-A19", "nom": "Tuberculose", "parent_id": "c-01" }, + { "id": "c-01-03-01", "code_cim10": "A15-A19", "nom": "Tuberculose", "parent_id": "c-01-03" }, + { "id": "c-01-04", "code_cim10": "A40-A41", "nom": "Septicémies", "parent_id": "c-01" }, + { "id": "c-01-04-01", "code_cim10": "A40-A41", "nom": "Septicémie", "parent_id": "c-01-04" }, + { "id": "c-01-05", "code_cim10": "U07.1", "nom": "Covid-19 et maladies infectieuses émergentes", "parent_id": "c-01" }, + { "id": "c-01-05-01", "code_cim10": "U07.1", "nom": "Covid-19", "parent_id": "c-01-05" }, + + { "id": "c-02", "code_cim10": "C00-D48", "nom": "Tumeurs", "parent_id": null, "rang": 1 }, + { "id": "c-02-01", "code_cim10": "C15-C26", "nom": "Tumeurs malignes des organes digestifs", "parent_id": "c-02" }, + { "id": "c-02-01-01", "code_cim10": "C25", "nom": "Tumeur maligne du pancréas", "parent_id": "c-02-01" }, + { "id": "c-02-01-02", "code_cim10": "C18-C21", "nom": "Cancer colorectal", "parent_id": "c-02-01" }, + { "id": "c-02-01-03", "code_cim10": "C15", "nom": "Cancer de l'œsophage", "parent_id": "c-02-01" }, + { "id": "c-02-01-04", "code_cim10": "C16", "nom": "Cancer de l'estomac", "parent_id": "c-02-01" }, + { "id": "c-02-01-05", "code_cim10": "C22", "nom": "Cancer du foie", "parent_id": "c-02-01" }, + { "id": "c-02-02", "code_cim10": "C30-C39", "nom": "Tumeurs malignes des organes respiratoires", "parent_id": "c-02" }, + { "id": "c-02-02-01", "code_cim10": "C33-C34", "nom": "Cancer du poumon", "parent_id": "c-02-02" }, + { "id": "c-02-02-02", "code_cim10": "C32", "nom": "Cancer du larynx", "parent_id": "c-02-02" }, + { "id": "c-02-03", "code_cim10": "C50", "nom": "Tumeurs malignes du sein", "parent_id": "c-02" }, + { "id": "c-02-03-01", "code_cim10": "C50", "nom": "Cancer du sein", "parent_id": "c-02-03" }, + { "id": "c-02-04", "code_cim10": "C51-C63", "nom": "Tumeurs malignes de l'appareil génital", "parent_id": "c-02" }, + { "id": "c-02-04-01", "code_cim10": "C61", "nom": "Cancer de la prostate", "parent_id": "c-02-04" }, + { "id": "c-02-04-02", "code_cim10": "C56", "nom": "Cancer de l'ovaire", "parent_id": "c-02-04" }, + { "id": "c-02-04-03", "code_cim10": "C53", "nom": "Cancer du col de l'utérus", "parent_id": "c-02-04" }, + { "id": "c-02-05", "code_cim10": "C64-C68", "nom": "Tumeurs malignes de l'appareil urinaire", "parent_id": "c-02" }, + { "id": "c-02-05-01", "code_cim10": "C67", "nom": "Cancer de la vessie", "parent_id": "c-02-05" }, + { "id": "c-02-05-02", "code_cim10": "C64", "nom": "Cancer du rein", "parent_id": "c-02-05" }, + { "id": "c-02-06", "code_cim10": "C00-C14", "nom": "Tumeurs malignes ORL / voies aérodigestives supérieures", "parent_id": "c-02" }, + { "id": "c-02-06-01", "code_cim10": "C00-C14", "nom": "Cancers des voies aérodigestives supérieures", "parent_id": "c-02-06" }, + { "id": "c-02-07", "code_cim10": "C81-C96", "nom": "Tumeurs du système lymphatique et hématopoïétique", "parent_id": "c-02" }, + { "id": "c-02-07-01", "code_cim10": "C91-C95", "nom": "Leucémies", "parent_id": "c-02-07" }, + { "id": "c-02-07-02", "code_cim10": "C81-C85", "nom": "Lymphomes", "parent_id": "c-02-07" }, + { "id": "c-02-07-03", "code_cim10": "C90", "nom": "Myélome multiple", "parent_id": "c-02-07" }, + { "id": "c-02-08", "code_cim10": "C43-C44", "nom": "Mélanome et autres tumeurs de la peau", "parent_id": "c-02" }, + { "id": "c-02-08-01", "code_cim10": "C43", "nom": "Mélanome cutané", "parent_id": "c-02-08" }, + { "id": "c-02-09", "code_cim10": "C70-C72", "nom": "Tumeurs du système nerveux central", "parent_id": "c-02" }, + { "id": "c-02-09-01", "code_cim10": "C71", "nom": "Tumeur maligne du cerveau", "parent_id": "c-02-09" }, + + { "id": "c-03", "code_cim10": "D50-D89", "nom": "Maladies du sang et des organes hématopoïétiques", "parent_id": null, "rang": 12 }, + { "id": "c-03-01", "code_cim10": "D50-D64", "nom": "Anémies", "parent_id": "c-03" }, + { "id": "c-03-01-01", "code_cim10": "D50-D64", "nom": "Anémies", "parent_id": "c-03-01" }, + + { "id": "c-04", "code_cim10": "E00-E90", "nom": "Maladies endocriniennes, nutritionnelles et métaboliques", "parent_id": null, "rang": 6 }, + { "id": "c-04-01", "code_cim10": "E10-E14", "nom": "Diabète", "parent_id": "c-04" }, + { "id": "c-04-01-01", "code_cim10": "E11", "nom": "Diabète de type 2", "parent_id": "c-04-01" }, + { "id": "c-04-01-02", "code_cim10": "E10", "nom": "Diabète de type 1", "parent_id": "c-04-01" }, + + { "id": "c-05", "code_cim10": "F00-F99", "nom": "Troubles mentaux et du comportement", "parent_id": null, "rang": 9 }, + { "id": "c-05-01", "code_cim10": "F10-F19", "nom": "Troubles liés à l'usage de substances", "parent_id": "c-05" }, + { "id": "c-05-01-01", "code_cim10": "F10", "nom": "Troubles liés à l'alcool", "parent_id": "c-05-01" }, + { "id": "c-05-01-02", "code_cim10": "F11-F19", "nom": "Troubles liés aux drogues", "parent_id": "c-05-01" }, + { "id": "c-05-02", "code_cim10": "F01-F03", "nom": "Démences", "parent_id": "c-05" }, + { "id": "c-05-02-01", "code_cim10": "F01-F03", "nom": "Démences (hors Alzheimer)", "parent_id": "c-05-02" }, + + { "id": "c-06", "code_cim10": "G00-G99", "nom": "Maladies du système nerveux", "parent_id": null, "rang": 4 }, + { "id": "c-06-01", "code_cim10": "G20-G31", "nom": "Maladies neurodégénératives", "parent_id": "c-06" }, + { "id": "c-06-01-01", "code_cim10": "G30", "nom": "Maladie d'Alzheimer", "parent_id": "c-06-01" }, + { "id": "c-06-01-02", "code_cim10": "G20", "nom": "Maladie de Parkinson", "parent_id": "c-06-01" }, + { "id": "c-06-01-03", "code_cim10": "G12.2", "nom": "Sclérose latérale amyotrophique", "parent_id": "c-06-01" }, + + { "id": "c-07", "code_cim10": "I00-I99", "nom": "Maladies de l'appareil circulatoire", "parent_id": null, "rang": 2 }, + { "id": "c-07-01", "code_cim10": "I20-I25", "nom": "Cardiopathies ischémiques", "parent_id": "c-07" }, + { "id": "c-07-01-01", "code_cim10": "I21", "nom": "Infarctus du myocarde", "parent_id": "c-07-01" }, + { "id": "c-07-01-02", "code_cim10": "I20/I25", "nom": "Angine de poitrine et autres cardiopathies ischémiques chroniques", "parent_id": "c-07-01" }, + { "id": "c-07-02", "code_cim10": "I60-I69", "nom": "Maladies cérébrovasculaires", "parent_id": "c-07" }, + { "id": "c-07-02-01", "code_cim10": "I60-I69", "nom": "Accident vasculaire cérébral (AVC)", "parent_id": "c-07-02" }, + { "id": "c-07-03", "code_cim10": "I44-I50", "nom": "Insuffisance cardiaque et troubles du rythme", "parent_id": "c-07" }, + { "id": "c-07-03-01", "code_cim10": "I50", "nom": "Insuffisance cardiaque", "parent_id": "c-07-03" }, + { "id": "c-07-03-02", "code_cim10": "I44-I49", "nom": "Troubles du rythme cardiaque", "parent_id": "c-07-03" }, + { "id": "c-07-04", "code_cim10": "I10-I15", "nom": "Hypertension artérielle", "parent_id": "c-07" }, + { "id": "c-07-04-01", "code_cim10": "I10-I15", "nom": "Hypertension artérielle", "parent_id": "c-07-04" }, + { "id": "c-07-05", "code_cim10": "I26/I80-I89", "nom": "Maladies veineuses et embolies", "parent_id": "c-07" }, + { "id": "c-07-05-01", "code_cim10": "I26", "nom": "Embolie pulmonaire", "parent_id": "c-07-05" }, + + { "id": "c-08", "code_cim10": "J00-J99", "nom": "Maladies de l'appareil respiratoire", "parent_id": null, "rang": 3 }, + { "id": "c-08-01", "code_cim10": "J40-J44", "nom": "Bronchopneumopathie chronique obstructive", "parent_id": "c-08" }, + { "id": "c-08-01-01", "code_cim10": "J40-J44", "nom": "BPCO", "parent_id": "c-08-01" }, + { "id": "c-08-02", "code_cim10": "J09-J18", "nom": "Pneumonies et grippe", "parent_id": "c-08" }, + { "id": "c-08-02-01", "code_cim10": "J09-J18", "nom": "Pneumonie et grippe", "parent_id": "c-08-02" }, + { "id": "c-08-03", "code_cim10": "J45-J46", "nom": "Asthme", "parent_id": "c-08" }, + { "id": "c-08-03-01", "code_cim10": "J45-J46", "nom": "Asthme", "parent_id": "c-08-03" }, + + { "id": "c-09", "code_cim10": "K00-K93", "nom": "Maladies de l'appareil digestif", "parent_id": null, "rang": 7 }, + { "id": "c-09-01", "code_cim10": "K70-K77", "nom": "Maladies du foie", "parent_id": "c-09" }, + { "id": "c-09-01-01", "code_cim10": "K70/K74", "nom": "Cirrhose du foie", "parent_id": "c-09-01" }, + { "id": "c-09-02", "code_cim10": "K50-K52", "nom": "Maladies inflammatoires de l'intestin", "parent_id": "c-09" }, + { "id": "c-09-02-01", "code_cim10": "K50-K52", "nom": "Maladies inflammatoires chroniques de l'intestin", "parent_id": "c-09-02" }, + + { "id": "c-10", "code_cim10": "N00-N99", "nom": "Maladies de l'appareil génito-urinaire", "parent_id": null, "rang": 11 }, + { "id": "c-10-01", "code_cim10": "N17-N19", "nom": "Maladies du rein", "parent_id": "c-10" }, + { "id": "c-10-01-01", "code_cim10": "N18", "nom": "Insuffisance rénale chronique", "parent_id": "c-10-01" }, + + { "id": "c-11", "code_cim10": "Q00-Q99", "nom": "Malformations congénitales", "parent_id": null, "rang": 15 }, + { "id": "c-11-01", "code_cim10": "Q20-Q28", "nom": "Malformations congénitales du cœur", "parent_id": "c-11" }, + { "id": "c-11-01-01", "code_cim10": "Q20-Q28", "nom": "Malformations congénitales cardiovasculaires", "parent_id": "c-11-01" }, + + { "id": "c-12", "code_cim10": "V01-Y98", "nom": "Causes externes de morbidité et de mortalité (accidents, suicides, homicides)", "parent_id": null, "rang": 5 }, + { "id": "c-12-01", "code_cim10": "V01-V99", "nom": "Accidents de transport", "parent_id": "c-12" }, + { "id": "c-12-01-01", "code_cim10": "V01-V89", "nom": "Accidents de la route", "parent_id": "c-12-01" }, + { "id": "c-12-02", "code_cim10": "X60-X84", "nom": "Suicides et lésions auto-infligées", "parent_id": "c-12" }, + { "id": "c-12-02-01", "code_cim10": "X60-X84", "nom": "Suicide", "parent_id": "c-12-02" }, + { "id": "c-12-03", "code_cim10": "X85-Y09", "nom": "Agressions", "parent_id": "c-12" }, + { "id": "c-12-03-01", "code_cim10": "X85-Y09", "nom": "Homicide", "parent_id": "c-12-03" }, + { "id": "c-12-04", "code_cim10": "W00-W19", "nom": "Chutes accidentelles", "parent_id": "c-12" }, + { "id": "c-12-04-01", "code_cim10": "W00-W19", "nom": "Chute accidentelle", "parent_id": "c-12-04" }, + { "id": "c-12-05", "code_cim10": "W65-W74", "nom": "Noyades accidentelles", "parent_id": "c-12" }, + { "id": "c-12-05-01", "code_cim10": "W65-W74", "nom": "Noyade accidentelle", "parent_id": "c-12-05" }, + { "id": "c-12-06", "code_cim10": "X40-X49", "nom": "Intoxications accidentelles", "parent_id": "c-12" }, + { "id": "c-12-06-01", "code_cim10": "X40-X49", "nom": "Intoxication accidentelle (dont surdoses)", "parent_id": "c-12-06" }, + { "id": "c-12-07", "code_cim10": "X00-X09", "nom": "Expositions au feu et aux fumées", "parent_id": "c-12" }, + { "id": "c-12-07-01", "code_cim10": "X00-X09", "nom": "Incendie et exposition à la fumée", "parent_id": "c-12-07" }, + + { "id": "c-13", "code_cim10": "L00-L99", "nom": "Maladies de la peau et du tissu sous-cutané", "parent_id": null, "rang": 16 }, + { "id": "c-13-01", "code_cim10": "L00-L08", "nom": "Infections cutanées graves", "parent_id": "c-13" }, + { "id": "c-13-01-01", "code_cim10": "L00-L08", "nom": "Infections cutanées et sous-cutanées graves", "parent_id": "c-13-01" }, + + { "id": "c-14", "code_cim10": "M00-M99", "nom": "Maladies du système ostéo-articulaire", "parent_id": null, "rang": 14 }, + { "id": "c-14-01", "code_cim10": "M30-M36", "nom": "Maladies rhumatismales systémiques", "parent_id": "c-14" }, + { "id": "c-14-01-01", "code_cim10": "M30-M36", "nom": "Maladies rhumatismales systémiques", "parent_id": "c-14-01" }, + + { "id": "c-15", "code_cim10": "O00-O99", "nom": "Grossesse, accouchement et puerpéralité", "parent_id": null, "rang": 17 }, + { "id": "c-15-01", "code_cim10": "O00-O99", "nom": "Mortalité maternelle", "parent_id": "c-15" }, + { "id": "c-15-01-01", "code_cim10": "O00-O99", "nom": "Mortalité maternelle", "parent_id": "c-15-01" }, + + { "id": "c-16", "code_cim10": "P00-P96", "nom": "Affections dont l'origine se situe dans la période périnatale", "parent_id": null, "rang": 13 }, + { "id": "c-16-01", "code_cim10": "P00-P96", "nom": "Mortalité périnatale", "parent_id": "c-16" }, + { "id": "c-16-01-01", "code_cim10": "P00-P96", "nom": "Mortalité périnatale", "parent_id": "c-16-01" }, + + { "id": "c-17", "code_cim10": "R00-R99", "nom": "Symptômes et signes non classés ailleurs", "parent_id": null, "rang": 10 }, + { "id": "c-17-01", "code_cim10": "R95-R99", "nom": "Morts subites et causes mal définies", "parent_id": "c-17" }, + { "id": "c-17-01-01", "code_cim10": "R95", "nom": "Mort subite du nourrisson", "parent_id": "c-17-01" }, + { "id": "c-17-01-02", "code_cim10": "R99", "nom": "Causes de décès mal définies", "parent_id": "c-17-01" } +] diff --git a/data/facteurs.json b/data/facteurs.json new file mode 100644 index 0000000..ce62765 --- /dev/null +++ b/data/facteurs.json @@ -0,0 +1,29 @@ +[ + { "id": "cadmium", "nom": "Cadmium (contamination alimentaire, engrais phosphatés)" }, + { "id": "tabac", "nom": "Tabac" }, + { "id": "alcool", "nom": "Alcool" }, + { "id": "obesite", "nom": "Obésité / sédentarité" }, + { "id": "alimentation", "nom": "Mauvaise alimentation (sel, sucre, aliments ultra-transformés)" }, + { "id": "pollution_air", "nom": "Pollution atmosphérique / particules fines" }, + { "id": "qualite_air_interieur", "nom": "Pollution de l'air intérieur" }, + { "id": "amiante", "nom": "Amiante" }, + { "id": "radon", "nom": "Radon" }, + { "id": "pesticides", "nom": "Pesticides" }, + { "id": "hydrocarbures", "nom": "Hydrocarbures aromatiques polycycliques / cancérogènes professionnels" }, + { "id": "rayonnement_ionisant", "nom": "Rayonnements ionisants" }, + { "id": "uv", "nom": "Exposition aux UV / rayonnement solaire" }, + { "id": "pollution_eau", "nom": "Pollution de l'eau" }, + { "id": "bruit", "nom": "Exposition au bruit" }, + { "id": "infections_virales", "nom": "Infections virales (HPV, hépatites, VIH)" }, + { "id": "hypertension", "nom": "Hypertension artérielle non traitée" }, + { "id": "cholesterol", "nom": "Cholestérol / dyslipidémie" }, + { "id": "genetique", "nom": "Prédispositions génétiques / familiales" }, + { "id": "vitesse_routiere", "nom": "Vitesse excessive au volant" }, + { "id": "conduite_stupefiants", "nom": "Conduite sous alcool ou stupéfiants" }, + { "id": "armes_a_feu", "nom": "Accès aux armes à feu" }, + { "id": "drogues", "nom": "Usage de drogues / stupéfiants" }, + { "id": "precarite", "nom": "Pauvreté et précarité sociale" }, + { "id": "acces_soins", "nom": "Accès aux soins et au dépistage" }, + { "id": "conditions_travail", "nom": "Conditions de travail / risques psychosociaux" }, + { "id": "isolement_social", "nom": "Isolement social" } +] diff --git a/data/partis.json b/data/partis.json new file mode 100644 index 0000000..2a2b738 --- /dev/null +++ b/data/partis.json @@ -0,0 +1,8 @@ +[ + { "id": "rn", "nom": "Rassemblement National", "couleur": "#0D378A" }, + { "id": "lfi", "nom": "La France Insoumise", "couleur": "#CC2443" }, + { "id": "ps", "nom": "Parti Socialiste", "couleur": "#FF8080" }, + { "id": "lr", "nom": "Les Républicains", "couleur": "#0066CC" }, + { "id": "renaissance", "nom": "Renaissance", "couleur": "#FFEB00" }, + { "id": "eelv", "nom": "Les Écologistes (EELV)", "couleur": "#00C000" } +] diff --git a/data/positions.json b/data/positions.json new file mode 100644 index 0000000..aaa3612 --- /dev/null +++ b/data/positions.json @@ -0,0 +1,50 @@ +[ + { + "cause_id": "c-02-01-01", + "parti_id": "eelv", + "facteur_id": "cadmium", + "stance": "pour", + "position": "Pour. Auteur du texte (Benoît Biteau, Les Écologistes) réduisant le seuil de cadmium dans les engrais phosphatés (40 mg/kg P2O5 en 2027, 20 mg/kg en 2030).", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + }, + { + "cause_id": "c-02-01-01", + "parti_id": "lfi", + "facteur_id": "cadmium", + "stance": "pour", + "position": "Pour (44 votes, groupe LFI-NFP). Vote du 3 juin 2025 sur la proposition de loi cadmium.", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + }, + { + "cause_id": "c-02-01-01", + "parti_id": "ps", + "facteur_id": "cadmium", + "stance": "pour", + "position": "Pour (21 votes, groupe Socialistes et apparentés). Vote du 3 juin 2025 sur la proposition de loi cadmium.", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + }, + { + "cause_id": "c-02-01-01", + "parti_id": "renaissance", + "facteur_id": "cadmium", + "stance": "divise", + "position": "Groupe divisé dans les faits : majorité pour au vote (20 votes, 1 abstention, Ensemble pour la République), mais le gouvernement Lecornu II (même majorité) s'est opposé au texte et un amendement pour ralentir la trajectoire a été déposé avant d'être retiré.", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + }, + { + "cause_id": "c-02-01-01", + "parti_id": "lr", + "facteur_id": "cadmium", + "stance": "divise", + "position": "Groupe divisé (Droite Républicaine) : 1 pour, 1 contre, 1 abstention sur ce texte.", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + }, + { + "cause_id": "c-02-01-01", + "parti_id": "rn", + "facteur_id": "cadmium", + "stance": "contre", + "position": "Contre (19 votes, 1 abstention, groupe RN). Ne voulait pas \"céder aux demandes de la gauche écologiste\".", + "source_url": "https://www.assemblee-nationale.fr/dyn/17/scrutins/7303" + } +] diff --git a/index.html b/index.html new file mode 100644 index 0000000..39e399f --- /dev/null +++ b/index.html @@ -0,0 +1,27 @@ + + + + +In-sécurité + + + +

In-sécurité

+

L'insécurité n'est pas toujours où on la croit. Quels partis luttent contre les principales causes de mortalité en France ?

+ +

Causes de décès (du plus commun au moins commun)

+
+ +

Facteurs de risque

+
+ + +

+

+ Source +
+
+ + + + diff --git a/specs.md b/specs.md new file mode 100644 index 0000000..21f65d4 --- /dev/null +++ b/specs.md @@ -0,0 +1,39 @@ +Site Internet simple d'utilisation pour comparer les programmes avant les présidentielles 2027. + +Le constat : en France, la droite a gagné la discussion sur « l'insécurité ». À Grenoble on partage plein de faits divers de fusillades, etc. et on se sert de ces morts violentes pour disqualifier la gauche. Je voudrais créer un site qui catégorise les causes de décès en France et étudie ce que chaque programme politique fait pour cette question précise. ex. la première cause de mortalité ce sont les tumeurs, dedans il y a le cancer du pancréas, causé par le cadmium, quels partis luttent contre les causes de ce cancer ? Comme ça on peut voir quels partis veulent *vraiment* régler l'insécurité en France, et pas juste les faits divers et une politique pénale répressive. + +Les sources d'information : +- Causes de décès en France : https://opendata-cepidc.inserm.fr/ +- Programmes des partis : + - Certains programmes ne sont pas encore finalisés, ex. LFI dont le programme viendra en octobre + - Utiliser https://monvote2027.fr/candidats éventuellement ? + +## Décisions (2026-08-21) + +- Portée partis : partis nationaux (RN, LFI, PS, LR, Renaissance, EELV...), liste initiale fixe, ajustable après. +- Lien cause -> facteur de risque -> position parti : rentré à la main par Alex, pas de recherche auto pour l'instant. +- Granularité causes : détail complet dès le départ (hiérarchie CIM-10 : chapitre > groupe > cause détaillée), pas juste top causes. +- Format comparaison : tableau croisé global (causes en lignes, partis en colonnes), clic sur cellule = détail (position + source). +- Source obligatoire par entrée (lien vers programme officiel). +- Saisie : fichiers JSON/CSV édités à la main, pas de formulaire web pour l'instant. +- Déploiement : local seulement pour l'instant. +- CépiDc opendata : classification CIM-10 confirmée (chapitre/groupe/cause), export exact (CSV/API) à vérifier en phase build via l'outil "interroger les données de mortalité" avant tout scraping. +- Facteurs de risque : entité réutilisable (`facteurs.json`), pas texte libre. +- Contenu initial : squelette + 1-2 exemples réels remplis (cas pilote cancer du pancréas / cadmium) pour valider le format. + +## Structure de données + +```text +in-securite/ + data/ + causes.json # id, code_cim10, nom, parent_id + partis.json # id, nom, couleur + facteurs.json # id, nom + cause_facteurs.json # cause_id -> [facteur_id...], lien épidémiologique (fait médical, pas politique) + positions.json # cause_id, parti_id, facteur_id, stance, position, source_url + index.html + app.js # lit les JSON, tableau croisé causes x partis + style.css # basé sur /home/alex/Documents/vibecoded-stuff/style.css +``` + +Site statique, pas de backend. `python -m http.server` en local pour servir les JSON (évite blocage CORS en `file://`). diff --git a/style.css b/style.css new file mode 100644 index 0000000..4af76ed --- /dev/null +++ b/style.css @@ -0,0 +1,110 @@ +@import url('../style.css'); + +body { + max-width: var(--max-w); + margin-inline: auto; + padding: var(--pad-x); +} + +h1 { + font-family: var(--f-display); + color: var(--c-green); + font-size: 2rem; + margin-bottom: 0.5rem; +} + +p.intro { + color: var(--c-text-sec); + max-width: 640px; + margin-bottom: 2rem; +} + +h2 { + font-family: var(--f-display); + color: var(--c-green); + font-size: 1.375rem; + margin: 2.5rem 0 1rem; +} + +#causes-tree > details { + border: 1px solid var(--c-green-mid); + border-radius: 4px; + margin-bottom: 0.5rem; + padding: 0.75rem 1rem; +} + +details details { + border-left: 2px solid var(--c-green-mid); + margin: 0.5rem 0 0.5rem 0.5rem; + padding-left: 1rem; +} + +summary { + cursor: pointer; + font-weight: 600; + color: var(--c-green); +} + +details table { + margin-top: 0.75rem; +} + +table { + border-collapse: collapse; + width: 100%; + font-size: 0.9rem; +} + +th, td { + border: 1px solid var(--c-green-mid); + padding: 0.6rem 0.8rem; + text-align: left; + vertical-align: top; +} + +th { + background: var(--c-green-light); + color: var(--c-green); +} + +td.pos-cell { + cursor: pointer; +} + +td.pos-cell:hover { + background: var(--c-green-light); +} + +.pill { + display: inline-block; + border-radius: 999px; + padding: 0.15rem 0.6rem; + font-size: 0.75rem; + font-weight: 600; + color: #fff; +} + +.pill-pour { background: #2e7d32; } +.pill-divise { background: #d99a00; } +.pill-contre { background: #c62828; } + +dialog { + max-width: 520px; + border: 1px solid var(--c-green-mid); + border-radius: 6px; + padding: 1.5rem; +} + +dialog h3 { + color: var(--c-green); + margin-bottom: 0.75rem; +} + +dialog a { + display: inline-block; + margin-top: 1rem; +} + +dialog button { + margin-top: 1.5rem; +}