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 filesAfter 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>
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 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|