The same figure under linkedom
import * as Plot from "@observablehq/plot";
import { STANDINGS } from "@sportsdataverse/examples/data";
import { loadLeague } from "@sportsdataverse/sdvplot";
import { logos } from "@sportsdataverse/sdvplot/plot";
import { parseHTML } from "linkedom";
await loadLeague("nfl");
// linkedom is a lighter DOM than jsdom: enough for Plot to build the SVG, no layout.
const { document } = parseHTML("<!doctype html><html><body></body></html>");
const svg: string = Plot.plot({
document,
marks: [logos(STANDINGS, { league: "nfl", x: "pf", y: "pa", team: "team", height: 0.1 })],
}).outerHTML;
svg;
Tags: node · ssr · linkedom · logos · nfl. All sdvplot examples.