@checksub_team/peaks_timeline 1.13.1 → 1.13.3
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 +21 -8
- package/src/line-indicator.js +18 -3
- package/src/sources-layer.js +5 -5
package/package.json
CHANGED
package/peaks.js
CHANGED
|
@@ -14825,7 +14825,8 @@ module.exports = function (Konva, Utils, SVGs) {
|
|
|
14825
14825
|
fontFamily: this._peaks.options.lineIndicatorFont,
|
|
14826
14826
|
fill: this._peaks.options.lineIndicatorTextColor,
|
|
14827
14827
|
align: 'center',
|
|
14828
|
-
width: this._width
|
|
14828
|
+
width: this._width,
|
|
14829
|
+
listening: false
|
|
14829
14830
|
});
|
|
14830
14831
|
textNode.setAttr('defaultColor', this._peaks.options.lineIndicatorTextColor);
|
|
14831
14832
|
textNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedTextColor);
|
|
@@ -14842,7 +14843,8 @@ module.exports = function (Konva, Utils, SVGs) {
|
|
|
14842
14843
|
radius: this._sizes.icon.default / 2,
|
|
14843
14844
|
fill: this._peaks.options.lineIndicatorIconColor,
|
|
14844
14845
|
strokeWidth: 0,
|
|
14845
|
-
lineId: line.getId()
|
|
14846
|
+
lineId: line.getId(),
|
|
14847
|
+
listening: false
|
|
14846
14848
|
});
|
|
14847
14849
|
indicatorHeight += padding;
|
|
14848
14850
|
} else {
|
|
@@ -14855,7 +14857,8 @@ module.exports = function (Konva, Utils, SVGs) {
|
|
|
14855
14857
|
x: this._sizes.icon[type] / SVGs[type].width,
|
|
14856
14858
|
y: this._sizes.icon[type] / SVGs[type].height
|
|
14857
14859
|
},
|
|
14858
|
-
lineId: line.getId()
|
|
14860
|
+
lineId: line.getId(),
|
|
14861
|
+
listening: false
|
|
14859
14862
|
});
|
|
14860
14863
|
}
|
|
14861
14864
|
iconNode.setAttr('defaultColor', this._peaks.options.lineIndicatorIconColor);
|
|
@@ -14863,6 +14866,16 @@ module.exports = function (Konva, Utils, SVGs) {
|
|
|
14863
14866
|
indicator.add(iconNode);
|
|
14864
14867
|
indicatorHeight += this._sizes.icon[type];
|
|
14865
14868
|
indicator.setAttr('trueHeight', indicatorHeight);
|
|
14869
|
+
var backgroundRect = new Konva.Rect({
|
|
14870
|
+
x: 0,
|
|
14871
|
+
y: 0,
|
|
14872
|
+
width: this._width,
|
|
14873
|
+
height: indicatorHeight,
|
|
14874
|
+
fill: 'transparent',
|
|
14875
|
+
listening: true
|
|
14876
|
+
});
|
|
14877
|
+
indicator.add(backgroundRect);
|
|
14878
|
+
backgroundRect.moveToTop();
|
|
14866
14879
|
indicator.y(line.getY() + (line.lineHeight() - indicatorHeight) / 2);
|
|
14867
14880
|
var self = this;
|
|
14868
14881
|
indicator.on('mouseenter', function () {
|
|
@@ -19920,9 +19933,7 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
|
|
|
19920
19933
|
var frameStartTime = self._view.pixelsToTime(frameOffset);
|
|
19921
19934
|
var frameEndTime = self._view.pixelsToTime(frameOffset + width);
|
|
19922
19935
|
sources.forEach(function (source) {
|
|
19923
|
-
|
|
19924
|
-
self._addSourceGroup(source);
|
|
19925
|
-
}
|
|
19936
|
+
self._addSourceGroup(source, source.isVisible(frameStartTime, frameEndTime));
|
|
19926
19937
|
});
|
|
19927
19938
|
this._view.updateTimelineLength();
|
|
19928
19939
|
this.updateSources(frameStartTime, frameEndTime);
|
|
@@ -19984,11 +19995,13 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
|
|
|
19984
19995
|
SourcesLayer.prototype._createSourceGroup = function (source) {
|
|
19985
19996
|
return new SourceGroup(source, this._peaks, this, this._view);
|
|
19986
19997
|
};
|
|
19987
|
-
SourcesLayer.prototype._addSourceGroup = function (source) {
|
|
19998
|
+
SourcesLayer.prototype._addSourceGroup = function (source, startDataRetrieval = true) {
|
|
19988
19999
|
var sourceGroup = this._createSourceGroup(source);
|
|
19989
20000
|
this._sourcesGroup[source.id] = sourceGroup;
|
|
19990
20001
|
this._lines.addSourceGroup(sourceGroup, source.position);
|
|
19991
|
-
|
|
20002
|
+
if (startDataRetrieval) {
|
|
20003
|
+
this._dataRetriever.retrieveData(source);
|
|
20004
|
+
}
|
|
19992
20005
|
return sourceGroup;
|
|
19993
20006
|
};
|
|
19994
20007
|
SourcesLayer.prototype.setIndicators = function (source) {
|
package/src/line-indicator.js
CHANGED
|
@@ -143,7 +143,8 @@ define([
|
|
|
143
143
|
fontFamily: this._peaks.options.lineIndicatorFont,
|
|
144
144
|
fill: this._peaks.options.lineIndicatorTextColor,
|
|
145
145
|
align: 'center',
|
|
146
|
-
width: this._width
|
|
146
|
+
width: this._width,
|
|
147
|
+
listening: false
|
|
147
148
|
});
|
|
148
149
|
|
|
149
150
|
textNode.setAttr('defaultColor', this._peaks.options.lineIndicatorTextColor);
|
|
@@ -166,7 +167,8 @@ define([
|
|
|
166
167
|
radius: this._sizes.icon.default / 2,
|
|
167
168
|
fill: this._peaks.options.lineIndicatorIconColor,
|
|
168
169
|
strokeWidth: 0,
|
|
169
|
-
lineId: line.getId()
|
|
170
|
+
lineId: line.getId(),
|
|
171
|
+
listening: false
|
|
170
172
|
});
|
|
171
173
|
|
|
172
174
|
indicatorHeight += padding;
|
|
@@ -181,7 +183,8 @@ define([
|
|
|
181
183
|
x: (this._sizes.icon[type]) / SVGs[type].width,
|
|
182
184
|
y: (this._sizes.icon[type]) / SVGs[type].height
|
|
183
185
|
},
|
|
184
|
-
lineId: line.getId()
|
|
186
|
+
lineId: line.getId(),
|
|
187
|
+
listening: false
|
|
185
188
|
});
|
|
186
189
|
}
|
|
187
190
|
|
|
@@ -193,6 +196,18 @@ define([
|
|
|
193
196
|
|
|
194
197
|
indicator.setAttr('trueHeight', indicatorHeight);
|
|
195
198
|
|
|
199
|
+
var backgroundRect = new Konva.Rect({
|
|
200
|
+
x: 0,
|
|
201
|
+
y: 0,
|
|
202
|
+
width: this._width,
|
|
203
|
+
height: indicatorHeight,
|
|
204
|
+
fill: 'transparent',
|
|
205
|
+
listening: true
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
indicator.add(backgroundRect);
|
|
209
|
+
backgroundRect.moveToTop();
|
|
210
|
+
|
|
196
211
|
indicator.y(line.getY() + (line.lineHeight() - indicatorHeight) / 2);
|
|
197
212
|
|
|
198
213
|
var self = this;
|
package/src/sources-layer.js
CHANGED
|
@@ -185,9 +185,7 @@ define([
|
|
|
185
185
|
var frameEndTime = self._view.pixelsToTime(frameOffset + width);
|
|
186
186
|
|
|
187
187
|
sources.forEach(function(source) {
|
|
188
|
-
|
|
189
|
-
self._addSourceGroup(source);
|
|
190
|
-
}
|
|
188
|
+
self._addSourceGroup(source, source.isVisible(frameStartTime, frameEndTime));
|
|
191
189
|
});
|
|
192
190
|
|
|
193
191
|
this._view.updateTimelineLength();
|
|
@@ -284,14 +282,16 @@ define([
|
|
|
284
282
|
* @returns {Konva.Group}
|
|
285
283
|
*/
|
|
286
284
|
|
|
287
|
-
SourcesLayer.prototype._addSourceGroup = function(source) {
|
|
285
|
+
SourcesLayer.prototype._addSourceGroup = function(source, startDataRetrieval = true) {
|
|
288
286
|
var sourceGroup = this._createSourceGroup(source);
|
|
289
287
|
|
|
290
288
|
this._sourcesGroup[source.id] = sourceGroup;
|
|
291
289
|
this._lines.addSourceGroup(sourceGroup, source.position);
|
|
292
290
|
|
|
293
291
|
// After creating and referencing the new group, we can start data retrieval
|
|
294
|
-
|
|
292
|
+
if (startDataRetrieval) {
|
|
293
|
+
this._dataRetriever.retrieveData(source);
|
|
294
|
+
}
|
|
295
295
|
|
|
296
296
|
return sourceGroup;
|
|
297
297
|
};
|