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 > 0is the attacking team's left, confirmed against the CSV's ownchannel_startlabels (everywide_left/half_space_leftrow hasy > 0and every*_rightrowy < 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
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
readonly [number, number]
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
length | readonly | number | packages/data-providers/src/skillcorner/coordinates.ts:25 |
width | readonly | number | packages/data-providers/src/skillcorner/coordinates.ts:26 |