Download code/web/src/lib/galaxy.worker.ts from MiniMaxAI/oss-ecosystem-data: direct link, hf CLI and curl.
- Browser
- Download file 528 Bytes
-
https://huggingface.co/datasets/MiniMaxAI/oss-ecosystem-data/resolve/f660f69a80e04e319d382505deb00b8b3e642feb/code/web/src/lib/galaxy.worker.ts
- Command line
-
hf download hf://datasets/MiniMaxAI/oss-ecosystem-data@f660f69a80e04e319d382505deb00b8b3e642feb/code/web/src/lib/galaxy.worker.ts
-
curl -L -o galaxy.worker.ts https://huggingface.co/datasets/MiniMaxAI/oss-ecosystem-data/resolve/f660f69a80e04e319d382505deb00b8b3e642feb/code/web/src/lib/galaxy.worker.ts
528 Bytes
| import { layoutGalaxy } from "./galaxy" | |
| import type { Repo } from "./types" | |
| // The force layout takes a second or two for ~1,300 bubbles; doing it here keeps the page responsive. | |
| self.onmessage = (e: MessageEvent<{ key: string; repos: Repo[]; base: string; officialDl: number }>) => { | |
| const { key, repos, base, officialDl } = e.data | |
| const g = layoutGalaxy(repos, base, officialDl) | |
| const pos = g.nodes.map((n) => [n.id, n.x, n.y, n.r, n.ring] as const) | |
| self.postMessage({ key, pos, rings: g.rings, extent: g.extent }) | |
| } | |