Skip to main content

linkIds

[
  "KC",
  "BUF"
]
import * as Plot from "@observablehq/plot";
import { linkIds } from "@sportsdataverse/sdvplot/plot";

const rows = [
{ team: "KC", wins: 15, net_epa: 0.063 },
{ team: "BUF", wins: 13, net_epa: 0.19 },
];
const svg = Plot.plot({ marks: [Plot.dot(rows, { x: "wins", y: "net_epa", render: linkIds(rows, "team") })] });
Array.from(svg.querySelectorAll("circle")).map((c) => c.getAttribute("data-sdv-id"));

Tags: docstring · linkIds. All sdvplot examples.