PitchKit

PitchProjection()

Defined in: packages/data-providers/src/skillcorner/coordinates.ts:24

SkillCorner puts the origin on the centre spot: x runs from -length/2 to +length/2, y from -width/2 to +width/2, both in metres. Chart libraries — PitchKit included — want a corner origin, so the parsers add pitchX/pitchY alongside the untouched x/y.

The conversion is a pure translation, verified against the data rather than assumed:

  • y > 0 is the attacking team's left, confirmed against the CSV's own channel_start labels (every wide_left/half_space_left row has y > 0 and every *_right row y < 0, across a full match, with no crossover).
  • Drawn with the attack running left-to-right in a y-up frame, the attacker's left is the top of the pitch — high y. So y needs no flip, only the half-width offset.

It deliberately uses the match's own pitch_length/pitch_width, which really do differ per stadium in the open dataset (104, 105 and 106 metres all appear). The output is therefore in that match's real metres. Squeezing it onto some fixed pitch is a rendering decision, and is left to the caller.

PitchProjection(x, y): readonly [number, number];

Defined in: packages/data-providers/src/skillcorner/coordinates.ts:28

Centre-origin metres in, corner-origin metres out.

Parameters

ParameterType
xnumber
ynumber

Returns

readonly [number, number]

Properties

On this page