@luceosports/play-rendering 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/play-rendering.js +1 -1
- package/dist/play-rendering.js.map +1 -1
- package/dist/types/constants.d.ts +41 -41
- package/dist/types/helpers/common.d.ts +4 -4
- package/dist/types/layers/court/index.d.ts +18 -18
- package/dist/types/math/Bezier.d.ts +19 -19
- package/dist/types/math/LineDrawingMath.d.ts +8 -8
- package/dist/types/models/AnimationModel.d.ts +20 -20
- package/dist/types/models/FrameModel.d.ts +38 -38
- package/dist/types/models/LineModel.d.ts +21 -21
- package/dist/types/models/NoteModel.d.ts +16 -16
- package/dist/types/models/PlayerModel.d.ts +20 -20
- package/dist/types/models/ShapeModels/CircleShape.d.ts +8 -8
- package/dist/types/models/ShapeModels/ConeShape.d.ts +8 -8
- package/dist/types/models/ShapeModels/FovShape.d.ts +12 -12
- package/dist/types/models/ShapeModels/LineShape.d.ts +11 -11
- package/dist/types/models/ShapeModels/SquareShape.d.ts +8 -8
- package/dist/types/models/ShapeModels/StraightShape.d.ts +12 -12
- package/dist/types/models/ShapeModels/TriangleShape.d.ts +12 -12
- package/dist/types/models/ShapeModels/XmarkShape.d.ts +8 -8
- package/dist/types/models/ShapeModels/index.d.ts +14 -14
- package/dist/types/models/ShapeModels/line/CutLineShape.d.ts +3 -3
- package/dist/types/models/ShapeModels/line/DribbleLineShape.d.ts +3 -3
- package/dist/types/models/ShapeModels/line/HandoffLineShape.d.ts +3 -3
- package/dist/types/models/ShapeModels/line/PassLineShape.d.ts +3 -3
- package/dist/types/models/ShapeModels/line/ScreenLineShape.d.ts +3 -3
- package/dist/types/types/index.d.ts +137 -137
- package/package.json +1 -1
- package/src/layers/PlayerLayer.ts +3 -5
- package/src/layers/court/layers/BASEBALL/courtTypes/BASEBALL_HIGH_SCHOOL/layers/index.ts +6 -6
- package/src/layers/court/layers/BASEBALL/layers/index.ts +3 -3
- package/src/layers/court/layers/FOOTBALL/layers/index.ts +8 -8
- package/src/layers/court/layers/HOCKEY/layers/index.ts +19 -19
- package/src/layers/court/layers/LACROSSE/layers/index.ts +4 -4
- package/src/layers/court/layers/SOCCER/courtTypes/SOCCER_NCAA/layers/index.ts +5 -5
- package/src/layers/court/layers/SOCCER/courtTypes/SOCCER_NFHS/layers/index.ts +4 -4
- package/src/layers/court/layers/SOCCER/courtTypes/SOCCER_U10/layers/index.ts +4 -4
- package/src/layers/court/layers/SOCCER/courtTypes/SOCCER_U12/layers/index.ts +3 -3
- package/src/layers/court/layers/SOCCER/layers/index.ts +19 -19
- package/src/layers/court/layers/VOLLEYBALL/layers/index.ts +6 -6
- package/src/layers/line/index.ts +8 -8
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
export declare const SPORT_TYPE_BASKETBALL = "BASKETBALL";
|
|
2
|
-
export declare const SPORT_TYPE_VOLLEYBALL = "VOLLEYBALL";
|
|
3
|
-
export declare const SPORT_TYPE_FOOTBALL = "FOOTBALL";
|
|
4
|
-
export declare const SPORT_TYPE_LACROSSE = "LACROSSE";
|
|
5
|
-
export declare const SPORT_TYPE_SOCCER = "SOCCER";
|
|
6
|
-
export declare const SPORT_TYPE_HOCKEY = "HOCKEY";
|
|
7
|
-
export declare const SPORT_TYPE_BASEBALL = "BASEBALL";
|
|
8
|
-
export declare const COURT_TYPE_BIG3 = "BIG3";
|
|
9
|
-
export declare const COURT_TYPE_FIBA = "FIBA";
|
|
10
|
-
export declare const COURT_TYPE_NBA = "NBA";
|
|
11
|
-
export declare const COURT_TYPE_NCAAM = "NCAAM";
|
|
12
|
-
export declare const COURT_TYPE_NCAAW = "NCAAW";
|
|
13
|
-
export declare const COURT_TYPE_US_HIGH_SCHOOL = "US_HIGH_SCHOOL";
|
|
14
|
-
export declare const COURT_TYPE_US_JUNIOR_HIGH = "US_JUNIOR_HIGH";
|
|
15
|
-
export declare const COURT_TYPE_WNBA = "WNBA";
|
|
16
|
-
export declare const COURT_TYPE_FOOTBALL_HIGH_SCHOOL = "FOOTBALL_HIGH_SCHOOL";
|
|
17
|
-
export declare const COURT_TYPE_FOOTBALL_HIGH_SCHOOL_LEGACY = "FOOTBALL";
|
|
18
|
-
export declare const COURT_TYPE_VOLLEYBALL_INDOOR = "VOLLEYBALL_INDOOR";
|
|
19
|
-
export declare const COURT_TYPE_LACROSSE_US_M = "LACROSSE_US_M";
|
|
20
|
-
export declare const COURT_TYPE_LACROSSE_US_W = "LACROSSE_US_W";
|
|
21
|
-
export declare const COURT_TYPE_SOCCER_FIFA = "SOCCER_FIFA";
|
|
22
|
-
export declare const COURT_TYPE_SOCCER_NCAA = "SOCCER_NCAA";
|
|
23
|
-
export declare const COURT_TYPE_SOCCER_NFHS = "SOCCER_NFHS";
|
|
24
|
-
export declare const COURT_TYPE_SOCCER_U10 = "SOCCER_U10";
|
|
25
|
-
export declare const COURT_TYPE_SOCCER_U12 = "SOCCER_U12";
|
|
26
|
-
export declare const COURT_TYPE_SOCCER_U19 = "SOCCER_U19";
|
|
27
|
-
export declare const COURT_TYPE_HOCKEY_NHL = "HOCKEY_NHL";
|
|
28
|
-
export declare const COURT_TYPE_HOCKEY_INTERNATIONAL = "HOCKEY_INTERNATIONAL";
|
|
29
|
-
export declare const COURT_TYPE_BASEBALL_HIGH_SCHOOL = "BASEBALL_HIGH_SCHOOL";
|
|
30
|
-
export declare const SHAPE_TYPE_CIRCLE = "CIRCLE";
|
|
31
|
-
export declare const SHAPE_TYPE_SQUARE = "SQUARE";
|
|
32
|
-
export declare const SHAPE_TYPE_TRIANGLE = "TRIANGLE";
|
|
33
|
-
export declare const SHAPE_TYPE_FOV = "FOV";
|
|
34
|
-
export declare const SHAPE_TYPE_XMARK = "XMARK";
|
|
35
|
-
export declare const SHAPE_TYPE_STRAIGHT = "STRAIGHT";
|
|
36
|
-
export declare const SHAPE_TYPE_CONE = "CONE";
|
|
37
|
-
export declare const SHAPE_TYPE_LINE_CUT = "LINE.CUT";
|
|
38
|
-
export declare const SHAPE_TYPE_LINE_SCREEN = "LINE.SCREEN";
|
|
39
|
-
export declare const SHAPE_TYPE_LINE_DRIBBLE = "LINE.DRIBBLE";
|
|
40
|
-
export declare const SHAPE_TYPE_LINE_PASS = "LINE.PASS";
|
|
41
|
-
export declare const SHAPE_TYPE_LINE_HANDOFF = "LINE.HANDOFF";
|
|
1
|
+
export declare const SPORT_TYPE_BASKETBALL = "BASKETBALL";
|
|
2
|
+
export declare const SPORT_TYPE_VOLLEYBALL = "VOLLEYBALL";
|
|
3
|
+
export declare const SPORT_TYPE_FOOTBALL = "FOOTBALL";
|
|
4
|
+
export declare const SPORT_TYPE_LACROSSE = "LACROSSE";
|
|
5
|
+
export declare const SPORT_TYPE_SOCCER = "SOCCER";
|
|
6
|
+
export declare const SPORT_TYPE_HOCKEY = "HOCKEY";
|
|
7
|
+
export declare const SPORT_TYPE_BASEBALL = "BASEBALL";
|
|
8
|
+
export declare const COURT_TYPE_BIG3 = "BIG3";
|
|
9
|
+
export declare const COURT_TYPE_FIBA = "FIBA";
|
|
10
|
+
export declare const COURT_TYPE_NBA = "NBA";
|
|
11
|
+
export declare const COURT_TYPE_NCAAM = "NCAAM";
|
|
12
|
+
export declare const COURT_TYPE_NCAAW = "NCAAW";
|
|
13
|
+
export declare const COURT_TYPE_US_HIGH_SCHOOL = "US_HIGH_SCHOOL";
|
|
14
|
+
export declare const COURT_TYPE_US_JUNIOR_HIGH = "US_JUNIOR_HIGH";
|
|
15
|
+
export declare const COURT_TYPE_WNBA = "WNBA";
|
|
16
|
+
export declare const COURT_TYPE_FOOTBALL_HIGH_SCHOOL = "FOOTBALL_HIGH_SCHOOL";
|
|
17
|
+
export declare const COURT_TYPE_FOOTBALL_HIGH_SCHOOL_LEGACY = "FOOTBALL";
|
|
18
|
+
export declare const COURT_TYPE_VOLLEYBALL_INDOOR = "VOLLEYBALL_INDOOR";
|
|
19
|
+
export declare const COURT_TYPE_LACROSSE_US_M = "LACROSSE_US_M";
|
|
20
|
+
export declare const COURT_TYPE_LACROSSE_US_W = "LACROSSE_US_W";
|
|
21
|
+
export declare const COURT_TYPE_SOCCER_FIFA = "SOCCER_FIFA";
|
|
22
|
+
export declare const COURT_TYPE_SOCCER_NCAA = "SOCCER_NCAA";
|
|
23
|
+
export declare const COURT_TYPE_SOCCER_NFHS = "SOCCER_NFHS";
|
|
24
|
+
export declare const COURT_TYPE_SOCCER_U10 = "SOCCER_U10";
|
|
25
|
+
export declare const COURT_TYPE_SOCCER_U12 = "SOCCER_U12";
|
|
26
|
+
export declare const COURT_TYPE_SOCCER_U19 = "SOCCER_U19";
|
|
27
|
+
export declare const COURT_TYPE_HOCKEY_NHL = "HOCKEY_NHL";
|
|
28
|
+
export declare const COURT_TYPE_HOCKEY_INTERNATIONAL = "HOCKEY_INTERNATIONAL";
|
|
29
|
+
export declare const COURT_TYPE_BASEBALL_HIGH_SCHOOL = "BASEBALL_HIGH_SCHOOL";
|
|
30
|
+
export declare const SHAPE_TYPE_CIRCLE = "CIRCLE";
|
|
31
|
+
export declare const SHAPE_TYPE_SQUARE = "SQUARE";
|
|
32
|
+
export declare const SHAPE_TYPE_TRIANGLE = "TRIANGLE";
|
|
33
|
+
export declare const SHAPE_TYPE_FOV = "FOV";
|
|
34
|
+
export declare const SHAPE_TYPE_XMARK = "XMARK";
|
|
35
|
+
export declare const SHAPE_TYPE_STRAIGHT = "STRAIGHT";
|
|
36
|
+
export declare const SHAPE_TYPE_CONE = "CONE";
|
|
37
|
+
export declare const SHAPE_TYPE_LINE_CUT = "LINE.CUT";
|
|
38
|
+
export declare const SHAPE_TYPE_LINE_SCREEN = "LINE.SCREEN";
|
|
39
|
+
export declare const SHAPE_TYPE_LINE_DRIBBLE = "LINE.DRIBBLE";
|
|
40
|
+
export declare const SHAPE_TYPE_LINE_PASS = "LINE.PASS";
|
|
41
|
+
export declare const SHAPE_TYPE_LINE_HANDOFF = "LINE.HANDOFF";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ShapeType } from '../../play-rendering';
|
|
2
|
-
import ShapeModels from '../../types/models/ShapeModels'
|
|
3
|
-
|
|
4
|
-
export declare function transformShapeTypeToImportKey(type: ShapeType): string;
|
|
1
|
+
import { ShapeType } from '../../play-rendering';
|
|
2
|
+
import ShapeModels from '../../types/models/ShapeModels'
|
|
3
|
+
|
|
4
|
+
export declare function transformShapeTypeToImportKey(type: ShapeType): string;
|
|
5
5
|
export declare function shapeModelKeyFromImport(shapeModels: typeof ShapeModels, type: ShapeType): keyof typeof ShapeModels;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CourtType, SportType } from '../../types';
|
|
2
|
-
export type SportConstants = {
|
|
3
|
-
COURT_LINE_WIDTH: number;
|
|
4
|
-
PLAYER_TOKEN_RADIUS: number;
|
|
5
|
-
PLAYER_TOKEN_SCALE: number;
|
|
6
|
-
LINE_WIDTH: number;
|
|
7
|
-
LINE_MASKING: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type CourtTypeConstants = {
|
|
10
|
-
COURT_RECT_WIDTH: number;
|
|
11
|
-
COURT_RECT_HEIGHT: number;
|
|
12
|
-
} & Record<string, any>;
|
|
13
|
-
declare const sportConstants: Record<SportType, SportConstants>;
|
|
14
|
-
declare const courtTypeConstants: Record<CourtType, CourtTypeConstants>;
|
|
15
|
-
declare const sportCourtTypeMap: Record<SportType, {
|
|
16
|
-
courtTypes: CourtType[];
|
|
17
|
-
}>;
|
|
18
|
-
export { sportConstants, courtTypeConstants, sportCourtTypeMap };
|
|
1
|
+
import { CourtType, SportType } from '../../types';
|
|
2
|
+
export type SportConstants = {
|
|
3
|
+
COURT_LINE_WIDTH: number;
|
|
4
|
+
PLAYER_TOKEN_RADIUS: number;
|
|
5
|
+
PLAYER_TOKEN_SCALE: number;
|
|
6
|
+
LINE_WIDTH: number;
|
|
7
|
+
LINE_MASKING: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type CourtTypeConstants = {
|
|
10
|
+
COURT_RECT_WIDTH: number;
|
|
11
|
+
COURT_RECT_HEIGHT: number;
|
|
12
|
+
} & Record<string, any>;
|
|
13
|
+
declare const sportConstants: Record<SportType, SportConstants>;
|
|
14
|
+
declare const courtTypeConstants: Record<CourtType, CourtTypeConstants>;
|
|
15
|
+
declare const sportCourtTypeMap: Record<SportType, {
|
|
16
|
+
courtTypes: CourtType[];
|
|
17
|
+
}>;
|
|
18
|
+
export { sportConstants, courtTypeConstants, sportCourtTypeMap };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { CourtPoint } from '../types';
|
|
2
|
-
export class Bezier {
|
|
3
|
-
private a;
|
|
4
|
-
private b;
|
|
5
|
-
private c;
|
|
6
|
-
private d;
|
|
7
|
-
length: number;
|
|
8
|
-
private readonly len;
|
|
9
|
-
private readonly arcLengths;
|
|
10
|
-
constructor(a: CourtPoint, b: CourtPoint, c?: CourtPoint, d?: CourtPoint);
|
|
11
|
-
x(t: number): number;
|
|
12
|
-
y(t: number): number;
|
|
13
|
-
map(u: number): number;
|
|
14
|
-
mx(u: number): number;
|
|
15
|
-
my(u: number): number;
|
|
16
|
-
linearBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
17
|
-
quadraticBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
18
|
-
cubicBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
19
|
-
}
|
|
1
|
+
import { CourtPoint } from '../types';
|
|
2
|
+
export class Bezier {
|
|
3
|
+
private a;
|
|
4
|
+
private b;
|
|
5
|
+
private c;
|
|
6
|
+
private d;
|
|
7
|
+
length: number;
|
|
8
|
+
private readonly len;
|
|
9
|
+
private readonly arcLengths;
|
|
10
|
+
constructor(a: CourtPoint, b: CourtPoint, c?: CourtPoint, d?: CourtPoint);
|
|
11
|
+
x(t: number): number;
|
|
12
|
+
y(t: number): number;
|
|
13
|
+
map(u: number): number;
|
|
14
|
+
mx(u: number): number;
|
|
15
|
+
my(u: number): number;
|
|
16
|
+
linearBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
17
|
+
quadraticBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
18
|
+
cubicBezierEquation(t: number, axis: 'x' | 'y'): number;
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CourtPoint, LinePart } from '../types';
|
|
2
|
-
export declare function adjustedBezierCurveWithExclusionZones(controlPoints: CourtPoint[], startZoneRadius?: any, startAnchor?: any, endZoneRadius?: any, endAnchor?: any): [CourtPoint, CourtPoint] | [CourtPoint, CourtPoint, CourtPoint] | [CourtPoint, CourtPoint, CourtPoint, CourtPoint];
|
|
3
|
-
export declare function distanceBetweenPoints(point1: CourtPoint, point2: CourtPoint): number;
|
|
4
|
-
export declare function splitBezierCurveAtTVal(controlPoints: CourtPoint[], tVal: number): CourtPoint[][];
|
|
5
|
-
export declare function bezierBoundingBox(controlPoints: LinePart['controlPoints']): {
|
|
6
|
-
x: any;
|
|
7
|
-
y: any;
|
|
8
|
-
}[];
|
|
1
|
+
import { CourtPoint, LinePart } from '../types';
|
|
2
|
+
export declare function adjustedBezierCurveWithExclusionZones(controlPoints: CourtPoint[], startZoneRadius?: any, startAnchor?: any, endZoneRadius?: any, endAnchor?: any): [CourtPoint, CourtPoint] | [CourtPoint, CourtPoint, CourtPoint] | [CourtPoint, CourtPoint, CourtPoint, CourtPoint];
|
|
3
|
+
export declare function distanceBetweenPoints(point1: CourtPoint, point2: CourtPoint): number;
|
|
4
|
+
export declare function splitBezierCurveAtTVal(controlPoints: CourtPoint[], tVal: number): CourtPoint[][];
|
|
5
|
+
export declare function bezierBoundingBox(controlPoints: LinePart['controlPoints']): {
|
|
6
|
+
x: any;
|
|
7
|
+
y: any;
|
|
8
|
+
}[];
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { PlayModel } from "../../play-rendering";
|
|
2
|
-
|
|
3
|
-
export class AnimationModel {
|
|
4
|
-
constructor(ctx: CanvasRenderingContext2D, play: PlayModel);
|
|
5
|
-
get animationDuration(): number;
|
|
6
|
-
get globalProgress(): number;
|
|
7
|
-
get currentPlayPhase(): number;
|
|
8
|
-
get linesPhaseIntervals(): Record<number, {
|
|
9
|
-
min: number;
|
|
10
|
-
max: number;
|
|
11
|
-
}>;
|
|
12
|
-
get lastLineAnimationMax(): number;
|
|
13
|
-
start(finishCallback: () => void, progressCallback: (progress: number) => void): void;
|
|
14
|
-
pause(): void;
|
|
15
|
-
setProgress(progress: number): this;
|
|
16
|
-
refreshAnimationFrameProgress(): void;
|
|
17
|
-
drawPreviewFrame(): void;
|
|
18
|
-
reset(): void;
|
|
19
|
-
countTimeElapsedFromProgress(progress: number): number;
|
|
20
|
-
drawFrame(finishCallback: () => void, progressCallback: (progress: number) => void, timestamp: number): void;
|
|
1
|
+
import { PlayModel } from "../../play-rendering";
|
|
2
|
+
|
|
3
|
+
export class AnimationModel {
|
|
4
|
+
constructor(ctx: CanvasRenderingContext2D, play: PlayModel);
|
|
5
|
+
get animationDuration(): number;
|
|
6
|
+
get globalProgress(): number;
|
|
7
|
+
get currentPlayPhase(): number;
|
|
8
|
+
get linesPhaseIntervals(): Record<number, {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
}>;
|
|
12
|
+
get lastLineAnimationMax(): number;
|
|
13
|
+
start(finishCallback: () => void, progressCallback: (progress: number) => void): void;
|
|
14
|
+
pause(): void;
|
|
15
|
+
setProgress(progress: number): this;
|
|
16
|
+
refreshAnimationFrameProgress(): void;
|
|
17
|
+
drawPreviewFrame(): void;
|
|
18
|
+
reset(): void;
|
|
19
|
+
countTimeElapsedFromProgress(progress: number): number;
|
|
20
|
+
drawFrame(finishCallback: () => void, progressCallback: (progress: number) => void, timestamp: number): void;
|
|
21
21
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Court, CourtPoint, LineModel, NoteModel, PlayModel, PlayerModel, ShapeModel, SportType } from "../../play-rendering";
|
|
2
|
-
|
|
3
|
-
type InferEntityFromObjectType<T> = T extends 'player' ? PlayerModel : T extends 'note' ? NoteModel : T extends 'shape' ? ShapeModel : LineModel;
|
|
4
|
-
|
|
5
|
-
type ClosestObjectDistance<T extends PlayerModel | ShapeModel | NoteModel | LineModel> = {
|
|
6
|
-
object: T;
|
|
7
|
-
objectPoint: CourtPoint;
|
|
8
|
-
distance: number;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export class FrameModel {
|
|
12
|
-
constructor(play: PlayModel, phase?: number, animationGlobalProgress?: number);
|
|
13
|
-
get sport(): SportType;
|
|
14
|
-
get court(): Court;
|
|
15
|
-
get frameWidth(): number;
|
|
16
|
-
get frameHeight(): number;
|
|
17
|
-
get playAnimationDuration(): number;
|
|
18
|
-
get lines(): LineModel[];
|
|
19
|
-
get players(): PlayerModel[];
|
|
20
|
-
get shapes(): ShapeModel[];
|
|
21
|
-
get notes(): NoteModel[];
|
|
22
|
-
get currentPhasePlayers(): PlayerModel[];
|
|
23
|
-
get currentPhaseLines(): LineModel[];
|
|
24
|
-
get animationProgressPlayers(): PlayerModel[];
|
|
25
|
-
get animationProgressLines(): LineModel[];
|
|
26
|
-
get playDataLines(): LineModel[];
|
|
27
|
-
get prevPhaseLines(): LineModel[];
|
|
28
|
-
get prevAnimationLines(): LineModel[];
|
|
29
|
-
draw(): this;
|
|
30
|
-
setContext(ctx: CanvasRenderingContext2D): this;
|
|
31
|
-
setPhase(newPhase: number): this;
|
|
32
|
-
setAnimationGlobalProgress(newProgress: number): this;
|
|
33
|
-
animationProgress(start: number, end: number): number;
|
|
34
|
-
closestObjectToPoint<T extends 'player' | 'shape' | 'note' | 'line' | 'lineVertex'>(viewPoint: CourtPoint, objectType: T, needConversion?: boolean, filterCallback?: (subject: InferEntityFromObjectType<T>) => boolean): ClosestObjectDistance<InferEntityFromObjectType<T>> | null;
|
|
35
|
-
convertViewPointToCourtPoint(viewPoint: CourtPoint): {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
};
|
|
1
|
+
import { Court, CourtPoint, LineModel, NoteModel, PlayModel, PlayerModel, ShapeModel, SportType } from "../../play-rendering";
|
|
2
|
+
|
|
3
|
+
type InferEntityFromObjectType<T> = T extends 'player' ? PlayerModel : T extends 'note' ? NoteModel : T extends 'shape' ? ShapeModel : LineModel;
|
|
4
|
+
|
|
5
|
+
type ClosestObjectDistance<T extends PlayerModel | ShapeModel | NoteModel | LineModel> = {
|
|
6
|
+
object: T;
|
|
7
|
+
objectPoint: CourtPoint;
|
|
8
|
+
distance: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export class FrameModel {
|
|
12
|
+
constructor(play: PlayModel, phase?: number, animationGlobalProgress?: number);
|
|
13
|
+
get sport(): SportType;
|
|
14
|
+
get court(): Court;
|
|
15
|
+
get frameWidth(): number;
|
|
16
|
+
get frameHeight(): number;
|
|
17
|
+
get playAnimationDuration(): number;
|
|
18
|
+
get lines(): LineModel[];
|
|
19
|
+
get players(): PlayerModel[];
|
|
20
|
+
get shapes(): ShapeModel[];
|
|
21
|
+
get notes(): NoteModel[];
|
|
22
|
+
get currentPhasePlayers(): PlayerModel[];
|
|
23
|
+
get currentPhaseLines(): LineModel[];
|
|
24
|
+
get animationProgressPlayers(): PlayerModel[];
|
|
25
|
+
get animationProgressLines(): LineModel[];
|
|
26
|
+
get playDataLines(): LineModel[];
|
|
27
|
+
get prevPhaseLines(): LineModel[];
|
|
28
|
+
get prevAnimationLines(): LineModel[];
|
|
29
|
+
draw(): this;
|
|
30
|
+
setContext(ctx: CanvasRenderingContext2D): this;
|
|
31
|
+
setPhase(newPhase: number): this;
|
|
32
|
+
setAnimationGlobalProgress(newProgress: number): this;
|
|
33
|
+
animationProgress(start: number, end: number): number;
|
|
34
|
+
closestObjectToPoint<T extends 'player' | 'shape' | 'note' | 'line' | 'lineVertex'>(viewPoint: CourtPoint, objectType: T, needConversion?: boolean, filterCallback?: (subject: InferEntityFromObjectType<T>) => boolean): ClosestObjectDistance<InferEntityFromObjectType<T>> | null;
|
|
35
|
+
convertViewPointToCourtPoint(viewPoint: CourtPoint): {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
39
39
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Color, CourtPoint, Line, LineAnimation, LinePart, LineType, Position } from '../../play-rendering';
|
|
2
|
-
|
|
3
|
-
export class LineModel {
|
|
4
|
-
readonly lineParts: LinePart[];
|
|
5
|
-
constructor(data: Line);
|
|
6
|
-
get id(): string;
|
|
7
|
-
get color(): Color;
|
|
8
|
-
set color(value: Color);
|
|
9
|
-
get type(): LineType;
|
|
10
|
-
get phase(): number;
|
|
11
|
-
get playerPositionOrigin(): Position;
|
|
12
|
-
get playerPositionTerminus(): Position;
|
|
13
|
-
get playerLineSequence(): number;
|
|
14
|
-
get hideLineTip(): boolean;
|
|
15
|
-
get animations(): LineAnimation[];
|
|
16
|
-
get animationsByEndTime(): number[];
|
|
17
|
-
get animationKeyTimeChunks(): [number, number][];
|
|
18
|
-
set animationKeyTimeChunks(value: [number, number][]);
|
|
19
|
-
get lastAnimEndTime(): number;
|
|
20
|
-
get firstLinePartControlPoint(): CourtPoint;
|
|
21
|
-
get lastLinePartControlPoint(): CourtPoint;
|
|
1
|
+
import { Color, CourtPoint, Line, LineAnimation, LinePart, LineType, Position } from '../../play-rendering';
|
|
2
|
+
|
|
3
|
+
export class LineModel {
|
|
4
|
+
readonly lineParts: LinePart[];
|
|
5
|
+
constructor(data: Line);
|
|
6
|
+
get id(): string;
|
|
7
|
+
get color(): Color;
|
|
8
|
+
set color(value: Color);
|
|
9
|
+
get type(): LineType;
|
|
10
|
+
get phase(): number;
|
|
11
|
+
get playerPositionOrigin(): Position;
|
|
12
|
+
get playerPositionTerminus(): Position;
|
|
13
|
+
get playerLineSequence(): number;
|
|
14
|
+
get hideLineTip(): boolean;
|
|
15
|
+
get animations(): LineAnimation[];
|
|
16
|
+
get animationsByEndTime(): number[];
|
|
17
|
+
get animationKeyTimeChunks(): [number, number][];
|
|
18
|
+
set animationKeyTimeChunks(value: [number, number][]);
|
|
19
|
+
get lastAnimEndTime(): number;
|
|
20
|
+
get firstLinePartControlPoint(): CourtPoint;
|
|
21
|
+
get lastLinePartControlPoint(): CourtPoint;
|
|
22
22
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Color, CourtPoint, Note, NoteAnimation, NoteFont } from "../../play-rendering";
|
|
2
|
-
|
|
3
|
-
export class NoteModel {
|
|
4
|
-
constructor(data: Note);
|
|
5
|
-
get id(): string;
|
|
6
|
-
get text(): string;
|
|
7
|
-
get location(): CourtPoint;
|
|
8
|
-
get color(): Color;
|
|
9
|
-
get showBorder(): boolean;
|
|
10
|
-
get animations(): NoteAnimation[];
|
|
11
|
-
get font(): NoteFont;
|
|
12
|
-
get fontSize(): number;
|
|
13
|
-
get lineHeight(): number;
|
|
14
|
-
get playerTokenRadius(): number;
|
|
15
|
-
get fontComputed(): string;
|
|
16
|
-
get textBaseline(): CanvasTextBaseline;
|
|
1
|
+
import { Color, CourtPoint, Note, NoteAnimation, NoteFont } from "../../play-rendering";
|
|
2
|
+
|
|
3
|
+
export class NoteModel {
|
|
4
|
+
constructor(data: Note);
|
|
5
|
+
get id(): string;
|
|
6
|
+
get text(): string;
|
|
7
|
+
get location(): CourtPoint;
|
|
8
|
+
get color(): Color;
|
|
9
|
+
get showBorder(): boolean;
|
|
10
|
+
get animations(): NoteAnimation[];
|
|
11
|
+
get font(): NoteFont;
|
|
12
|
+
get fontSize(): number;
|
|
13
|
+
get lineHeight(): number;
|
|
14
|
+
get playerTokenRadius(): number;
|
|
15
|
+
get fontComputed(): string;
|
|
16
|
+
get textBaseline(): CanvasTextBaseline;
|
|
17
17
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Color, CourtPoint, Line, Player, PlayerAnimation, Position } from "../../play-rendering";
|
|
2
|
-
|
|
3
|
-
export class PlayerModel {
|
|
4
|
-
constructor(data: Player);
|
|
5
|
-
get id(): string;
|
|
6
|
-
get textOverride(): string;
|
|
7
|
-
set textOverride(data: string);
|
|
8
|
-
get textLabel(): string;
|
|
9
|
-
get isDefender(): boolean;
|
|
10
|
-
get possession(): boolean;
|
|
11
|
-
set possession(data: boolean);
|
|
12
|
-
get position(): Position;
|
|
13
|
-
get location(): CourtPoint;
|
|
14
|
-
get color(): Color;
|
|
15
|
-
get animations(): PlayerAnimation[];
|
|
16
|
-
get animationsByEndTime(): number[];
|
|
17
|
-
get lastAnimEndTime(): number;
|
|
18
|
-
get lastAnimation(): PlayerAnimation;
|
|
19
|
-
get lastAnimationLastLinePartControlPoint(): CourtPoint;
|
|
20
|
-
setPossession(prevPassLines: Line[]): void;
|
|
1
|
+
import { Color, CourtPoint, Line, Player, PlayerAnimation, Position } from "../../play-rendering";
|
|
2
|
+
|
|
3
|
+
export class PlayerModel {
|
|
4
|
+
constructor(data: Player);
|
|
5
|
+
get id(): string;
|
|
6
|
+
get textOverride(): string;
|
|
7
|
+
set textOverride(data: string);
|
|
8
|
+
get textLabel(): string;
|
|
9
|
+
get isDefender(): boolean;
|
|
10
|
+
get possession(): boolean;
|
|
11
|
+
set possession(data: boolean);
|
|
12
|
+
get position(): Position;
|
|
13
|
+
get location(): CourtPoint;
|
|
14
|
+
get color(): Color;
|
|
15
|
+
get animations(): PlayerAnimation[];
|
|
16
|
+
get animationsByEndTime(): number[];
|
|
17
|
+
get lastAnimEndTime(): number;
|
|
18
|
+
get lastAnimation(): PlayerAnimation;
|
|
19
|
+
get lastAnimationLastLinePartControlPoint(): CourtPoint;
|
|
20
|
+
setPossession(prevPassLines: Line[]): void;
|
|
21
21
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class CircleShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get rectWrapPointsPure(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class CircleShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get rectWrapPointsPure(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class ConeShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class ConeShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class FovShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
get rectWrapPointsPure(): {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}[];
|
|
12
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class FovShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
get rectWrapPointsPure(): {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class LineShape extends ShapeModel {
|
|
3
|
-
get rectWrapPointsPure(): {
|
|
4
|
-
x: any;
|
|
5
|
-
y: any;
|
|
6
|
-
}[];
|
|
7
|
-
get controlPointsTranslated(): {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
}[];
|
|
11
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class LineShape extends ShapeModel {
|
|
3
|
+
get rectWrapPointsPure(): {
|
|
4
|
+
x: any;
|
|
5
|
+
y: any;
|
|
6
|
+
}[];
|
|
7
|
+
get controlPointsTranslated(): {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class SquareShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class SquareShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class StraightShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
get rectWrapPointsPure(): {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}[];
|
|
12
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class StraightShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
get rectWrapPointsPure(): {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class TriangleShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
get rectWrapPointsPure(): {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
}[];
|
|
12
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class TriangleShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
get rectWrapPointsPure(): {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ShapeModel from '../ShapeModel';
|
|
2
|
-
export default class XMarkShape extends ShapeModel {
|
|
3
|
-
get outerCircleRadius(): number;
|
|
4
|
-
get shapeControlPoints(): {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}[];
|
|
8
|
-
}
|
|
1
|
+
import ShapeModel from '../ShapeModel';
|
|
2
|
+
export default class XMarkShape extends ShapeModel {
|
|
3
|
+
get outerCircleRadius(): number;
|
|
4
|
+
get shapeControlPoints(): {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import CutLineShape from './line/CutLineShape';
|
|
2
|
-
import DribbleLineShape from './line/DribbleLineShape';
|
|
3
|
-
import HandoffLineShape from './line/HandoffLineShape';
|
|
4
|
-
import PassLineShape from './line/PassLineShape';
|
|
5
|
-
import ScreenLineShape from './line/ScreenLineShape';
|
|
6
|
-
import CircleShape from './CircleShape';
|
|
7
|
-
import ConeShape from './ConeShape';
|
|
8
|
-
import FovShape from './FovShape';
|
|
9
|
-
import LineShape from './LineShape';
|
|
10
|
-
import SquareShape from './SquareShape';
|
|
11
|
-
import StraightShape from './StraightShape';
|
|
12
|
-
import TriangleShape from './TriangleShape';
|
|
13
|
-
import XmarkShape from './XmarkShape';
|
|
14
|
-
export { CutLineShape, DribbleLineShape, HandoffLineShape, PassLineShape, ScreenLineShape, CircleShape, ConeShape, FovShape, LineShape, SquareShape, StraightShape, TriangleShape, XmarkShape };
|
|
1
|
+
import CutLineShape from './line/CutLineShape';
|
|
2
|
+
import DribbleLineShape from './line/DribbleLineShape';
|
|
3
|
+
import HandoffLineShape from './line/HandoffLineShape';
|
|
4
|
+
import PassLineShape from './line/PassLineShape';
|
|
5
|
+
import ScreenLineShape from './line/ScreenLineShape';
|
|
6
|
+
import CircleShape from './CircleShape';
|
|
7
|
+
import ConeShape from './ConeShape';
|
|
8
|
+
import FovShape from './FovShape';
|
|
9
|
+
import LineShape from './LineShape';
|
|
10
|
+
import SquareShape from './SquareShape';
|
|
11
|
+
import StraightShape from './StraightShape';
|
|
12
|
+
import TriangleShape from './TriangleShape';
|
|
13
|
+
import XmarkShape from './XmarkShape';
|
|
14
|
+
export { CutLineShape, DribbleLineShape, HandoffLineShape, PassLineShape, ScreenLineShape, CircleShape, ConeShape, FovShape, LineShape, SquareShape, StraightShape, TriangleShape, XmarkShape };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import LineShape from '../LineShape';
|
|
2
|
-
export default class CutLineShape extends LineShape {
|
|
3
|
-
}
|
|
1
|
+
import LineShape from '../LineShape';
|
|
2
|
+
export default class CutLineShape extends LineShape {
|
|
3
|
+
}
|