surfaceMark
import * as Plot from "@observablehq/plot";
import { surface } from "@sportsdataverse/sporty";
import { surfaceMark } from "@sportsdataverse/sporty/plot";
const court = surface("tennis", "itf");
const [x0, y0, x1, y1] = court.bbox;
Plot.plot({
width: 300,
height: Math.round((300 * (y1 - y0)) / (x1 - x0)),
x: { domain: [x0, x1], axis: null },
y: { domain: [y0, y1], axis: null },
marks: surfaceMark(court),
});
Tags: docstring · surfaceMark. All sporty examples.