Jonna Marie Matthiesen Copilot commited on
Commit
5e234e6
Β·
1 Parent(s): 9527fc8

Use descriptive names when multiple models would share the same chart label

Browse files

After assigning short labels, detect duplicates (e.g. multiple
'Original' entries) and replace them with the model's full short name
for clarity.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Files changed (1) hide show
  1. app.js +12 -0
app.js CHANGED
@@ -195,6 +195,18 @@ function assignModelColors() {
195
  MODEL_SHORT[model] = suffix || (isExternalModel(model) ? "Original" : name);
196
  });
197
  });
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
199
 
200
  // ─── Helpers ──────────────────────────────────────────────────────────────────
 
195
  MODEL_SHORT[model] = suffix || (isExternalModel(model) ? "Original" : name);
196
  });
197
  });
198
+ // Resolve duplicate short labels: use the model's short name instead
199
+ const labelCounts = {};
200
+ for (const m of ALL_MODELS) {
201
+ const lbl = MODEL_SHORT[m];
202
+ if (!labelCounts[lbl]) labelCounts[lbl] = [];
203
+ labelCounts[lbl].push(m);
204
+ }
205
+ for (const [lbl, models] of Object.entries(labelCounts)) {
206
+ if (models.length > 1) {
207
+ models.forEach(m => { MODEL_SHORT[m] = m.split("/").pop(); });
208
+ }
209
+ }
210
  }
211
 
212
  // ─── Helpers ──────────────────────────────────────────────────────────────────