mirror of
https://github.com/wassname/moral-maps.git
synced 2026-09-23 13:30:23 +08:00
Prevent WVS frontier label placement crashes
Co-Authored-By: PI[gpt-5.6-terra] <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
co-authored by
PI[gpt-5.6-terra]
parent
08139484c0
commit
912451eaeb
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Frontier LLMs on the World Values Survey</title>
|
||||
<script type="module" crossorigin src="./assets/index-DLUnfEqe.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-DVqE1XzH.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-CiBO8OQd.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -101,6 +101,14 @@ function ReleaseScatter({ data, hidden, field, title, axisMode }) {
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
if (!found) {
|
||||
for (let cy = bounds.top + size.height / 2; cy <= bounds.bottom - size.height / 2 && !found; cy += size.height + 4) {
|
||||
for (let cx = bounds.left + size.width / 2; cx <= bounds.right - size.width / 2; cx += 12) {
|
||||
const candidate = box(cx, cy, size.width, size.height);
|
||||
if (!taken.some(obstacle => hits(candidate, obstacle))) { found = candidate; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) throw new Error(`no frontier label location for ${model.name}`);
|
||||
placement[model.name] = { ...found, anchor };
|
||||
taken.push(found);
|
||||
|
||||
Reference in New Issue
Block a user