@checksub_team/peaks_timeline 1.16.1 → 2.0.0-alpha.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/package.json +1 -1
- package/peaks.js +4716 -4409
- package/peaks.js.d.ts +5 -5
- package/src/{timeline-axis.js → components/axis.js} +244 -244
- package/src/{data-retriever.js → components/data-retriever.js} +117 -117
- package/src/{default-segment-marker.js → components/default-segment-marker.js} +132 -132
- package/src/{invoker.js → components/invoker.js} +81 -81
- package/src/components/line-group.js +692 -0
- package/src/components/line-groups.js +585 -0
- package/src/{line-indicator.js → components/line-indicator.js} +308 -303
- package/src/{marker-factories.js → components/marker-factories.js} +1 -1
- package/src/{mode-layer.js → components/mode-layer.js} +8 -12
- package/src/{playhead-layer.js → components/playhead-layer.js} +3 -3
- package/src/{segment-marker.js → components/segment-marker.js} +2 -2
- package/src/{segment-shape.js → components/segment-shape.js} +508 -508
- package/src/{segments-group.js → components/segments-group.js} +805 -801
- package/src/{source-group.js → components/source-group.js} +1661 -1640
- package/src/{sources-layer.js → components/sources-layer.js} +716 -730
- package/src/{waveform-builder.js → components/waveform-builder.js} +2 -2
- package/src/{waveform-shape.js → components/waveform-shape.js} +214 -214
- package/src/keyboard-handler.js +9 -9
- package/src/line-handler.js +179 -0
- package/src/main.js +110 -71
- package/src/models/line.js +156 -0
- package/src/{segment.js → models/segment.js} +420 -419
- package/src/{source.js → models/source.js} +1311 -1315
- package/src/player.js +2 -2
- package/src/{timeline-segments.js → segment-handler.js} +435 -435
- package/src/{timeline-sources.js → source-handler.js} +521 -514
- package/src/utils.js +5 -1
- package/src/{timeline-zoomview.js → view.js} +136 -137
- package/src/line.js +0 -690
- package/src/lines.js +0 -427
- /package/src/{data.js → components/data.js} +0 -0
- /package/src/{loader.js → components/loader.js} +0 -0
- /package/src/{mouse-drag-handler.js → components/mouse-drag-handler.js} +0 -0
- /package/src/{svgs.js → components/svgs.js} +0 -0
|
@@ -1,303 +1,308 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Defines the {@link LineIndicator} class.
|
|
5
|
-
*
|
|
6
|
-
* @module line-indicator
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
define([
|
|
10
|
-
'konva',
|
|
11
|
-
'./
|
|
12
|
-
'
|
|
13
|
-
], function(
|
|
14
|
-
Konva,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'use strict';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Creates a Konva.Stage that displays a representation of each line.
|
|
21
|
-
*
|
|
22
|
-
* @class
|
|
23
|
-
* @alias LineIndicator
|
|
24
|
-
*
|
|
25
|
-
* @param {Peaks} peaks
|
|
26
|
-
* @param {WaveformOverview|WaveformZoomView} view
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
function LineIndicator(peaks, view, container) {
|
|
30
|
-
this._peaks = peaks;
|
|
31
|
-
this._view = view;
|
|
32
|
-
this._container = container;
|
|
33
|
-
|
|
34
|
-
this._width = this._peaks.options.lineIndicatorWidth;
|
|
35
|
-
this._height = this._view.getHeight();
|
|
36
|
-
|
|
37
|
-
this._sizes = {
|
|
38
|
-
font: this._peaks.options.lineIndicatorFontSize,
|
|
39
|
-
icon: {
|
|
40
|
-
default: this._peaks.options.lineIndicatorDefaultIconSize,
|
|
41
|
-
volume: this._peaks.options.lineIndicatorVolumeIconSize,
|
|
42
|
-
noVolume: this._peaks.options.lineIndicatorNoVolumeIconSize,
|
|
43
|
-
visibility: this._peaks.options.lineIndicatorVisibilityIconSize,
|
|
44
|
-
noVisibility: this._peaks.options.lineIndicatorNoVisibilityIconSize
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
this._yPadding = 30;
|
|
49
|
-
this._defaultPadding = 5;
|
|
50
|
-
this._types = ['default'].concat(Object.keys(SVGs));
|
|
51
|
-
|
|
52
|
-
this._stage = new Konva.Stage({
|
|
53
|
-
container: container,
|
|
54
|
-
width: this._width,
|
|
55
|
-
height: this._height
|
|
56
|
-
});
|
|
57
|
-
this._layer = new Konva.Layer();
|
|
58
|
-
this._stage.add(this._layer);
|
|
59
|
-
|
|
60
|
-
this._indicators = {};
|
|
61
|
-
|
|
62
|
-
this._separatingLine = new Konva.Line({
|
|
63
|
-
points: [this._width, 0, this._width, this._height],
|
|
64
|
-
stroke: 'gray',
|
|
65
|
-
strokeWidth: 1,
|
|
66
|
-
listening: false
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
this._layer.add(this._separatingLine);
|
|
70
|
-
|
|
71
|
-
this._layer.draw();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
indicatorHeight
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
fill
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
indicator.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
indicator
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
LineIndicator.prototype.
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
LineIndicator.prototype.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
this._indicators[lineId].
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* Defines the {@link LineIndicator} class.
|
|
5
|
+
*
|
|
6
|
+
* @module line-indicator
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
define([
|
|
10
|
+
'konva',
|
|
11
|
+
'./svgs',
|
|
12
|
+
'../utils'
|
|
13
|
+
], function(
|
|
14
|
+
Konva,
|
|
15
|
+
SVGs,
|
|
16
|
+
Utils) {
|
|
17
|
+
'use strict';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Creates a Konva.Stage that displays a representation of each line.
|
|
21
|
+
*
|
|
22
|
+
* @class
|
|
23
|
+
* @alias LineIndicator
|
|
24
|
+
*
|
|
25
|
+
* @param {Peaks} peaks
|
|
26
|
+
* @param {WaveformOverview|WaveformZoomView} view
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
function LineIndicator(peaks, view, container) {
|
|
30
|
+
this._peaks = peaks;
|
|
31
|
+
this._view = view;
|
|
32
|
+
this._container = container;
|
|
33
|
+
|
|
34
|
+
this._width = this._peaks.options.lineIndicatorWidth;
|
|
35
|
+
this._height = this._view.getHeight();
|
|
36
|
+
|
|
37
|
+
this._sizes = {
|
|
38
|
+
font: this._peaks.options.lineIndicatorFontSize,
|
|
39
|
+
icon: {
|
|
40
|
+
default: this._peaks.options.lineIndicatorDefaultIconSize,
|
|
41
|
+
volume: this._peaks.options.lineIndicatorVolumeIconSize,
|
|
42
|
+
noVolume: this._peaks.options.lineIndicatorNoVolumeIconSize,
|
|
43
|
+
visibility: this._peaks.options.lineIndicatorVisibilityIconSize,
|
|
44
|
+
noVisibility: this._peaks.options.lineIndicatorNoVisibilityIconSize
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
this._yPadding = 30;
|
|
49
|
+
this._defaultPadding = 5;
|
|
50
|
+
this._types = ['default'].concat(Object.keys(SVGs));
|
|
51
|
+
|
|
52
|
+
this._stage = new Konva.Stage({
|
|
53
|
+
container: container,
|
|
54
|
+
width: this._width,
|
|
55
|
+
height: this._height
|
|
56
|
+
});
|
|
57
|
+
this._layer = new Konva.Layer();
|
|
58
|
+
this._stage.add(this._layer);
|
|
59
|
+
|
|
60
|
+
this._indicators = {};
|
|
61
|
+
|
|
62
|
+
this._separatingLine = new Konva.Line({
|
|
63
|
+
points: [this._width, 0, this._width, this._height],
|
|
64
|
+
stroke: 'gray',
|
|
65
|
+
strokeWidth: 1,
|
|
66
|
+
listening: false
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
this._layer.add(this._separatingLine);
|
|
70
|
+
|
|
71
|
+
this._layer.draw();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
LineIndicator.prototype.fitToView = function() {
|
|
75
|
+
this._height = this._view.getHeight();
|
|
76
|
+
|
|
77
|
+
this._stage.height(this._height);
|
|
78
|
+
|
|
79
|
+
this._separatingLine.points([this._width, 0, this._width, this._height]);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
LineIndicator.prototype._createIndicator = function(lineGroup, type, text) {
|
|
83
|
+
const indicator = new Konva.Group();
|
|
84
|
+
let indicatorHeight = 0;
|
|
85
|
+
|
|
86
|
+
if (text) {
|
|
87
|
+
const textNode = new Konva.Text({
|
|
88
|
+
text: text,
|
|
89
|
+
fontSize: this._sizes.font,
|
|
90
|
+
fontFamily: this._peaks.options.lineIndicatorFont,
|
|
91
|
+
fill: this._peaks.options.lineIndicatorTextColor,
|
|
92
|
+
align: 'center',
|
|
93
|
+
width: this._width,
|
|
94
|
+
listening: false
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
textNode.setAttr('defaultColor', this._peaks.options.lineIndicatorTextColor);
|
|
98
|
+
textNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedTextColor);
|
|
99
|
+
|
|
100
|
+
indicator.add(textNode);
|
|
101
|
+
indicatorHeight += this._sizes.font;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type = this._types.includes(type) ? type : 'default';
|
|
105
|
+
|
|
106
|
+
var iconNode;
|
|
107
|
+
|
|
108
|
+
if (type === 'default') {
|
|
109
|
+
var padding = text ? this._defaultPadding : 0;
|
|
110
|
+
|
|
111
|
+
iconNode = new Konva.Circle({
|
|
112
|
+
x: this._width / 2,
|
|
113
|
+
y: indicatorHeight + this._sizes.icon.default / 2 + padding,
|
|
114
|
+
radius: this._sizes.icon.default / 2,
|
|
115
|
+
fill: this._peaks.options.lineIndicatorIconColor,
|
|
116
|
+
strokeWidth: 0,
|
|
117
|
+
lineId: lineGroup.getId(),
|
|
118
|
+
listening: false
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
indicatorHeight += padding;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
iconNode = new Konva.Path({
|
|
125
|
+
x: (this._width - this._sizes.icon[type]) / 2,
|
|
126
|
+
y: indicatorHeight,
|
|
127
|
+
data: SVGs[type].path,
|
|
128
|
+
fill: this._peaks.options.lineIndicatorIconColor,
|
|
129
|
+
scale: {
|
|
130
|
+
x: (this._sizes.icon[type]) / SVGs[type].width,
|
|
131
|
+
y: (this._sizes.icon[type]) / SVGs[type].height
|
|
132
|
+
},
|
|
133
|
+
lineId: lineGroup.getId(),
|
|
134
|
+
listening: false
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
iconNode.setAttr('defaultColor', this._peaks.options.lineIndicatorIconColor);
|
|
139
|
+
iconNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedIconColor);
|
|
140
|
+
|
|
141
|
+
indicator.add(iconNode);
|
|
142
|
+
indicatorHeight += this._sizes.icon[type];
|
|
143
|
+
|
|
144
|
+
indicator.setAttr('trueHeight', indicatorHeight);
|
|
145
|
+
|
|
146
|
+
var backgroundRect = new Konva.Rect({
|
|
147
|
+
x: 0,
|
|
148
|
+
y: 0,
|
|
149
|
+
width: this._width,
|
|
150
|
+
height: indicatorHeight,
|
|
151
|
+
fill: 'transparent',
|
|
152
|
+
listening: true
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
indicator.add(backgroundRect);
|
|
156
|
+
backgroundRect.moveToTop();
|
|
157
|
+
|
|
158
|
+
indicator.y(lineGroup.y() + (lineGroup.lineHeight() - indicatorHeight) / 2);
|
|
159
|
+
|
|
160
|
+
var self = this;
|
|
161
|
+
|
|
162
|
+
indicator.on('mouseenter', function() {
|
|
163
|
+
indicator.getChildren().forEach(function(child) {
|
|
164
|
+
child.fill(child.getAttr('selectedColor'));
|
|
165
|
+
});
|
|
166
|
+
self.draw();
|
|
167
|
+
self._stage.container().style.cursor = 'pointer';
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
indicator.on('mouseout', function() {
|
|
171
|
+
indicator.getChildren().forEach(function(child) {
|
|
172
|
+
child.fill(child.getAttr('defaultColor'));
|
|
173
|
+
});
|
|
174
|
+
self.draw();
|
|
175
|
+
self._stage.container().style.cursor = 'default';
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
indicator.on('click', function(e) {
|
|
179
|
+
self._peaks.emit('lineIndicator.click', self._indicators[lineGroup.getId()], e.evt);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
return indicator;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
LineIndicator.prototype.addIndicator = function(lineGroup) {
|
|
186
|
+
var line = lineGroup.getLine();
|
|
187
|
+
|
|
188
|
+
if (!this._indicators[lineGroup.id]) {
|
|
189
|
+
const indicator = this._createIndicator(
|
|
190
|
+
lineGroup,
|
|
191
|
+
line.indicatorType,
|
|
192
|
+
line.indicatorText
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
this._layer.add(indicator);
|
|
196
|
+
|
|
197
|
+
this._indicators[line.id] = {
|
|
198
|
+
lineGroup: lineGroup,
|
|
199
|
+
indicator: indicator,
|
|
200
|
+
type: line.indicatorType
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
LineIndicator.prototype.updateIndicator = function(line) {
|
|
206
|
+
const indicatorData = this._indicators[line.id];
|
|
207
|
+
|
|
208
|
+
if (!indicatorData) {
|
|
209
|
+
this._peaks.logger('peaks.line-indicator.update(): line indicator not found: ' + line.id);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
if (indicatorData.type === line.indicatorType && indicatorData.text === line.indicatorText) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
this.removeIndicator(line.id, true);
|
|
218
|
+
|
|
219
|
+
var indicator = this._createIndicator(
|
|
220
|
+
indicatorData.lineGroup,
|
|
221
|
+
line.indicatorType,
|
|
222
|
+
line.indicatorText
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
this._layer.add(indicator);
|
|
226
|
+
|
|
227
|
+
indicatorData.indicator = indicator;
|
|
228
|
+
indicatorData.type = line.indicatorType;
|
|
229
|
+
indicatorData.text = line.indicatorText;
|
|
230
|
+
|
|
231
|
+
this.draw();
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
LineIndicator.prototype.removeIndicator = function(lineId, keepInList) {
|
|
235
|
+
if (this._indicators[lineId]) {
|
|
236
|
+
if (this._indicators[lineId].indicator) {
|
|
237
|
+
this._indicators[lineId].indicator.destroy();
|
|
238
|
+
}
|
|
239
|
+
if (!keepInList) {
|
|
240
|
+
delete this._indicators[lineId];
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
this._indicators[lineId].indicator = null;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
LineIndicator.prototype.refreshIndicator = function(lineId) {
|
|
249
|
+
var anyChange = false;
|
|
250
|
+
|
|
251
|
+
if (this._indicators[lineId]) {
|
|
252
|
+
var y = this._indicators[lineId].lineGroup.y();
|
|
253
|
+
var isVisible = y + this._indicators[lineId].lineGroup.lineHeight() + this._yPadding > 0
|
|
254
|
+
&& y - this._yPadding < this._height;
|
|
255
|
+
const hasNoIndicator = !this._indicators[lineId].indicator;
|
|
256
|
+
|
|
257
|
+
if (isVisible) {
|
|
258
|
+
if (hasNoIndicator) {
|
|
259
|
+
this._indicators[lineId].indicator = this._createIndicator(
|
|
260
|
+
this._indicators[lineId].lineGroup,
|
|
261
|
+
this._indicators[lineId].type,
|
|
262
|
+
this._indicators[lineId].text
|
|
263
|
+
);
|
|
264
|
+
this._layer.add(this._indicators[lineId].indicator);
|
|
265
|
+
anyChange = true;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
const newY = y
|
|
269
|
+
+ this._indicators[lineId].lineGroup.lineHeight() / 2
|
|
270
|
+
- this._indicators[lineId].indicator.getAttr('trueHeight') / 2;
|
|
271
|
+
|
|
272
|
+
if (this._indicators[lineId].indicator.y() !== newY) {
|
|
273
|
+
this._indicators[lineId].indicator.y(
|
|
274
|
+
newY
|
|
275
|
+
);
|
|
276
|
+
anyChange = true;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
this.removeIndicator(lineId, true);
|
|
282
|
+
if (!hasNoIndicator) {
|
|
283
|
+
anyChange = true;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return anyChange;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
LineIndicator.prototype.refreshIndicators = function() {
|
|
292
|
+
var anyChange = false;
|
|
293
|
+
|
|
294
|
+
for (var lineId in this._indicators) {
|
|
295
|
+
if (Utils.objectHasProperty(this._indicators, lineId)) {
|
|
296
|
+
anyChange = this.refreshIndicator(lineId) || anyChange;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return anyChange;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
LineIndicator.prototype.draw = function() {
|
|
304
|
+
this._layer.draw();
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
return LineIndicator;
|
|
308
|
+
});
|