@millistream/millistream-widgets 1.0.6 → 1.0.8

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.
@@ -1,9 +1,25 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
1
9
  (function(prototype) {
2
10
 
3
11
  var pixelRatio = (function() {
4
12
  var canvas = document.createElement('canvas'),
5
13
  context = canvas.getContext('2d');
6
- })(),
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+ })(),
7
23
 
8
24
  forEach = function(obj, func) {
9
25
  for (var p in obj) {
@@ -93,7 +109,13 @@
93
109
  var i = _super.apply(this, args);
94
110
 
95
111
  this.font = tmp;
96
- return i;
112
+
113
+
114
+
115
+
116
+
117
+
118
+ return i;
97
119
  };
98
120
  })(prototype.measureText);
99
121
 
@@ -129,7 +151,13 @@
129
151
 
130
152
  _super.apply(this, args);
131
153
  this.font = tmp;
132
- };
154
+
155
+
156
+
157
+
158
+
159
+
160
+ };
133
161
  })(prototype.strokeText);
134
162
 
135
163
  })(CanvasRenderingContext2D.prototype);
@@ -138,7 +166,7 @@
138
166
  var context = null;
139
167
 
140
168
  function getPixelRatio() {
141
- backingStore = context.backingStorePixelRatio ||
169
+ var backingStore = context.backingStorePixelRatio ||
142
170
  context.webkitBackingStorePixelRatio ||
143
171
  context.mozBackingStorePixelRatio ||
144
172
  context.msBackingStorePixelRatio ||
@@ -156,6 +184,12 @@
156
184
  if (type === '2d') {
157
185
 
158
186
 
187
+
188
+
189
+
190
+
191
+
192
+
159
193
  var ratio = getPixelRatio();
160
194
  if (ratio > 1) {
161
195
  this.style.height = this.height + 'px';
@@ -2186,7 +2220,11 @@ function Milli_Chart(settings) {
2186
2220
 
2187
2221
  }
2188
2222
 
2189
- }
2223
+
2224
+
2225
+
2226
+
2227
+ }
2190
2228
  drawBoxShadow(m_chartspaces.chart);
2191
2229
 
2192
2230
  if (m_chartspaces.chart.percent != 100) {
@@ -2586,7 +2624,12 @@ function Milli_Chart(settings) {
2586
2624
 
2587
2625
  endpoint.y = Math.round(m_chartspaces.chart.height - getScaledSetting(m_chartCss.marginBottom) - (((parseFloat(_this.instruments[instrument].startValue)) - _this.scaleinfoY.minValue) * _this.scaleinfoY.valuePerPixel)) + 0.5;
2588
2626
 
2589
- m_ctx.moveTo(endpoint.x, endpoint.y);
2627
+
2628
+
2629
+
2630
+
2631
+
2632
+ m_ctx.moveTo(endpoint.x, endpoint.y);
2590
2633
  lastdate = new Date(data[i].timestamp);
2591
2634
  addedcloseprice1d = true;
2592
2635
  startx = endpoint.x;
@@ -2671,7 +2714,10 @@ function Milli_Chart(settings) {
2671
2714
 
2672
2715
  break;
2673
2716
  } else if (hCurveLastPoint) {
2674
- }
2717
+
2718
+
2719
+
2720
+ }
2675
2721
  }
2676
2722
  quantity = 0;
2677
2723
  }
@@ -2717,6 +2763,13 @@ function Milli_Chart(settings) {
2717
2763
  }
2718
2764
 
2719
2765
 
2766
+
2767
+
2768
+
2769
+
2770
+
2771
+
2772
+
2720
2773
  _this.setChartLength = function(len) {
2721
2774
  _this.settings.chartlen = len;
2722
2775
  m_zoom.mousedown.timestamp = null;
@@ -5499,7 +5552,7 @@ function milli_widget_get_data(request, callback) {
5499
5552
  }
5500
5553
 
5501
5554
  function MillistreamWidgetApi_scrollIntoView(scrollarea, elem, xalign, yalign) {
5502
- () => {};
5555
+ //console.log("MillistreamWidgetApi_scrollIntoView", scrollarea, elem, elem.offsetLeft, elem.offsetTop, elem.offsetHeight);
5503
5556
 
5504
5557
  if (typeof xalign == "undefined")
5505
5558
  xalign = null;
@@ -5672,6 +5725,7 @@ function MillistreamWidgetStreamingApi(settings) {
5672
5725
  m_socket = new WebSocket(_this.settings.server);
5673
5726
  m_socket.onopen = function() {
5674
5727
  () => {};
5728
+ if (m_requests.length > 0) {
5675
5729
  m_requests.forEach(function(request) {
5676
5730
  if (request.send == 0) {
5677
5731
 
@@ -5682,8 +5736,10 @@ function MillistreamWidgetStreamingApi(settings) {
5682
5736
  };
5683
5737
  m_socket.onerror = function() {
5684
5738
  () => {};
5739
+ };
5685
5740
  m_socket.onclose = function() {
5686
5741
  () => {};
5742
+ reconnect();
5687
5743
  };
5688
5744
 
5689
5745
  m_socket.onmessage = function(msg) {
@@ -5692,6 +5748,7 @@ function MillistreamWidgetStreamingApi(settings) {
5692
5748
  jsondata = JSON.parse(msg.data);
5693
5749
  } catch (e) {
5694
5750
  () => {};
5751
+ }
5695
5752
 
5696
5753
  if (typeof jsondata.instruments !== 'undefined') {
5697
5754
  for (var s = 0; s < jsondata.instruments.length; s++) {
@@ -5725,8 +5782,10 @@ function MillistreamWidgetStreamingApi(settings) {
5725
5782
 
5726
5783
  } else
5727
5784
  () => {};
5785
+ };
5728
5786
  } catch (exception) {
5729
5787
  () => {};
5788
+ reconnect();
5730
5789
  }
5731
5790
  }
5732
5791
  milli_stream_connect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@millistream/millistream-widgets",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Millistream widgets node package",
5
5
  "main": "millistream-widgets.js",
6
6
  "scripts": {