@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.
- package/dist/play-rendering.js +2 -2
- package/dist/play-rendering.js.map +1 -1
- package/dist/types/models/NoteModel.d.ts +1 -0
- package/dist/types/models/PlayModel.d.ts +1 -0
- package/dist/types/models/ShapeModel.d.ts +1 -0
- package/dist/types/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/src/helpers/animation.ts +1 -1
- package/src/models/NoteModel.ts +4 -0
- package/src/models/Play/Options.ts +2 -1
- package/src/models/PlayModel.ts +1 -0
- package/src/models/ShapeModel.ts +4 -0
- package/src/types/index.ts +4 -2
|
@@ -100,17 +100,19 @@ export interface Shape {
|
|
|
100
100
|
angle?: number;
|
|
101
101
|
showBorder?: boolean;
|
|
102
102
|
linePart?: LinePart;
|
|
103
|
-
animations
|
|
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
|
|
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
package/src/helpers/animation.ts
CHANGED
|
@@ -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 => {
|
package/src/models/NoteModel.ts
CHANGED
|
@@ -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,
|
package/src/models/PlayModel.ts
CHANGED
package/src/models/ShapeModel.ts
CHANGED
|
@@ -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 };
|
package/src/types/index.ts
CHANGED
|
@@ -163,7 +163,8 @@ export interface Shape {
|
|
|
163
163
|
angle?: number;
|
|
164
164
|
showBorder?: boolean;
|
|
165
165
|
linePart?: LinePart;
|
|
166
|
-
animations
|
|
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
|
|
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 {
|