fix: Changing colors in background to reflect KetaPK excel version

This commit is contained in:
gauvainboiche
2026-08-29 16:20:48 +02:00
parent 3f4b8a78fa
commit 94dfe1c26c
7 changed files with 29 additions and 36 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
# Origin project # Origin project
*.xlsm *.xls*
*.zip *.zip
code_vba*.txt *.txt
*.png
# Node files # Node files
node_modules/ node_modules/
+5 -14
View File
@@ -1,21 +1,11 @@
import { CLINICAL_THRESHOLDS } from './pkCore.js'; import { CLINICAL_THRESHOLDS } from './pkCore.js';
import { t } from './i18n.js'; import { t } from './i18n.js';
// Le texte des zones cliniques (zone.textHex) est calibré pour un fond sombre. // Les couleurs de zone sont volontairement fixes (indépendantes du thème d'interface) :
// Sur le thème clair, il faut un texte foncé pour rester lisible sur le même fond pastel. // elles reproduisent le dégradé de référence de l'outil KetaPK original. Seul le texte
const LIGHT_THEME_ZONE_TEXT = { // (zone.textHex) est choisi pour rester lisible sur cette couleur de fond opaque.
inactive: '#854d0e',
anti_hyperalgesic: '#3f6212',
analgesia: '#92400e',
psychedelic: '#9d174d',
emergence: '#075985',
narcosis: '#1e3a8a',
excessive: '#7f1d1d'
};
export function updateChartAnnotations(chart, mode, currentYMax) { export function updateChartAnnotations(chart, mode, currentYMax) {
const thresholds = CLINICAL_THRESHOLDS[mode]; const thresholds = CLINICAL_THRESHOLDS[mode];
const theme = document.documentElement.getAttribute('data-theme') || 'dark';
const annotations = {}; const annotations = {};
thresholds.zones.forEach((zone, index) => { thresholds.zones.forEach((zone, index) => {
@@ -24,6 +14,7 @@ export function updateChartAnnotations(chart, mode, currentYMax) {
annotations[`zone_${index}`] = { annotations[`zone_${index}`] = {
type: 'box', type: 'box',
drawTime: 'beforeDraw',
yMin: zone.min, yMin: zone.min,
yMax: Math.min(zoneMax, currentYMax), yMax: Math.min(zoneMax, currentYMax),
backgroundColor: zone.color, backgroundColor: zone.color,
@@ -31,7 +22,7 @@ export function updateChartAnnotations(chart, mode, currentYMax) {
label: { label: {
display: true, display: true,
content: t(`zones.${zone.zoneKey}`), content: t(`zones.${zone.zoneKey}`),
color: theme === 'light' ? (LIGHT_THEME_ZONE_TEXT[zone.zoneKey] || '#1e293b') : zone.textHex, color: zone.textHex,
font: { size: 11, weight: 'bold' }, font: { size: 11, weight: 'bold' },
position: 'center' position: 'center'
} }
+17 -16
View File
@@ -8,7 +8,7 @@
/** /**
* Version unique de l'application (Centralisée) * Version unique de l'application (Centralisée)
*/ */
export const APP_VERSION = '0.18.0'; export const APP_VERSION = '0.19.0';
export const MODES = { export const MODES = {
ESKETAMINE: 'ESKETAMINE', ESKETAMINE: 'ESKETAMINE',
@@ -49,26 +49,26 @@ export const CLINICAL_THRESHOLDS = {
maxScale: 500, maxScale: 500,
defaultConcentration: 5, defaultConcentration: 5,
zones: [ zones: [
{ zoneKey: "inactive", min: 0, max: 10, color: "rgba(249, 252, 126, 0.25)", textHex: "#fef9c3" }, { zoneKey: "inactive", min: 0, max: 10, color: "#eaf7d8", textHex: "#4d5a1e" },
{ zoneKey: "anti_hyperalgesic", min: 10, max: 50, color: "rgba(218, 247, 166, 0.25)", textHex: "#d9f99d" }, { zoneKey: "anti_hyperalgesic", min: 10, max: 50, color: "#ddf78a", textHex: "#355e1a" },
{ zoneKey: "analgesia", min: 50, max: 150, color: "rgba(255, 195, 0, 0.25)", textHex: "#fef08a" }, { zoneKey: "analgesia", min: 50, max: 150, color: "#ffcc33", textHex: "#7a4a00" },
{ zoneKey: "psychedelic", min: 150, max: 350, color: "rgba(242, 160, 223, 0.25)", textHex: "#fbcfe8" }, { zoneKey: "psychedelic", min: 150, max: 350, color: "#f562f0", textHex: "#6b0f61" },
{ zoneKey: "emergence", min: 350, max: 500, color: "rgba(89, 196, 240, 0.25)", textHex: "#bae6fd" }, { zoneKey: "emergence", min: 350, max: 500, color: "#4fd3f7", textHex: "#013a4d" },
{ zoneKey: "narcosis", min: 500, max: 1000, color: "rgba(43, 122, 244, 0.25)", textHex: "#ffffff" }, { zoneKey: "narcosis", min: 500, max: 1000, color: "#0ea5f0", textHex: "#ffffff" },
{ zoneKey: "excessive", min: 1000, max: Infinity, color: "rgba(255, 87, 51, 0.25)", textHex: "#fecaca" } { zoneKey: "excessive", min: 1000, max: Infinity, color: "#ff4d4d", textHex: "#ffffff" }
] ]
}, },
[MODES.RACEMIQUE]: { [MODES.RACEMIQUE]: {
maxScale: 1000, maxScale: 1000,
defaultConcentration: 10, defaultConcentration: 10,
zones: [ zones: [
{ zoneKey: "inactive", min: 0, max: 20, color: "rgba(249, 252, 126, 0.25)", textHex: "#fef9c3" }, { zoneKey: "inactive", min: 0, max: 20, color: "#eaf7d8", textHex: "#4d5a1e" },
{ zoneKey: "anti_hyperalgesic", min: 20, max: 100, color: "rgba(218, 247, 166, 0.25)", textHex: "#d9f99d" }, { zoneKey: "anti_hyperalgesic", min: 20, max: 100, color: "#ddf78a", textHex: "#355e1a" },
{ zoneKey: "analgesia", min: 100, max: 300, color: "rgba(255, 195, 0, 0.25)", textHex: "#fef08a" }, { zoneKey: "analgesia", min: 100, max: 300, color: "#ffcc33", textHex: "#7a4a00" },
{ zoneKey: "psychedelic", min: 300, max: 700, color: "rgba(242, 160, 223, 0.25)", textHex: "#fbcfe8" }, { zoneKey: "psychedelic", min: 300, max: 700, color: "#f562f0", textHex: "#6b0f61" },
{ zoneKey: "emergence", min: 700, max: 1000, color: "rgba(89, 196, 240, 0.25)", textHex: "#bae6fd" }, { zoneKey: "emergence", min: 700, max: 1000, color: "#4fd3f7", textHex: "#013a4d" },
{ zoneKey: "narcosis", min: 1000, max: 2000, color: "rgba(43, 122, 244, 0.25)", textHex: "#ffffff" }, { zoneKey: "narcosis", min: 1000, max: 2000, color: "#0ea5f0", textHex: "#ffffff" },
{ zoneKey: "excessive", min: 2000, max: Infinity, color: "rgba(255, 87, 51, 0.25)", textHex: "#fecaca" } { zoneKey: "excessive", min: 2000, max: Infinity, color: "#ff4d4d", textHex: "#ffffff" }
] ]
} }
}; };
@@ -191,7 +191,8 @@ export function generateSimulationData({ model, weightKg, timelineInputs, infusi
if (!nextEvent) return; if (!nextEvent) return;
const deltaT = nextEvent.time - event.time; const deltaT = nextEvent.time - event.time;
const Rn = infusionRateToMgKgPerMin(event.infusionRate, infusionUnit, weightKg) / refDose; // Excel applique le débit déclaré à la fin de l'intervalle (colonne d'arrivée), pas celui du départ
const Rn = infusionRateToMgKgPerMin(nextEvent.infusionRate, infusionUnit, weightKg) / refDose;
const Falpha = Math.exp(-alpha * deltaT); const Falpha = Math.exp(-alpha * deltaT);
const Fbeta = Math.exp(-beta * deltaT); const Fbeta = Math.exp(-beta * deltaT);
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "ketapk" name = "ketapk"
version = "0.1.0" version = "0.19.0"
description = "Add your description here" description = "Add your description here"
readme = "README.md" readme = "README.md"
requires-python = ">=3.14" requires-python = ">=3.14"
+1 -1
View File
@@ -1616,7 +1616,7 @@ dependencies = [
[[package]] [[package]]
name = "ketapk" name = "ketapk"
version = "0.18.0" version = "0.19.0"
dependencies = [ dependencies = [
"log", "log",
"serde", "serde",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "ketapk" name = "ketapk"
version = "0.18.0" version = "0.19.0"
description = "KétaPK" description = "KétaPK"
authors = ["Pr. Georges MION", "Gauvain BOICHÉ"] authors = ["Pr. Georges MION", "Gauvain BOICHÉ"]
license = "Proprietary" license = "Proprietary"
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "ketapk", "productName": "ketapk",
"version": "0.18.0", "version": "0.19.0",
"identifier": "com.ketapk.desktop", "identifier": "com.ketapk.desktop",
"build": { "build": {
"beforeDevCommand": "", "beforeDevCommand": "",