Labeler on BREITHORN, October 2026: 26 labels in labeling/auto/ (17 obstructions by a vehicle, the camera's drift in four episodes with the expert's diagnosis: the camera tilts down and its movement is not fully compensated, the targets do not move; four brief camera deviations; one gap); camera tilt sign documented (positive = nose down); labeling tool opens both plots on corr_x and corr_y, labels colored by family

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-03 08:34:03 +01:00
1 parent 262af9fdf4
commit b4166605b5
3 files changed
+37 -5

No files matched your search

+10 -4
View File
@@ -51,7 +51,10 @@ CATEGORIES_LABELS = {"visibilite": "Visibility", "obstruction": "Obstruction", "
# Une figure Plotly n'a qu'un mode de glissement : le plot zoome, la barre, figure à part, sélectionne. Elle reprend à chaque
# changement du plot sa plage et ses marges, la légende pouvant les élargir : c'est ce qui garde les abscisses alignées.
PAGE_JS = """
const GRIS = '#6b6b66', BLEU = '#2a78d6', VOIE = 22; // VOIE : px par rangée d'étiquettes
// une couleur par famille, assez claire pour le texte de la barre ; GRIS : sans famille
const COULEURS = {visibilite: '#8ec5e8', obstruction: '#f0b072', deplacement_thermique: '#f08a7e', deplacement: '#b39ddb',
cible_degradee: '#e6d46a', trou: '#c4c4be', aucune: '#a8d5a2'};
const GRIS = '#6b6b66', couleur = l => COULEURS[l.categorie] || GRIS, BLEU = '#2a78d6', VOIE = 22; // VOIE : px par rangée d'étiquettes
const fig = document.getElementById('fig'), barre = document.getElementById('barre'), menu = document.getElementById('plot'), fig2 = document.getElementById('fig2'), menu2 = document.getElementById('plot2');
const source = document.getElementById('source');
const texte = document.getElementById('texte'), add = document.getElementById('add'), plage = document.getElementById('plage');
@@ -70,7 +73,7 @@ const marge = () => ({l: 60, r: 20, t: 10, b: 30});
function zones() {
const z = (a, b, couleur, o) => ({type: 'rect', xref: 'x', yref: 'paper', x0: lisible(a), x1: lisible(b), y0: 0, y1: 1,
fillcolor: couleur, opacity: o, line: {width: 0}, layer: 'below'});
return labels.map(l => z(l.debut, l.fin, GRIS, 0.2)).concat(choix ? [z(choix[0], choix[1], BLEU, 0.25)] : []);
return labels.map(l => z(l.debut, l.fin, couleur(l), 0.3)).concat(choix ? [z(choix[0], choix[1], BLEU, 0.25)] : []);
}
// Les deux plots et la barre partagent plage et marges : celui qui change impose les siens aux deux autres (rien si déjà alignés,
@@ -107,7 +110,7 @@ function dessineBarre() {
});
const n = Math.max(1, voies.length), f = fig._fullLayout, g = fig2._fullLayout;
return Plotly.react(barre, [{type: 'bar', orientation: 'h', y: voie, base: tries.map(l => lisible(l.debut)),
x: tries.map(l => Date.parse(l.fin) - Date.parse(l.debut)), width: 0.85, marker: {color: GRIS, line: {color: 'white', width: 2}}, // le liseré sépare deux étiquettes bout à bout
x: tries.map(l => Date.parse(l.fin) - Date.parse(l.debut)), width: 0.85, marker: {color: tries.map(couleur), line: {color: 'white', width: 2}}, // le liseré sépare deux étiquettes bout à bout
text: tries.map(l => cat(l) + l.description),
textposition: 'inside', insidetextanchor: 'start', textangle: 0, unselected: {marker: {opacity: 1}}, // sinon une sélection les pâlit
hoverinfo: 'text', hovertext: tries.map(l => `${lisible(l.debut)} → ${lisible(l.fin)} UTC<br>${cat(l)}${l.description.replace(/\\n/g, '<br>')}<br><i>click: read, edit</i>`)}],
@@ -200,7 +203,10 @@ add.onclick = async () => {
await choisit(null);
};
menu2.value = PLOTS.length > 1 ? 1 : 0; // le deuxième plot s'ouvre sur le suivant du menu
// corr_x et corr_y à l'ouverture, ce que l'étiquetage regarde d'abord ; sinon le premier et le suivant du menu
const indice = (titre, sinon) => { const i = PLOTS.findIndex(p => p.titre === titre); return i < 0 ? sinon : i; };
menu.value = indice('Relative Corrected Horizontal Shift', 0);
menu2.value = indice('Relative Corrected Vertical Shift', PLOTS.length > 1 ? 1 : 0);
Promise.all([dessineFig(fig, menu), dessineFig(fig2, menu2)]).then(dessineBarre).then(() => aligne()).then(() => {
fig.on('plotly_relayout', () => aligne(fig));
fig2.on('plotly_relayout', () => aligne(fig2));