IJ-Reynolds HF Staff commited on
Commit
f52fd82
Β·
verified Β·
1 Parent(s): eff79e2

Update app/src/content/embeds/fig-training-curated-labs.html

Browse files
app/src/content/embeds/fig-training-curated-labs.html CHANGED
@@ -65,7 +65,6 @@
65
  cursor: default;
66
  }
67
  .curated-embed .link.alleged { stroke-dasharray: 7 5; }
68
- .curated-embed .link.historical { stroke-dasharray: 1.4 4; stroke-opacity: 0.55; }
69
  .curated-embed .link.highlighted { stroke-opacity: 1; stroke-width: 2.8; }
70
 
71
  .curated-embed .legend {
@@ -85,7 +84,6 @@
85
  .curated-embed .legend-dot { width: clamp(7px, 0.7vw, 9px); height: clamp(7px, 0.7vw, 9px); border-radius: 0; display: inline-block; flex-shrink: 0; }
86
  .curated-embed .legend-line { display: inline-block; width: 22px; height: 0; border-top: 2px solid #1e293b; flex-shrink: 0; }
87
  .curated-embed .legend-line.dashed { border-top-style: dashed; }
88
- .curated-embed .legend-line.dotted { border-top-style: dotted; }
89
  .curated-embed .legend-sep { width: 1px; height: 22px; background: #cbd5e1; align-self: center; }
90
  .curated-embed .legend-item.filter { cursor: pointer; user-select: none; padding: 3px 6px; border-radius: 6px; transition: background 0.15s ease, opacity 0.15s ease; }
91
  .curated-embed .legend-item.filter:hover { background: rgba(15, 23, 42, 0.05); }
@@ -155,7 +153,6 @@
155
  const EVIDENCE_META = {
156
  "confirmed": { label: "confirmed", dashClass: "" },
157
  "alleged": { label: "alleged / rumored", dashClass: "dashed" },
158
- "historical": { label: "historical / weak", dashClass: "dotted" },
159
  };
160
 
161
  // Curated lab β†’ training-chip relationships (author-classified, not derived
@@ -180,15 +177,15 @@
180
  "chips": [
181
  { "id": "google_tpu", "name": "Google TPU", "country": "US" },
182
  { "id": "nvidia", "name": "NVIDIA", "country": "US" },
 
183
  { "id": "alibaba_thead", "name": "Alibaba T-Head", "country": "China" },
184
  { "id": "baidu_kunlun", "name": "Baidu Kunlun", "country": "China" },
185
- { "id": "chinese_chips", "name": "Chinese chips", "country": "China" },
186
  { "id": "huawei_ascend", "name": "Huawei Ascend", "country": "China" },
187
  { "id": "undisclosed", "name": "Undisclosed", "country": "Undisclosed" }
188
  ],
189
  "edges": [
190
  { "lab": "Alibaba", "chip": "nvidia", "evidence": "alleged" },
191
- { "lab": "Alibaba", "chip": "google_tpu", "evidence": "alleged" },
192
  { "lab": "Alibaba", "chip": "alibaba_thead", "evidence": "alleged" },
193
  { "lab": "Baidu", "chip": "nvidia", "evidence": "confirmed" },
194
  { "lab": "Baidu", "chip": "baidu_kunlun", "evidence": "confirmed" },
@@ -200,12 +197,13 @@
200
  { "lab": "Tencent", "chip": "nvidia", "evidence": "confirmed" },
201
  { "lab": "Tencent", "chip": "huawei_ascend", "evidence": "confirmed" },
202
  { "lab": "Tencent", "chip": "chinese_chips", "evidence": "alleged" },
203
- { "lab": "Xiaomi", "chip": "undisclosed", "evidence": "historical" },
204
  { "lab": "Zhipu", "chip": "nvidia", "evidence": "confirmed" },
205
  { "lab": "Zhipu", "chip": "huawei_ascend", "evidence": "confirmed" },
206
  { "lab": "Google", "chip": "google_tpu", "evidence": "confirmed" },
207
  { "lab": "Google", "chip": "nvidia", "evidence": "confirmed" },
208
  { "lab": "Meta", "chip": "nvidia", "evidence": "confirmed" },
 
209
  { "lab": "Microsoft", "chip": "nvidia", "evidence": "confirmed" },
210
  { "lab": "NVIDIA Research", "chip": "nvidia", "evidence": "confirmed" },
211
  { "lab": "Poolside", "chip": "nvidia", "evidence": "confirmed" },
@@ -228,7 +226,7 @@
228
 
229
  const dataset = enrich(RAW);
230
  const activeCountries = new Set(["US", "China", "EU"]);
231
- const activeEvidence = new Set(["confirmed", "alleged", "historical"]);
232
  let _hover = { type: null, value: null };
233
 
234
  // ─── Grid visibility ────────────────────────────────────────────────────
@@ -303,7 +301,7 @@
303
  // Evidence filters
304
  const evSection = root.append("div").attr("class", "legend-section");
305
  const evRow = evSection.append("div").attr("class", "legend-row");
306
- ["confirmed", "alleged", "historical"].forEach((k) => {
307
  const meta = EVIDENCE_META[k];
308
  const item = evRow.append("span")
309
  .attr("class", "legend-block legend-item filter")
@@ -363,8 +361,8 @@
363
  const leftLabelPad = 6;
364
  const longestLabName = d3.max(labs, (l) => l.name.length) || 12;
365
  const longestChipName = d3.max(chips, (c) => c.name.length) || 12;
366
- const labLabelWidth = Math.min(132, longestLabName * 5.6 + 8);
367
- const chipLabelWidth = Math.min(120, longestChipName * 5.8 + 10);
368
 
369
  const maxLabDeg = d3.max(labs, (l) => l.degree) || 1;
370
  const maxChipDeg = d3.max(chips, (c) => c.degree) || 1;
@@ -377,8 +375,9 @@
377
  const bottomPad = Math.max(26, maxChipR + 14);
378
 
379
  const rightEdgePad = 10;
380
- const leftColX = labLabelWidth + leftLabelPad + 4;
381
- const rightColX = width - chipLabelWidth - maxChipR - rightEdgePad - 4;
 
382
 
383
  const labVisible0 = (d) => activeCountries.has(d.country)
384
  && (!edges.some((e) => e.lab === d.name)
@@ -395,14 +394,14 @@
395
  initialChips.forEach((c, i) => { c._y = initialChips.length > 1 ? topPad + i * initChipStep : topPad + vRange / 2; });
396
  labs.filter((l) => !labVisible0(l)).forEach((l) => { if (l._y == null) l._y = topPad + vRange / 2; });
397
 
398
- svg.append("text").attr("class", "col-header").attr("x", rightEdgePad).attr("y", colHeaderY).attr("text-anchor", "start").text("AI LABS (BY HQ COUNTRY)");
399
- svg.append("text").attr("class", "col-header").attr("x", width - rightEdgePad).attr("y", colHeaderY).attr("text-anchor", "end").text("TRAINING-CHIP PLATFORMS");
400
 
401
  const labByName = new Map(labs.map((l) => [l.name, l]));
402
  const chipById = new Map(chips.map((c) => [c.id, c]));
403
 
404
- // Render dotted β†’ dashed β†’ solid so confirmed sits on top
405
- const evOrder = { "historical": 0, "alleged": 1, "confirmed": 2 };
406
  const sortedEdges = edges
407
  .filter((e) => labByName.has(e.lab) && chipById.has(e.chip))
408
  .sort((a, b) => (evOrder[a.evidence] || 0) - (evOrder[b.evidence] || 0));
 
65
  cursor: default;
66
  }
67
  .curated-embed .link.alleged { stroke-dasharray: 7 5; }
 
68
  .curated-embed .link.highlighted { stroke-opacity: 1; stroke-width: 2.8; }
69
 
70
  .curated-embed .legend {
 
84
  .curated-embed .legend-dot { width: clamp(7px, 0.7vw, 9px); height: clamp(7px, 0.7vw, 9px); border-radius: 0; display: inline-block; flex-shrink: 0; }
85
  .curated-embed .legend-line { display: inline-block; width: 22px; height: 0; border-top: 2px solid #1e293b; flex-shrink: 0; }
86
  .curated-embed .legend-line.dashed { border-top-style: dashed; }
 
87
  .curated-embed .legend-sep { width: 1px; height: 22px; background: #cbd5e1; align-self: center; }
88
  .curated-embed .legend-item.filter { cursor: pointer; user-select: none; padding: 3px 6px; border-radius: 6px; transition: background 0.15s ease, opacity 0.15s ease; }
89
  .curated-embed .legend-item.filter:hover { background: rgba(15, 23, 42, 0.05); }
 
153
  const EVIDENCE_META = {
154
  "confirmed": { label: "confirmed", dashClass: "" },
155
  "alleged": { label: "alleged / rumored", dashClass: "dashed" },
 
156
  };
157
 
158
  // Curated lab β†’ training-chip relationships (author-classified, not derived
 
177
  "chips": [
178
  { "id": "google_tpu", "name": "Google TPU", "country": "US" },
179
  { "id": "nvidia", "name": "NVIDIA", "country": "US" },
180
+ { "id": "amd", "name": "AMD", "country": "US" },
181
  { "id": "alibaba_thead", "name": "Alibaba T-Head", "country": "China" },
182
  { "id": "baidu_kunlun", "name": "Baidu Kunlun", "country": "China" },
183
+ { "id": "chinese_chips", "name": "Undisclosed Chinese chips", "country": "China" },
184
  { "id": "huawei_ascend", "name": "Huawei Ascend", "country": "China" },
185
  { "id": "undisclosed", "name": "Undisclosed", "country": "Undisclosed" }
186
  ],
187
  "edges": [
188
  { "lab": "Alibaba", "chip": "nvidia", "evidence": "alleged" },
 
189
  { "lab": "Alibaba", "chip": "alibaba_thead", "evidence": "alleged" },
190
  { "lab": "Baidu", "chip": "nvidia", "evidence": "confirmed" },
191
  { "lab": "Baidu", "chip": "baidu_kunlun", "evidence": "confirmed" },
 
197
  { "lab": "Tencent", "chip": "nvidia", "evidence": "confirmed" },
198
  { "lab": "Tencent", "chip": "huawei_ascend", "evidence": "confirmed" },
199
  { "lab": "Tencent", "chip": "chinese_chips", "evidence": "alleged" },
200
+ { "lab": "Xiaomi", "chip": "undisclosed", "evidence": "alleged" },
201
  { "lab": "Zhipu", "chip": "nvidia", "evidence": "confirmed" },
202
  { "lab": "Zhipu", "chip": "huawei_ascend", "evidence": "confirmed" },
203
  { "lab": "Google", "chip": "google_tpu", "evidence": "confirmed" },
204
  { "lab": "Google", "chip": "nvidia", "evidence": "confirmed" },
205
  { "lab": "Meta", "chip": "nvidia", "evidence": "confirmed" },
206
+ { "lab": "Meta", "chip": "amd", "evidence": "confirmed" },
207
  { "lab": "Microsoft", "chip": "nvidia", "evidence": "confirmed" },
208
  { "lab": "NVIDIA Research", "chip": "nvidia", "evidence": "confirmed" },
209
  { "lab": "Poolside", "chip": "nvidia", "evidence": "confirmed" },
 
226
 
227
  const dataset = enrich(RAW);
228
  const activeCountries = new Set(["US", "China", "EU"]);
229
+ const activeEvidence = new Set(["confirmed", "alleged"]);
230
  let _hover = { type: null, value: null };
231
 
232
  // ─── Grid visibility ────────────────────────────────────────────────────
 
301
  // Evidence filters
302
  const evSection = root.append("div").attr("class", "legend-section");
303
  const evRow = evSection.append("div").attr("class", "legend-row");
304
+ ["confirmed", "alleged"].forEach((k) => {
305
  const meta = EVIDENCE_META[k];
306
  const item = evRow.append("span")
307
  .attr("class", "legend-block legend-item filter")
 
361
  const leftLabelPad = 6;
362
  const longestLabName = d3.max(labs, (l) => l.name.length) || 12;
363
  const longestChipName = d3.max(chips, (c) => c.name.length) || 12;
364
+ const labLabelWidth = Math.min(150, longestLabName * 6.6 + 10);
365
+ const chipLabelWidth = Math.min(200, longestChipName * 6.6 + 12);
366
 
367
  const maxLabDeg = d3.max(labs, (l) => l.degree) || 1;
368
  const maxChipDeg = d3.max(chips, (c) => c.degree) || 1;
 
375
  const bottomPad = Math.max(26, maxChipR + 14);
376
 
377
  const rightEdgePad = 10;
378
+ const edgeNodePad = 2; // extra breathing room outside the outer nodes
379
+ const leftColX = labLabelWidth + leftLabelPad + 4 + edgeNodePad;
380
+ const rightColX = width - chipLabelWidth - maxChipR - rightEdgePad - 4 - edgeNodePad;
381
 
382
  const labVisible0 = (d) => activeCountries.has(d.country)
383
  && (!edges.some((e) => e.lab === d.name)
 
394
  initialChips.forEach((c, i) => { c._y = initialChips.length > 1 ? topPad + i * initChipStep : topPad + vRange / 2; });
395
  labs.filter((l) => !labVisible0(l)).forEach((l) => { if (l._y == null) l._y = topPad + vRange / 2; });
396
 
397
+ svg.append("text").attr("class", "col-header").attr("x", leftColX).attr("y", colHeaderY).attr("text-anchor", "middle").text("AI LABS (BY HQ COUNTRY)");
398
+ svg.append("text").attr("class", "col-header").attr("x", rightColX).attr("y", colHeaderY).attr("text-anchor", "middle").text("TRAINING-CHIP PLATFORMS");
399
 
400
  const labByName = new Map(labs.map((l) => [l.name, l]));
401
  const chipById = new Map(chips.map((c) => [c.id, c]));
402
 
403
+ // Render dashed β†’ solid so confirmed sits on top
404
+ const evOrder = { "alleged": 0, "confirmed": 1 };
405
  const sortedEdges = edges
406
  .filter((e) => labByName.has(e.lab) && chipById.has(e.chip))
407
  .sort((a, b) => (evOrder[a.evidence] || 0) - (evOrder[b.evidence] || 0));