feat: Creating the base of application

This commit is contained in:
gauvainboiche
2026-08-01 17:34:23 +02:00
parent c84d6f05ec
commit 7a7815f3bd
11 changed files with 773 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { CLINICAL_THRESHOLDS } from '../pkCore.js';
export function createChartAnnotations(mode) {
const thresholds = CLINICAL_THRESHOLDS[mode];
const annotations = {};
thresholds.zones.forEach((zone, index) => {
// Évite d'étendre la dernière zone à l'infini sur le graphe
const yMax = zone.max === Infinity ? thresholds.maxScale : zone.max;
if (zone.min < thresholds.maxScale) {
annotations[`zone_${index}`] = {
type: 'box',
yMin: zone.min,
yMax: Math.min(yMax, thresholds.maxScale),
backgroundColor: zone.color,
borderWidth: 0,
label: {
display: true,
content: zone.name,
color: zone.textHex,
font: { size: 14, weight: 'bold' },
position: 'center'
}
};
}
});
return annotations;
}