iobroker.ebus 2.4.3 → 2.5.1

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/README.md CHANGED
@@ -30,7 +30,7 @@ There is a possibillity to poll data which are not polled by ebusd directly. Com
30
30
 
31
31
  Another feature is to send any command to ebusd and receive answer to work with e.g. scripts.
32
32
 
33
- current supported ebusd-version: 21.2
33
+ current supported ebusd-version: 21.3
34
34
 
35
35
 
36
36
  ## how to send commands to ebusd
@@ -52,6 +52,20 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
52
52
 
53
53
  ## Changelog
54
54
 
55
+ ### 2.5.1 (in progress)
56
+ * (René) adjustable retries to send data if arbitration error appeared
57
+
58
+ ### 2.5.0 (2021-12-28)
59
+ * (René) see issue #62: support ebusd 21.3
60
+
61
+ ### 2.4.5 (2021-11-07)
62
+ * (René) bug fix color of labels in widget
63
+
64
+ ### 2.4.4 (2021-10-30)
65
+ * (René) see issue #59: avoid endless loop
66
+ * (René) update flot to 4.2.2
67
+ * (René) bug fix missing space in command when using circuit name
68
+
55
69
  ## 2.4.3 (2021-10-21)
56
70
  * (René) see issue #58: bug fix for Warn: ignoring history value 1 (invalid)" when no history values set
57
71
 
@@ -273,30 +273,14 @@
273
273
  <label for="parseTimeout" class="translate">parse_timeout</label>
274
274
  </div>
275
275
  </div>
276
+ <div class="row">
277
+ <div class="input-field col s12 m4 l3">
278
+ <input class="value number" id="maxretries" size="3" maxlength="3" type="number" min="0" max="10" />
279
+ <label for="maxretries" class="translate">maxretries</label>
280
+ </div>
281
+ </div>
276
282
 
277
- <!--
278
- <div class="row">
279
- <div class="input-field col s6">
280
- <textarea class="value materialize-textarea polled" id="PolledValues"></textarea>
281
- <label class="translate" for="PolledValues">ListOfAllPolledValues</label>
282
- </div>
283
-
284
- <div class="col s6">
285
- <span class="translate">hint_ebusd_polled</span>
286
- </div>
287
- </div>
288
-
289
- <div class="row">
290
- <div class="input-field col s6">
291
- <textarea class="value materialize-textarea polled" id="HistoryValues"></textarea>
292
- <label class="translate" for="HistoryValues">ListOfAllHistoryValues</label>
293
- </div>
294
-
295
- <div class="col s6">
296
- <span class="translate">hint_ebusd_history</span>
297
- </div>
298
- </div>
299
- -->
283
+
300
284
 
301
285
  </div>
302
286
 
package/admin/words.js CHANGED
@@ -16,4 +16,5 @@ systemDictionary = {
16
16
  "target_IP": { "en": "target IP", "de": "Ziel-IP", "ru": "целевой IP-адрес", "pt": "IP alvo", "nl": "doel-IP", "fr": "cible IP", "it": "IP di destinazione", "es": "IP objetivo", "pl": "docelowy adres IP", "zh-cn": "目标IP"},
17
17
  "target_TelnetPort": { "en": "target telnet Port to write data", "de": "target telnet Port zum Schreiben von Daten", "ru": "целевой порт telnet для записи данных", "pt": "destino telnet porta para escrever dados", "nl": "doel telnet-poort om gegevens te schrijven", "fr": "Port telnet cible pour écrire des données", "it": "Porta telnet target per scrivere dati", "es": "target telnet Port para escribir datos", "pl": "docelowy port telnet do zapisu danych", "zh-cn": "目标telnet用于写入数据的端口"},
18
18
  "useBoolean4Onoff": { "en": "use boolean instead string for datapoints with on/off values ", "de": "Verwenden Sie Boolean anstelle von Strings für Datenpunkte mit Ein-/Aus-Werten", "ru": "используйте логическое значение вместо строки для точек данных со значениями включения / выключения", "pt": "use booleano em vez de string para pontos de dados com valores on / off", "nl": "gebruik in plaats daarvan booleaanse string voor datapunten met aan/uit-waarden", "fr": "utiliser une chaîne booléenne à la place pour les points de données avec des valeurs activées/désactivées", "it": "usa la stringa booleana invece per i punti dati con valori on/off", "es": "use booleano en lugar de cadena para puntos de datos con valores de encendido / apagado", "pl": "użyj wartości logicznej zamiast ciągu dla punktów danych z wartościami włączonymi / wyłączonymi", "zh-cn": "对具有开/关值的数据点使用布尔值代替字符串"},
19
+ "maxretries": { "en": "maximum number of retries to send a command ", "de": "maximale Anzahl von Wiederholungen, um einen Befehl zu senden", "ru": "максимальное количество попыток отправки команды", "pt": "número máximo de tentativas para enviar um comando", "nl": "maximum aantal pogingen om een ​​opdracht te verzenden", "fr": "nombre maximum de tentatives pour envoyer une commande", "it": "numero massimo di tentativi per inviare un comando", "es": "número máximo de reintentos para enviar un comando", "pl": "maksymalna liczba ponownych prób wysłania polecenia", "zh-cn": "发送命令的最大重试次数"},
19
20
  };
package/io-package.json CHANGED
@@ -1,8 +1,56 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "ebus",
4
- "version": "2.4.3",
4
+ "version": "2.5.1",
5
5
  "news": {
6
+ "2.5.1": {
7
+ "en": "maximum retries to send data in case of arbitration error",
8
+ "de": "maximale Wiederholungsversuche zum Senden von Daten im Falle eines Vermittlungsfehlers",
9
+ "ru": "максимальное количество попыток отправки данных в случае ошибки арбитража",
10
+ "pt": "máximo de tentativas para enviar dados em caso de erro de arbitragem",
11
+ "nl": "maximaal aantal pogingen om gegevens te verzenden in geval van arbitragefout",
12
+ "fr": "nombre maximum de tentatives d'envoi de données en cas d'erreur d'arbitrage",
13
+ "it": "numero massimo di tentativi di invio dei dati in caso di errore di arbitrato",
14
+ "es": "reintentos máximos para enviar datos en caso de error de arbitraje",
15
+ "pl": "maksymalna liczba prób wysłania danych w przypadku błędu arbitrażu",
16
+ "zh-cn": "仲裁错误时发送数据的最大重试次数"
17
+ },
18
+ "2.5.0": {
19
+ "en": "support ebusd 21.3",
20
+ "de": "ebusd 21,3 . unterstützen",
21
+ "ru": "поддержка ebusd 21.3",
22
+ "pt": "suporte ebusd 21.3",
23
+ "nl": "ondersteuning ebusd 21.3",
24
+ "fr": "soutien ebusd 21.3",
25
+ "it": "supporto ebusd 21.3",
26
+ "es": "soporte ebusd 21.3",
27
+ "pl": "wsparcie ebusd 21.3",
28
+ "zh-cn": "支持 ebusd 21.3"
29
+ },
30
+ "2.4.5": {
31
+ "en": "bug fix color of labels in widget",
32
+ "de": "Fehlerkorrektur Farbe der Labels im Widget",
33
+ "ru": "исправлена ​​ошибка цвета меток в виджете",
34
+ "pt": "correção de bug de cor de rótulos no widget",
35
+ "nl": "bug fix kleur van labels in widget",
36
+ "fr": "correction de bogues couleur des étiquettes dans le widget",
37
+ "it": "bug fix colore delle etichette nel widget",
38
+ "es": "corrección de errores de color de las etiquetas en el widget",
39
+ "pl": "naprawa błędu koloru etykiet w widżecie",
40
+ "zh-cn": "错误修复小部件中标签的颜色"
41
+ },
42
+ "2.4.4": {
43
+ "en": "avoid endles loops",
44
+ "de": "Endlosschleifen vermeiden",
45
+ "ru": "избегать петель endles",
46
+ "pt": "evite loops de endles",
47
+ "nl": "vermijd eindeloze lussen",
48
+ "fr": "éviter les boucles sans fin",
49
+ "it": "evita i loop infiniti",
50
+ "es": "evitar bucles endles",
51
+ "pl": "unikaj niekończących się pętli",
52
+ "zh-cn": "避免无限循环"
53
+ },
6
54
  "2.4.3": {
7
55
  "en": "small bugs solved",
8
56
  "de": "kleine Fehler behoben",
@@ -193,6 +241,7 @@
193
241
  "parseTimeout": 60,
194
242
  "useBoolean4Onoff": false,
195
243
  "PolledDPs": [],
196
- "HistoryDPs": []
244
+ "HistoryDPs": [],
245
+ "maxretries": 5
197
246
  }
198
247
  }
package/main.js CHANGED
@@ -11,8 +11,11 @@
11
11
  /*jslint node: true */
12
12
  "use strict";
13
13
 
14
+
15
+
16
+
14
17
  const utils = require("@iobroker/adapter-core");
15
- const ebusdMinVersion = [21, 2];
18
+ const ebusdMinVersion = [21, 3];
16
19
  let ebusdVersion = [0, 0];
17
20
  let ebusdUpdateVersion = [0, 0];
18
21
 
@@ -841,10 +844,6 @@ read -f YieldTotal,read LegioProtectionEnabled,read -f -c broadcast outsidetemp
841
844
  //here we need a loop over all configured read data in admin-page
842
845
  async function ebusd_ReadValues() {
843
846
 
844
-
845
-
846
-
847
-
848
847
  if (oPolledVars.length > 0) {
849
848
 
850
849
  adapter.log.debug("to poll ctr " + oPolledVars.length + " vals: " + JSON.stringify(oPolledVars));
@@ -857,12 +856,13 @@ async function ebusd_ReadValues() {
857
856
  adapter.log.debug("telnet connected to poll variables " + adapter.config.targetIP + " port " + adapter.config.targetTelnetPort);
858
857
  promiseSocket.setTimeout(5000);
859
858
 
859
+ let retries = 0;
860
860
  for (let nCtr = 0; nCtr < oPolledVars.length; nCtr++) {
861
861
 
862
862
  let circuit = "";
863
863
  let params = "";
864
864
  if (oPolledVars[nCtr].circuit != null && oPolledVars[nCtr].circuit.length > 0) {
865
- circuit = "-c " + oPolledVars[nCtr].circuit;
865
+ circuit = "-c " + oPolledVars[nCtr].circuit + " ";
866
866
  }
867
867
  if (oPolledVars[nCtr].parameter != null && oPolledVars[nCtr].parameter.length > 0) {
868
868
  params = " " + oPolledVars[nCtr].parameter;
@@ -879,6 +879,22 @@ async function ebusd_ReadValues() {
879
879
  //received ERR: arbitration lost for YieldThisYear
880
880
  if (data.includes("ERR")) {
881
881
  adapter.log.error("sent " + cmd + ", received " + data + " for " + JSON.stringify(oPolledVars[nCtr]));
882
+
883
+ /*
884
+ * sent read -f YieldLastYear, received ERR: arbitration lost for {"circuit":"","name":"YieldLastYear","parameter":""}
885
+ * */
886
+ if (data.includes("arbitration lost")) {
887
+
888
+ retries++;
889
+ if (retries > adapter.config.maxretries) {
890
+ adapter.log.error("max retries, skip cmd " + cmd);
891
+ retries = 0;
892
+ }
893
+ else {
894
+ nCtr--;
895
+ adapter.log.debug("retry to send data ");
896
+ }
897
+ }
882
898
  }
883
899
  else {
884
900
  adapter.log.debug("received " + data + " for " + JSON.stringify(oPolledVars[nCtr]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.ebus",
3
- "version": "2.4.3",
3
+ "version": "2.5.1",
4
4
  "description": "ioBroker ebus Adapter",
5
5
  "author": {
6
6
  "name": "René G.",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@iobroker/adapter-core": "2.5.1",
24
- "@sentry/node": "6.13.3",
24
+ "@sentry/node": "6.16.1",
25
25
  "bent": "7.3.12",
26
26
  "flat": "5.0.2",
27
27
  "net": "1.0.2",
@@ -29,23 +29,23 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@iobroker/testing": "2.5.2",
32
- "@types/chai": "4.2.22",
32
+ "@types/chai": "4.3.0",
33
33
  "@types/chai-as-promised": "7.1.4",
34
34
  "@types/gulp": "4.0.9",
35
35
  "@types/mocha": "9.0.0",
36
- "@types/node": "12.20.33",
36
+ "@types/node": "16.11.14",
37
37
  "@types/proxyquire": "1.3.28",
38
38
  "@types/request-promise-native": "1.0.18",
39
- "@types/sinon": "10.0.4",
40
- "@types/sinon-chai": "3.2.5",
41
- "axios": "0.23.0",
39
+ "@types/sinon": "10.0.6",
40
+ "@types/sinon-chai": "3.2.6",
41
+ "axios": "0.24.0",
42
42
  "chai": "4.3.4",
43
43
  "chai-as-promised": "7.1.1",
44
- "eslint": "8.0.1",
44
+ "eslint": "8.5.0",
45
45
  "gulp": "4.0.2",
46
46
  "mocha": "9.1.3",
47
47
  "proxyquire": "2.1.3",
48
- "sinon": "11.1.2",
48
+ "sinon": "12.0.1",
49
49
  "sinon-chai": "3.7.0"
50
50
  },
51
51
  "main": "main.js",
@@ -175,7 +175,7 @@ don't work unless the canvas is attached to the DOM.
175
175
  }
176
176
  };
177
177
 
178
- /*
178
+ /**
179
179
  - getSVGLayer(classes)
180
180
 
181
181
  Creates (if necessary) and returns the SVG overlay container.
@@ -226,7 +226,7 @@ don't work unless the canvas is attached to the DOM.
226
226
  return layer;
227
227
  };
228
228
 
229
- /*
229
+ /**
230
230
  - getTextInfo(layer, text, font, angle, width)
231
231
 
232
232
  Creates (if necessary) and returns a text info object.
@@ -354,7 +354,7 @@ don't work unless the canvas is attached to the DOM.
354
354
  }
355
355
  }
356
356
 
357
- /*
357
+ /**
358
358
  - addText (layer, x, y, text, font, angle, width, halign, valign, transforms)
359
359
 
360
360
  Adds a text string to the canvas text overlay.
@@ -367,8 +367,8 @@ don't work unless the canvas is attached to the DOM.
367
367
  and text is the string to draw
368
368
  */
369
369
  Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign, transforms) {
370
- var info = this.getTextInfo(layer, text, font, angle, width);
371
- positions = info.positions;
370
+ var info = this.getTextInfo(layer, text, font, angle, width),
371
+ positions = info.positions;
372
372
 
373
373
  // Tweak the div's position to match the text's alignment
374
374
 
@@ -388,7 +388,6 @@ don't work unless the canvas is attached to the DOM.
388
388
 
389
389
  y += 0.75 * info.height;
390
390
 
391
-
392
391
  // Determine whether this text already exists at this position.
393
392
  // If so, mark it for inclusion in the next render pass.
394
393
 
@@ -449,7 +448,7 @@ don't work unless the canvas is attached to the DOM.
449
448
  position.element.style.textAlign = halign;
450
449
  // update the transforms
451
450
  updateTransforms(position.element, transforms);
452
- };
451
+ };
453
452
 
454
453
  var addTspanElements = function(text, element, x) {
455
454
  var lines = text.split('<br>'),
@@ -463,7 +462,7 @@ don't work unless the canvas is attached to the DOM.
463
462
  tspan = element.childNodes[i];
464
463
  }
465
464
  tspan.textContent = lines[i];
466
- offset = i * 1 + 'em';
465
+ offset = (i === 0 ? 0 : 1) + 'em';
467
466
  tspan.setAttributeNS(null, 'dy', offset);
468
467
  tspan.setAttributeNS(null, 'x', x);
469
468
  }
@@ -0,0 +1,215 @@
1
+ /*
2
+ Axis label plugin for flot
3
+
4
+ Derived from:
5
+ Axis Labels Plugin for flot.
6
+ http://github.com/markrcote/flot-axislabels
7
+
8
+ Original code is Copyright (c) 2010 Xuan Luo.
9
+ Original code was released under the GPLv3 license by Xuan Luo, September 2010.
10
+ Original code was rereleased under the MIT license by Xuan Luo, April 2012.
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining
13
+ a copy of this software and associated documentation files (the
14
+ "Software"), to deal in the Software without restriction, including
15
+ without limitation the rights to use, copy, modify, merge, publish,
16
+ distribute, sublicense, and/or sell copies of the Software, and to
17
+ permit persons to whom the Software is furnished to do so, subject to
18
+ the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be
21
+ included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30
+ */
31
+
32
+ (function($) {
33
+ "use strict";
34
+
35
+ var options = {
36
+ axisLabels: {
37
+ show: true
38
+ }
39
+ };
40
+
41
+ function AxisLabel(axisName, position, padding, placeholder, axisLabel, surface) {
42
+ this.axisName = axisName;
43
+ this.position = position;
44
+ this.padding = padding;
45
+ this.placeholder = placeholder;
46
+ this.axisLabel = axisLabel;
47
+ this.surface = surface;
48
+ this.width = 0;
49
+ this.height = 0;
50
+ this.elem = null;
51
+ }
52
+
53
+ AxisLabel.prototype.calculateSize = function() {
54
+ var axisId = this.axisName + 'Label',
55
+ layerId = axisId + 'Layer',
56
+ className = axisId + ' axisLabels';
57
+
58
+ var info = this.surface.getTextInfo(layerId, this.axisLabel, className);
59
+ this.labelWidth = info.width;
60
+ this.labelHeight = info.height;
61
+
62
+ if (this.position === 'left' || this.position === 'right') {
63
+ this.width = this.labelHeight + this.padding;
64
+ this.height = 0;
65
+ } else {
66
+ this.width = 0;
67
+ this.height = this.labelHeight + this.padding;
68
+ }
69
+ };
70
+
71
+ AxisLabel.prototype.transforms = function(degrees, x, y, svgLayer) {
72
+ var transforms = [], translate, rotate;
73
+ if (x !== 0 || y !== 0) {
74
+ translate = svgLayer.createSVGTransform();
75
+ translate.setTranslate(x, y);
76
+ transforms.push(translate);
77
+ }
78
+ if (degrees !== 0) {
79
+ rotate = svgLayer.createSVGTransform();
80
+ var centerX = Math.round(this.labelWidth / 2),
81
+ centerY = 0;
82
+ rotate.setRotate(degrees, centerX, centerY);
83
+ transforms.push(rotate);
84
+ }
85
+
86
+ return transforms;
87
+ };
88
+
89
+ AxisLabel.prototype.calculateOffsets = function(box) {
90
+ var offsets = {
91
+ x: 0,
92
+ y: 0,
93
+ degrees: 0
94
+ };
95
+ if (this.position === 'bottom') {
96
+ offsets.x = box.left + box.width / 2 - this.labelWidth / 2;
97
+ offsets.y = box.top + box.height - this.labelHeight;
98
+ } else if (this.position === 'top') {
99
+ offsets.x = box.left + box.width / 2 - this.labelWidth / 2;
100
+ offsets.y = box.top;
101
+ } else if (this.position === 'left') {
102
+ offsets.degrees = -90;
103
+ offsets.x = box.left - this.labelWidth / 2;
104
+ offsets.y = box.height / 2 + box.top;
105
+ } else if (this.position === 'right') {
106
+ offsets.degrees = 90;
107
+ offsets.x = box.left + box.width - this.labelWidth / 2;
108
+ offsets.y = box.height / 2 + box.top;
109
+ }
110
+ offsets.x = Math.round(offsets.x);
111
+ offsets.y = Math.round(offsets.y);
112
+
113
+ return offsets;
114
+ };
115
+
116
+ AxisLabel.prototype.cleanup = function() {
117
+ var axisId = this.axisName + 'Label',
118
+ layerId = axisId + 'Layer',
119
+ className = axisId + ' axisLabels';
120
+ this.surface.removeText(layerId, 0, 0, this.axisLabel, className);
121
+ };
122
+
123
+ AxisLabel.prototype.draw = function(box) {
124
+ var axisId = this.axisName + 'Label',
125
+ layerId = axisId + 'Layer',
126
+ className = axisId + ' axisLabels',
127
+ offsets = this.calculateOffsets(box),
128
+ style = {
129
+ position: 'absolute',
130
+ bottom: '',
131
+ right: '',
132
+ display: 'inline-block',
133
+ 'white-space': 'nowrap'
134
+ };
135
+
136
+ var layer = this.surface.getSVGLayer(layerId);
137
+ var transforms = this.transforms(offsets.degrees, offsets.x, offsets.y, layer.parentNode);
138
+
139
+ this.surface.addText(layerId, 0, 0, this.axisLabel, className, undefined, undefined, undefined, undefined, transforms);
140
+ this.surface.render();
141
+ Object.keys(style).forEach(function(key) {
142
+ layer.style[key] = style[key];
143
+ });
144
+ };
145
+
146
+ function init(plot) {
147
+ plot.hooks.processOptions.push(function (plot, options) {
148
+
149
+ console.log('??????? ');
150
+
151
+ if (!options.axisLabels.show) {
152
+ return;
153
+ }
154
+
155
+ var axisLabels = {};
156
+ var defaultPadding = 2; // padding between axis and tick labels
157
+
158
+ plot.hooks.axisReserveSpace.push(function(plot, axis) {
159
+ var opts = axis.options;
160
+ var axisName = axis.direction + axis.n;
161
+
162
+ axis.labelHeight += axis.boxPosition.centerY;
163
+ axis.labelWidth += axis.boxPosition.centerX;
164
+
165
+ if (!opts || !opts.axisLabel || !axis.show) {
166
+ return;
167
+ }
168
+
169
+ var padding = opts.axisLabelPadding === undefined
170
+ ? defaultPadding
171
+ : opts.axisLabelPadding;
172
+
173
+ var axisLabel = axisLabels[axisName];
174
+ if (!axisLabel) {
175
+ axisLabel = new AxisLabel(axisName,
176
+ opts.position, padding,
177
+ plot.getPlaceholder()[0], opts.axisLabel, plot.getSurface());
178
+ axisLabels[axisName] = axisLabel;
179
+ }
180
+
181
+ axisLabel.calculateSize();
182
+
183
+ // Incrementing the sizes of the tick labels.
184
+ axis.labelHeight += axisLabel.height;
185
+ axis.labelWidth += axisLabel.width;
186
+ });
187
+
188
+ // TODO - use the drawAxis hook
189
+ plot.hooks.draw.push(function(plot, ctx) {
190
+ $.each(plot.getAxes(), function(flotAxisName, axis) {
191
+ var opts = axis.options;
192
+ if (!opts || !opts.axisLabel || !axis.show) {
193
+ return;
194
+ }
195
+
196
+ var axisName = axis.direction + axis.n;
197
+ axisLabels[axisName].draw(axis.box);
198
+ });
199
+ });
200
+
201
+ plot.hooks.shutdown.push(function(plot, eventHolder) {
202
+ for (var axisName in axisLabels) {
203
+ axisLabels[axisName].cleanup();
204
+ }
205
+ });
206
+ });
207
+ };
208
+
209
+ $.plot.plugins.push({
210
+ init: init,
211
+ options: options,
212
+ name: 'axisLabels',
213
+ version: '3.0'
214
+ });
215
+ })(jQuery);
@@ -42,7 +42,7 @@ This plugin is used by flot for drawing lines, plots, bars or area.
42
42
  continue;
43
43
  }
44
44
 
45
- if(steps){
45
+ if (steps) {
46
46
  if (mx !== null && my !== null) {
47
47
  // if middle point exists, transfer p2 -> p1 and p1 -> mp
48
48
  x2 = x1;
@@ -202,7 +202,7 @@ This plugin is used by flot for drawing lines, plots, bars or area.
202
202
  continue;
203
203
  }
204
204
 
205
- if(steps){
205
+ if (steps) {
206
206
  if (mx !== null && my !== null) {
207
207
  // if middle point exists, transfer p2 -> p1 and p1 -> mp
208
208
  x2 = x1;
@@ -482,8 +482,7 @@ This plugin is used by flot for drawing lines, plots, bars or area.
482
482
  drawLeft = true;
483
483
  drawRight = false;
484
484
  }
485
- }
486
- else {
485
+ } else {
487
486
  drawLeft = drawRight = drawTop = true;
488
487
  drawBottom = false;
489
488
  left = x + barLeft;
@@ -32,7 +32,7 @@ jquery.flot.stack.js plugin, possibly some code could be shared.
32
32
  (function ($) {
33
33
  var options = {
34
34
  series: {
35
- fillBetween: null // or number
35
+ fillBetween: null // or number
36
36
  }
37
37
  };
38
38
 
@@ -60,11 +60,11 @@ jquery.flot.stack.js plugin, possibly some code could be shared.
60
60
  if (s.fillBetween == null) {
61
61
  return;
62
62
  }
63
-
64
- format = datapoints.format;
63
+
64
+ var format = datapoints.format;
65
65
  var plotHasId = function(id) {
66
66
  var plotData = plot.getData();
67
- for (i = 0; i < plotData.length; i++) {
67
+ for (var i = 0; i < plotData.length; i++) {
68
68
  if (plotData[i].id === id) {
69
69
  return true;
70
70
  }
@@ -76,17 +76,17 @@ jquery.flot.stack.js plugin, possibly some code could be shared.
76
76
  if (!format) {
77
77
  format = [];
78
78
 
79
- format.push({
80
- x: true,
81
- number: true,
79
+ format.push({
80
+ x: true,
81
+ number: true,
82
82
  computeRange: s.xaxis.options.autoScale !== 'none',
83
- required: true
83
+ required: true
84
84
  });
85
- format.push({
86
- y: true,
87
- number: true,
85
+ format.push({
86
+ y: true,
87
+ number: true,
88
88
  computeRange: s.yaxis.options.autoScale !== 'none',
89
- required: true
89
+ required: true
90
90
  });
91
91
 
92
92
  if (s.fillBetween !== undefined && s.fillBetween !== '' && plotHasId(s.fillBetween) && s.fillBetween !== s.id) {
@@ -79,7 +79,6 @@ the tooltip from webcharts).
79
79
  highlights = [];
80
80
  }
81
81
 
82
-
83
82
  function generatePlothoverEvent(e) {
84
83
  var o = plot.getOptions(),
85
84
  newEvent = new CustomEvent('mouseevent');
@@ -98,10 +97,10 @@ the tooltip from webcharts).
98
97
 
99
98
  function doTriggerClickHoverEvent(event, eventType, searchDistance) {
100
99
  var series = plot.getData();
101
- if (event !== undefined
102
- && series.length > 0
103
- && series[0].xaxis.c2p !== undefined
104
- && series[0].yaxis.c2p !== undefined) {
100
+ if (event !== undefined &&
101
+ series.length > 0 &&
102
+ series[0].xaxis.c2p !== undefined &&
103
+ series[0].yaxis.c2p !== undefined) {
105
104
  var eventToTrigger = "plot" + eventType;
106
105
  var seriesFlag = eventType + "able";
107
106
  triggerClickHoverEvent(eventToTrigger, event,
@@ -155,8 +154,8 @@ the tooltip from webcharts).
155
154
  var items = plot.findNearbyItems(canvasX, canvasY, seriesFilter, distance);
156
155
  var item = items[0];
157
156
 
158
- for (var i = 1; i < items.length; ++i) {
159
- if (item.distance === undefined ||
157
+ for (let i = 1; i < items.length; ++i) {
158
+ if (item.distance === undefined ||
160
159
  items[i].distance < item.distance) {
161
160
  item = items[i];
162
161
  }
@@ -172,7 +171,7 @@ the tooltip from webcharts).
172
171
 
173
172
  if (options.grid.autoHighlight) {
174
173
  // clear auto-highlights
175
- for (var i = 0; i < highlights.length; ++i) {
174
+ for (let i = 0; i < highlights.length; ++i) {
176
175
  var h = highlights[i];
177
176
  if ((h.auto === eventname &&
178
177
  !(item && h.series === item.series &&