@millistream/millistream-widgets 1.0.21 → 1.0.23
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/millistream-widgets.js +19 -11
- package/package.json +1 -1
package/millistream-widgets.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
(function(prototype) {
|
|
10
10
|
|
|
11
11
|
var pixelRatio = (function() {
|
|
12
|
-
|
|
12
|
+
var canvas = document.createElement('canvas'),
|
|
13
13
|
context = canvas.getContext('2d');
|
|
14
14
|
|
|
15
15
|
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
if (pixelRatio === 1) return;
|
|
50
50
|
|
|
51
51
|
function getPixelRatio(_this) {
|
|
52
|
+
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
var backingStore = _this.backingStorePixelRatio ||
|
|
58
|
+
var backingStore = _this.backingStorePixelRatio ||
|
|
59
59
|
_this.webkitBackingStorePixelRatio ||
|
|
60
60
|
_this.mozBackingStorePixelRatio ||
|
|
61
61
|
_this.msBackingStorePixelRatio ||
|
|
@@ -2241,8 +2241,8 @@ function Milli_Chart(settings) {
|
|
|
2241
2241
|
}
|
|
2242
2242
|
if (typeof m_chartCss.backgroundColor !== 'undefined') {
|
|
2243
2243
|
m_ctx.save();
|
|
2244
|
-
|
|
2245
|
-
|
|
2244
|
+
|
|
2245
|
+
m_ctx.globalCompositeOperation = 'destination-over';
|
|
2246
2246
|
m_ctx.fillStyle = m_chartCss.backgroundColor;
|
|
2247
2247
|
|
|
2248
2248
|
m_ctx.fillRect(0, 0, m_canvas.width, m_canvas.height);
|
|
@@ -3091,19 +3091,25 @@ function Milli_Chart(settings) {
|
|
|
3091
3091
|
m_zoom.div = null;
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
3094
|
-
if (_this.
|
|
3094
|
+
if ((period == 'd' && _this.settings.chartlen != 'ytd')) {
|
|
3095
|
+
_this.drawChart();
|
|
3096
|
+
requestStreaming();
|
|
3097
|
+
if (_this.settings.onreadyCallback) _this.settings.onreadyCallback();
|
|
3098
|
+
} else
|
|
3099
|
+
if ((period == 'm' || period == 'y' || _this.settings.chartlen == 'ytd' || _this.settings.chartlen == 'max')) {
|
|
3095
3100
|
_this.drawChart();
|
|
3096
3101
|
requestStreaming();
|
|
3097
3102
|
if (_this.settings.onreadyCallback) _this.settings.onreadyCallback();
|
|
3098
3103
|
}
|
|
3104
|
+
return;
|
|
3099
3105
|
};
|
|
3100
3106
|
|
|
3101
3107
|
function requestStreaming() {
|
|
3102
|
-
var arr = [];
|
|
3103
|
-
_this.instruments.forEach(function(instr) {
|
|
3104
|
-
if (instr.insref != 0) arr.push(instr.insref);
|
|
3105
|
-
});
|
|
3106
3108
|
if (_this.settings.streaming != false) {
|
|
3109
|
+
var arr = [];
|
|
3110
|
+
_this.instruments.forEach(function(instr) {
|
|
3111
|
+
if (instr.insref != 0) arr.push(instr.insref);
|
|
3112
|
+
});
|
|
3107
3113
|
if (typeof _this.unsubscriptions === 'undefined' || typeof _this.unsubscriptions.insrefs === 'undefined' || _this.unsubscriptions.insrefs != arr.length) {
|
|
3108
3114
|
_this.requestid = _this.settings.streaming.MillistreamWidgetStreamingApi_subscribeInstruments(_this, _this.requestid, arr);
|
|
3109
3115
|
}
|
|
@@ -3382,7 +3388,9 @@ function Milli_Chart(settings) {
|
|
|
3382
3388
|
}
|
|
3383
3389
|
|
|
3384
3390
|
};
|
|
3385
|
-
if (this.settings.autodraw == true)
|
|
3391
|
+
if (this.settings.autodraw == true) {
|
|
3392
|
+
this.drawWidget();
|
|
3393
|
+
}
|
|
3386
3394
|
|
|
3387
3395
|
(function updatePixelRatio() {
|
|
3388
3396
|
matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener('change', updatePixelRatio, { once: true });
|