Soccer shot map

Soccer shot mapDrawn as: a soccer pitch, 105 by 68 metres, with the halfway line, the centre circle, both penalty areas, goal areas, penalty marks and arcs, the corner arcs and the goals. Half of it is shown. Data: 24 shots. By outcome: Goal 6, Saved 6, Off target 6, Blocked 6. The size of a mark shows its expected goals (xG). Key. Goal, Saved, Off target, Blocked Key. Size: xG, xG 5.1624 shotsBy outcome: Goal 6, Saved 6, Off target 6, Blocked 6. The size of a mark shows its expected goals (xG).KeyGoal, Saved, Off target, BlockedKeySize: xG, xG 5.16GoalSavedOff targetBlockedSize: xGxG 5.16

The picture above was drawn when the docs were built. The script below draws it again with the published package.

import { soccerShotMap } from "@johnmorrisdotca/kyogijo-stadiums/charts";

const outcomes = ["goal", "saved", "missed", "blocked"];
const shots = Array.from({ length: 24 }, (_, i) => ({ x: 84 + ((i * 7) % 30), y: 18 + ((i * 11) % 44), outcome: outcomes[i % 4], xg: 0.04 + (i % 8) / 20 }));
const svg = soccerShotMap(shots, { provider: "statsbomb", half: true }).draw();

This page imports the package from jsDelivr (major version 0), which serves only versions that have been published to npm. A feature added after the last release is not in it: the page then keeps the picture above and says why. The docs were built from version 0.6.1.