diff --git a/individus.html b/individus.html index 91f1bd9..ba0c6c4 100644 --- a/individus.html +++ b/individus.html @@ -8,22 +8,31 @@

Distribution des âges

Indicateurs clés

- - - - - - - - - - - - - -
IndividusÂge moyen
MédianeÉcart-type
MinimumMaximum
+
+
+

Individus :
+ Âge moyen :
+ Médiane :
+ Écart-type :
+ Minimum :
+ Maximum : +

+
+ +
+
+ +
+
+ +
+
+
+
+
+
diff --git a/package-lock.json b/package-lock.json index 368d230..b451e22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "0.0.0", "dependencies": { "chart.js": "^4.5.1", + "chartjs-chart-matrix": "^3.0.0", + "chartjs-plugin-datalabels": "^2.2.0", "graphology": "^0.26.0", "graphology-layout-forceatlas2": "^0.10.1", "jstat": "^1.9.6", @@ -370,6 +372,24 @@ "pnpm": ">=8" } }, + "node_modules/chartjs-chart-matrix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chartjs-chart-matrix/-/chartjs-chart-matrix-3.0.0.tgz", + "integrity": "sha512-lUWC1UaWkxGdG02dBJ5r1ppbSYB/uWmwAh11VEs7V3ZQItNCk4am+rmacwkgeb+SQeEj2hP9Qq4oGsUmPl/1lQ==", + "license": "MIT", + "peerDependencies": { + "chart.js": ">=3.0.0" + } + }, + "node_modules/chartjs-plugin-datalabels": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/chartjs-plugin-datalabels/-/chartjs-plugin-datalabels-2.2.0.tgz", + "integrity": "sha512-14ZU30lH7n89oq+A4bWaJPnAG8a7ZTk7dKf48YAzMvJjQtjrgg5Dpk9f+LbjCF6bpx3RAGTeL13IXpKQYyRvlw==", + "license": "MIT", + "peerDependencies": { + "chart.js": ">=3.0.0" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", diff --git a/package.json b/package.json index 7aa6de9..4f39a49 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ }, "dependencies": { "chart.js": "^4.5.1", + "chartjs-chart-matrix": "^3.0.0", + "chartjs-plugin-datalabels": "^2.2.0", "graphology": "^0.26.0", "graphology-layout-forceatlas2": "^0.10.1", "jstat": "^1.9.6", diff --git a/src/individual.ts b/src/individual.ts index 1680c2a..d4acb0b 100644 --- a/src/individual.ts +++ b/src/individual.ts @@ -69,9 +69,9 @@ function randomSex(age:number) { let c = 0.55; if (age < 30) - c = 0.51; + c = 0.52; else if (age < 55) - c = 0.45; + c = 0.46; return Math.random() < c ? "F" : "M"; } @@ -112,8 +112,8 @@ function randomEducation(age:number) { } function randomWealth(education:number) { - // Ajoute un bruit gaussien (moyenne 0, écart-type 0.9) - const wealthCont = education + jStat.normal.sample(0, 0.9); + // Ajoute un bruit gaussien (moyenne 0, écart-type 0.7) + const wealthCont = education / 2 + jStat.normal.sample(0.2, 0.9); // Classification en 4 niveaux selon la valeur continue let wealth;