@luceosports/play-rendering 2.1.0 → 2.1.2

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.
@@ -8,6 +8,7 @@ export class NoteModel {
8
8
  get color(): Color;
9
9
  get showBorder(): boolean;
10
10
  get animations(): Animation[];
11
+ get hideForStatic(): boolean | undefined;
11
12
  get font(): NoteFont;
12
13
  get fontSize(): number;
13
14
  get lineHeight(): number;
@@ -31,6 +31,7 @@ export type PlayModelOptions = {
31
31
  showHalfCourtCircle: boolean;
32
32
  playersMap: PlayersMapItem[];
33
33
  labelsOverrideType: 'Headshot' | null;
34
+ inDrawingState: boolean;
34
35
  }
35
36
 
36
37
  export class PlayModel {
@@ -13,6 +13,7 @@ export class ShapeModel {
13
13
  get outerCircleRadius(): number;
14
14
  get linePart(): LinePart;
15
15
  get animations(): Animation[];
16
+ get hideForStatic(): boolean | undefined;
16
17
  get rectWrapPointsPure(): {
17
18
  x: number;
18
19
  y: number;
@@ -100,17 +100,19 @@ export interface Shape {
100
100
  angle?: number;
101
101
  showBorder?: boolean;
102
102
  linePart?: LinePart;
103
- animations: Animation[];
103
+ animations?: Animation[];
104
+ hideForStatic?: boolean;
104
105
  }
105
106
  export interface Note {
106
107
  id: string;
107
108
  location: CourtPoint;
108
109
  displayModes: NoteDisplayModes;
109
110
  text: string;
110
- animations: Animation[];
111
+ animations?: Animation[];
111
112
  font: NoteFont;
112
113
  color: Color;
113
114
  showBorder: boolean;
115
+ hideForStatic?: boolean;
114
116
  }
115
117
  export interface NoteFont {
116
118
  bold: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luceosports/play-rendering",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "main": "dist/play-rendering.js",
5
5
  "types": "dist/play-rendering.d.ts",
6
6
  "scripts": {
@@ -4,7 +4,7 @@ import _ from 'lodash';
4
4
  import { FrameDataOptions } from '../models/FrameModel';
5
5
 
6
6
  export function computeAnimationAlpha(model: NoteModel | ShapeModel, options: FrameDataOptions) {
7
- let alpha = 1;
7
+ let alpha = model.hideForStatic && !options.inDrawingState ? 0 : 1;
8
8
  if (options.animationGlobalProgress) {
9
9
  alpha = 0;
10
10
  const animationKeyTimeChunks = model.animations.map(a => {
@@ -47,6 +47,10 @@ export default class NoteModel extends Model<NoteData, NoteData> {
47
47
  return this._getAttr('animations') || [];
48
48
  }
49
49
 
50
+ get hideForStatic() {
51
+ return this._getAttr('hideForStatic');
52
+ }
53
+
50
54
  get font() {
51
55
  return (
52
56
  this._getAttr('font') || {
@@ -24,7 +24,8 @@ export function useDefaults(options?: Partial<PlayModelOptions>): PlayModelOptio
24
24
  // TODO: refactor NBA court type constants below
25
25
  showHalfCourtCircle: true,
26
26
  playersMap: [],
27
- labelsOverrideType: null
27
+ labelsOverrideType: null,
28
+ inDrawingState: false
28
29
  };
29
30
  return {
30
31
  ...defaults,
@@ -74,6 +74,7 @@ export type PlayModelOptions = {
74
74
  showHalfCourtCircle: boolean;
75
75
  playersMap: PlayersMapItem[];
76
76
  labelsOverrideType: 'Headshot' | null;
77
+ inDrawingState: boolean;
77
78
  };
78
79
 
79
80
  export default class PlayModel {
@@ -53,6 +53,10 @@ export default abstract class ShapeModel extends Model<ShapeData, ShapeData> {
53
53
  return this._getAttr('animations') || [];
54
54
  }
55
55
 
56
+ get hideForStatic() {
57
+ return this._getAttr('hideForStatic');
58
+ }
59
+
56
60
  get rectWrapPointsPure() {
57
61
  const topLeft = { x: -this.outerCircleRadius / 2, y: -this.outerCircleRadius / 2 };
58
62
  const topRight = { x: this.outerCircleRadius / 2, y: -this.outerCircleRadius / 2 };
@@ -163,7 +163,8 @@ export interface Shape {
163
163
  angle?: number;
164
164
  showBorder?: boolean;
165
165
  linePart?: LinePart;
166
- animations: Animation[];
166
+ animations?: Animation[];
167
+ hideForStatic?: boolean;
167
168
  }
168
169
 
169
170
  export interface Note {
@@ -171,10 +172,11 @@ export interface Note {
171
172
  location: CourtPoint;
172
173
  displayModes: NoteDisplayModes;
173
174
  text: string;
174
- animations: Animation[];
175
+ animations?: Animation[];
175
176
  font: NoteFont;
176
177
  color: Color;
177
178
  showBorder: boolean;
179
+ hideForStatic?: boolean;
178
180
  }
179
181
 
180
182
  export interface NoteFont {