Move Displacements into a tab of the Explore mockup and document the session (D-055)

The jumps and trends now sit in a Displacements tab after Diagnosis
(#tab=displacements), no longer in a separate sidebar page; a click on
a row opens the Diagnosis tab on that target.

Documented: what the client looks at (jumps and trends, not errors,
handled upstream) in docs/displacement/domaine/ce-que-regarde-le-client.md;
the expert's reading of NORDEND in the case journey; the experimental
way of working in vues-deplacements/CLAUDE.md; D-055, the spec, the
note, the README and the project map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-10-16 18:26:58 +02:00
1 parent d07edace60
commit 294e024e5a
10 files changed
+64 -62

No files matched your search

@@ -6,7 +6,7 @@
<title><!--PLATFORM--> · Explore</title>
<script src="https://cdn.plot.ly/plotly-4.1.1.min.js"></script>
<style>
/* Maquette de la page Explore avec l'onglet Diagnosis (D-053, vues-deplacements/maquette/spec.md). Données injectées
/* Maquette de la page Explore, onglets View, Diagnosis (D-053, D-054) et Displacements (D-055) (vues-deplacements/maquette/spec.md). Données injectées
par explore.py. Habillage repris de maquettes/user/summary_template.html. */
:root {
--sidebar: #2a3f54; --topbar: #ededed; --page: #f7f7f7; --panel-border: #e6e9ed;
@@ -28,8 +28,6 @@
.nav a { display: flex; align-items: center; gap: 4px; padding: 13px 15px; color: #e7e7e7;
text-decoration: none; font-weight: bold; }
.nav a .chev { margin-left: auto; }
.nav a[data-page] { cursor: pointer; }
.nav a.active { background: #3e5367; }
.topbar { margin-left: 230px; height: 52px; background: var(--topbar); border-bottom: 1px solid #d9dee4;
display: flex; align-items: center; justify-content: space-between; padding: 0 15px; }
@@ -110,11 +108,12 @@
#d-request textarea { width: 100%; font: 13px/1.4 monospace; padding: 6px 8px; border: 1px solid var(--line); }
#d-request p { margin: 4px 0; color: var(--text); }
/* Page Displacements (D-055) : un événement par groupe de sauts, ses sauts en tableau, puis les courbes en mm. */
#p-displacements .note { margin: 0 6px 10px; }
#p-displacements .sub { margin: 18px 6px 6px; }
#r-trends { margin: 0 6px 12px; }
#r-events details { margin: 0 6px 12px; color: var(--text); }
/* Onglet Displacements (D-055) : sauts groupés en événements, tendances, puis les courbes en mm. */
#displacements .note { margin: 0 0 10px; }
#displacements .sub { margin: 18px 0 6px; }
#displacements .sub:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
#r-trends { margin: 0 0 12px; }
#r-events details { margin: 0 0 12px; color: var(--text); }
#r-events summary { font-size: 15px; cursor: pointer; padding: 4px 0; }
.rtable { border-collapse: collapse; width: 100%; margin-top: 4px; color: var(--text); }
.rtable th, .rtable td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: left; }
@@ -131,7 +130,6 @@
<symbol id="cog" viewBox="0 0 20 20"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-width="4" stroke-dasharray="2.4 2.3"/><circle cx="10" cy="10" r="5" fill="none" stroke="currentColor" stroke-width="3"/></symbol>
<symbol id="chev" viewBox="0 0 20 20"><path d="M4 7l6 6 6-6" fill="none" stroke="currentColor" stroke-width="2.2"/></symbol>
<symbol id="burger" viewBox="0 0 20 20"><path d="M2 4h16v2.4H2zm0 4.8h16v2.4H2zm0 4.8h16V16H2z"/></symbol>
<symbol id="trend" viewBox="0 0 20 20"><path d="M2 15l5-5 4 3 7-8" fill="none" stroke="currentColor" stroke-width="2.2"/></symbol>
<symbol id="wrench" viewBox="0 0 20 20"><path d="M13.5 1.5a5 5 0 0 0-4.6 6.9L2 15.3 4.7 18l6.9-6.9a5 5 0 0 0 6.9-4.6l-3 3-2.8-.6-.6-2.8z"/></symbol>
</svg>
@@ -141,8 +139,7 @@
<div class="section">GENERAL</div>
<nav class="nav">
<a><svg class="i"><use href="#home"/></svg>Home</a>
<a data-page="explore"><svg class="i"><use href="#list"/></svg>Explore<svg class="i chev"><use href="#chev"/></svg></a>
<a data-page="displacements"><svg class="i"><use href="#trend"/></svg>Displacements</a>
<a><svg class="i"><use href="#list"/></svg>Explore<svg class="i chev"><use href="#chev"/></svg></a>
<a><svg class="i"><use href="#cog"/></svg>Settings<svg class="i chev"><use href="#chev"/></svg></a>
</nav>
</aside>
@@ -153,17 +150,7 @@
</header>
<main>
<section class="panel" id="p-displacements" hidden>
<div class="panel-title"><h2><!--PLATFORM--><small>Displacements</small></h2></div>
<h3 class="sub">Jumps</h3>
<p class="note" id="r-note"></p>
<div id="r-events"></div>
<h3 class="sub">Trends</h3>
<p class="note" id="r-trend-note"></p>
<div id="r-trends"></div>
<div id="r-curves"></div>
</section>
<section class="panel" id="p-explore">
<section class="panel">
<div class="panel-title">
<h2><!--PLATFORM--><small>Explore</small></h2>
<span class="tools"><svg class="i"><use href="#wrench"/></svg> ▾</span>
@@ -174,6 +161,7 @@
<button type="button" data-pane="advanced">Advanced</button>
<button type="button" data-pane="view" class="active">View</button>
<button type="button" data-pane="diagnosis">Diagnosis</button>
<button type="button" data-pane="displacements">Displacements</button>
</nav>
<div class="pane" id="time_series"></div>
<div class="pane" id="advanced"></div>
@@ -236,6 +224,15 @@
<p>Not run from this page yet: paste this request into Claude Code. <button type="button" id="d-copy">Copy</button></p>
</div>
</div>
<div class="pane" id="displacements">
<h3 class="sub">Jumps</h3>
<p class="note" id="r-note"></p>
<div id="r-events"></div>
<h3 class="sub">Trends</h3>
<p class="note" id="r-trend-note"></p>
<div id="r-trends"></div>
<div id="r-curves"></div>
</div>
</section>
</main>
@@ -713,7 +710,7 @@ for (const id of ["v-marks", "v-color"]) document.getElementById(id).addEventLis
const jumpDay = d => { const k = nearestIndex(Date.parse(IM[V].t) + d * DAY); if (k >= 0) show(k); };
document.addEventListener("keydown", ev => {
if (document.getElementById("p-explore").hidden || !document.getElementById("view").classList.contains("active")) return;
if (!document.getElementById("view").classList.contains("active")) return;
if (ev.target.matches("select, input:not([type=range])")) return; // les flèches restent au champ qui a le focus
const d = { ArrowLeft: -1, ArrowRight: 1 }[ev.key];
if (ev.key === " ") play(!playing);
@@ -744,9 +741,9 @@ if (ASKED.get("img")) { const k = nearestIndex(Date.parse(ASKED.get("img"))); if
if (IM.length) setCompare(cmp);
else document.querySelector("#view .viewer").innerHTML = '<p class="empty">No image in this folder.</p>';
// Page Displacements (D-055) : sauts brutaux qui durent et tendances, calculés par explore.py (regime_changes) ; les sauts
// Onglet Displacements (D-055) : sauts brutaux qui durent et tendances, calculés par explore.py (regime_changes) ; les sauts
// groupés en événements, dans l'ordre du temps ; puis toutes les courbes en mm, en gris, celles qui ont sauté ou dérivé
// en couleur. Un clic sur une ligne ouvre Explore, onglet Diagnosis, sur cette cible à cette heure. Données inchangées.
// en couleur. Un clic sur une ligne ouvre l'onglet Diagnosis sur cette cible à cette heure. Données inchangées.
const REG = D.regime, TRENDS = D.trends, RCOL = {}, RULES = D.rules;
[...REG.flatMap(e => e.targets), ...TRENDS.map(f => f.target)]
.forEach(n => { if (!(n in RCOL)) RCOL[n] = PALETTE[Object.keys(RCOL).length % PALETTE.length]; });
@@ -764,21 +761,20 @@ document.getElementById("r-events").innerHTML = REG.length ? REG.map(e => `
· ${e.targets.length === 1 ? `${e.targets[0]} alone` : `${e.targets.length} targets together`}</summary>
<table class="rtable"><thead><tr><th>Target</th><th>Axis</th><th>When</th><th>Jump</th><th>Usual daily swing</th>
<th>Left at end of data</th></tr></thead><tbody>${e.jumps.map(f => `
<tr data-target="${f.target}" data-t="${f.t2}" title="Open in Explore · Diagnosis"><td>${dot(f.target)}</td>
<tr data-target="${f.target}" data-t="${f.t2}" title="Open in Diagnosis"><td>${dot(f.target)}</td>
<td>${f.axis}</td><td>${utc(f.t)} → ${f.t2.slice(11, 16)}</td><td>${signed(f.jump)}</td><td>${f.swing.toFixed(1)} mm</td>
<td>${signed(f.left)}</td></tr>`).join("")}
</tbody></table></details>`).join("")
: '<p class="empty">No jump: no target changed suddenly and stayed there.</p>';
document.getElementById("r-trends").innerHTML = TRENDS.length ? `<table class="rtable"><thead><tr><th>Target</th><th>Axis</th>
<th>Drift over the period</th><th>Per day</th><th>Usual daily swing</th><th>Days</th><th>Jumps set aside</th></tr></thead>
<tbody>${TRENDS.map(f => `<tr data-target="${f.target}" data-t="${f.t}" title="Open in Explore · Diagnosis">
<tbody>${TRENDS.map(f => `<tr data-target="${f.target}" data-t="${f.t}" title="Open in Diagnosis">
<td>${dot(f.target)}</td><td>${f.axis}</td><td>${signed(f.drift)}</td><td>${signed(f.slope, 2)}</td>
<td>${f.swing.toFixed(1)} mm</td><td>${f.days + 1}</td><td>${f.jumps || ""}</td></tr>`).join("")}</tbody></table>`
: '<p class="empty">No trend: no daily level drifted steadily by more than its daily swing.</p>';
document.getElementById("p-displacements").addEventListener("click", ev => { // une ligne : Explore, Diagnosis, cette cible
document.getElementById("displacements").addEventListener("click", ev => { // une ligne : Diagnosis, cette cible à cette heure
const tr = ev.target.closest("tr[data-target]");
if (!tr) return;
goPage("explore");
activate(tabButton("diagnosis"), false);
const i = NAMES.indexOf(tr.dataset.target), j = nearestIndex(Date.parse(tr.dataset.t), TMS);
if (i >= 0) SEL = [i];
@@ -809,17 +805,6 @@ function drawRegime() { // toutes les cibles en gris fin, celles qui ont sauté
}, CONFIG).then(() => autoscale("r-curves"));
}
// Pages : Explore ou Displacements, depuis la barre latérale. Départ : Displacements, sauf adresse d'Explore (#tab=…,
// #img=…) ou #page=explore.
function goPage(p) {
document.querySelectorAll("main > .panel").forEach(e => (e.hidden = e.id !== `p-${p}`));
document.querySelectorAll(".nav a[data-page]").forEach(a => a.classList.toggle("active", a.dataset.page === p));
const plots = p === "explore" ? "#p-explore .pane.active .js-plotly-plot" : "#p-displacements .js-plotly-plot";
document.querySelectorAll(plots).forEach(g => Plotly.Plots.resize(g));
if (p === "explore") zoom(); // la taille des noms sur les images se calcule sur un cadre visible
}
document.querySelectorAll(".nav a[data-page]").forEach(a => a.addEventListener("click", () => goPage(a.dataset.page)));
goPage(ASKED.get("page") || (location.hash.length > 1 ? "explore" : "displacements"));
drawRegime();
</script>
</body>