Files
site/components/lab.js
zeekay f51da6fa3b Draw each lab's mark on the frontier's points
The plot's discs were bare. They wear their lab's mark again, at the
sizes hanzo-inc/app draws them: a model's disc and mark, Enso's larger,
by the width the drawing is shown at. Those are CSS px, so the plot
reads its own scale off the browser and the discs stay the same at every
width. The dashed discs keep their dash in px too.

A lab with a tile in the agents dock wears that tile's drawing, so a
brand has one mark on the page. Enso's tiers wear Hanzo's H on ink, drawn
last so nothing covers them. Z.ai has no tile and wears hanzoai/icons'
mark; a lab with none wears none, as in the app.

The plot's svg rule named every svg under it and would have resized the
marks; it names the outer one.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
2026-11-09 10:58:44 -08:00

32 lines
1.7 KiB
JavaScript

// The mark a lab wears on its points in the Pareto plot: one drawing per brand. A lab with a tile in the agents dock
// (content.js C.agents) wears that tile's own drawing and colours; Z.ai has none there, so its mark is hanzoai/icons'
// (24 units, as hanzo-inc/app draws it), in the colour Z.ai publishes. Enso's tiers wear Hanzo's H, the Hanzo Dev tile.
// A model of any other lab wears nothing, as in the app.
import C from '../content.js';
const ZAI = { box: '0 0 24 24', rule: 'evenodd', inner: '<path fill="#3859FF" d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path>' };
// a dock tile's icon, as markup: a flat mark is an inline svg, a gradient mark a file
const tile = (name) => {
const html = C.agents.find((a) => a.name === name)?.icon;
if (!html) throw new Error(`lab: the agents dock has no tile named ${name}`);
const src = /<img[^>]*\ssrc="([^"]+)"/.exec(html)?.[1];
if (src) return { src };
const root = html.slice(0, html.indexOf('>'));
return { box: /viewbox="([^"]+)"/i.exec(root)[1], rule: /fill-rule="([^"]+)"/.exec(root)?.[1], inner: html.slice(html.indexOf('>') + 1, html.lastIndexOf('</svg>')) };
};
const OF = [
[/^Claude\b/, () => tile('Claude')],
[/^(GPT|o\d)/, () => tile('ChatGPT')],
[/^Gemini\b/, () => tile('Gemini CLI')],
[/^Grok\b/, () => tile('Grok Build')],
[/^DeepSeek\b/, () => tile('DeepSeek')],
[/^Kimi\b/, () => tile('Kimi')],
[/^GLM\b/, () => ZAI],
[/^Muse\b/, () => tile('Muse')],
];
// the mark of a point: an Enso tier's is Hanzo's H; null where the lab has none
export const lab = (name, ours) => (ours ? tile('Hanzo Dev') : (OF.find(([re]) => re.test(name))?.[1]() ?? null));