feat: causal graph

This commit is contained in:
OpenSquared
2026-07-02 13:57:43 +02:00
parent 5081514898
commit 0d5ad88b1c

View File

@@ -1062,39 +1062,61 @@ function TabLibrary({
{(() => { {(() => {
const calib = selected.calibration_json || {} const calib = selected.calibration_json || {}
const absorption = calib.absorption_days as number | undefined const absorption = calib.absorption_days as number | undefined
const decay = calib.decay_type as string | undefined const halfLife = calib.half_life_days as number | undefined
const conf = calib.confidence as number | undefined const lagDays = calib.lag_days as number | undefined
const rationale = calib.theory_rationale as string | undefined const decay = calib.decay_type as string | undefined
const genAt = calib.theory_generated_at as string | undefined const conf = calib.confidence as number | undefined
const rationale = calib.theory_rationale as string | undefined
const genAt = calib.theory_generated_at as string | undefined
return ( return (
<div className="space-y-3"> <div className="space-y-3">
{rationale && ( {rationale && (
<p className="text-xs text-violet-300 italic border-l-2 border-violet-700/60 pl-2">{rationale}</p> <p className="text-xs text-violet-300 italic border-l-2 border-violet-700/60 pl-2">{rationale}</p>
)} )}
<div className="grid grid-cols-2 gap-3"> <div className="grid grid-cols-3 gap-3">
<div> <div>
<div className="text-xs text-slate-500 mb-1">Durée absorption (j)</div> <div className="text-xs text-slate-500 mb-1">Lag (j)</div>
<input <input
type="number" min={1} max={60} step={1} type="number" min={0} max={30} step={1}
value={lagDays ?? ''}
placeholder="0"
onChange={e => saveTheoryParams({ lag_days: parseInt(e.target.value) || 0 })}
className="w-full bg-dark-800 border border-amber-600/40 rounded px-2 py-1 text-xs text-amber-200 text-center"
/>
</div>
<div>
<div className="text-xs text-slate-500 mb-1">Demi-vie t½ (j)</div>
<input
type="number" min={1} max={120} step={1}
value={halfLife ?? ''}
placeholder="—"
onChange={e => saveTheoryParams({ half_life_days: parseInt(e.target.value) || 5 })}
className="w-full bg-dark-800 border border-violet-600/40 rounded px-2 py-1 text-xs text-violet-200 text-center"
/>
</div>
<div>
<div className="text-xs text-slate-500 mb-1">Absorption (j)</div>
<input
type="number" min={1} max={180} step={1}
value={absorption ?? ''} value={absorption ?? ''}
placeholder="—" placeholder="—"
onChange={e => saveTheoryParams({ absorption_days: parseInt(e.target.value) || 7 })} onChange={e => saveTheoryParams({ absorption_days: parseInt(e.target.value) || 7 })}
className="w-full bg-dark-800 border border-slate-600 rounded px-2 py-1 text-xs text-slate-200 text-center" className="w-full bg-dark-800 border border-slate-600 rounded px-2 py-1 text-xs text-slate-200 text-center"
/> />
</div> </div>
<div> </div>
<div className="text-xs text-slate-500 mb-1">Type de décroissance</div> <div>
<select <div className="text-xs text-slate-500 mb-1">Type de décroissance</div>
value={decay ?? 'exp'} <select
onChange={e => saveTheoryParams({ decay_type: e.target.value })} value={decay ?? 'exp'}
className="w-full bg-dark-800 border border-slate-600 rounded px-2 py-1 text-xs text-slate-200" onChange={e => saveTheoryParams({ decay_type: e.target.value })}
> className="w-full bg-dark-800 border border-slate-600 rounded px-2 py-1 text-xs text-slate-200"
<option value="step">step tout ou rien</option> >
<option value="linear">linear déclin linéaire</option> <option value="step">step tout ou rien</option>
<option value="exp">exp déclin exponentiel</option> <option value="linear">linear déclin linéaire</option>
</select> <option value="exp">exp déclin exponentiel</option>
</div> </select>
</div> </div>
<div className="flex items-center gap-3 text-xs text-slate-500"> <div className="flex items-center gap-3 text-xs text-slate-500">
{conf !== undefined && ( {conf !== undefined && (