iobroker.ebus 3.2.4 → 3.2.6

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.
Files changed (47) hide show
  1. package/.eslintrc.json +34 -34
  2. package/.releaseconfig.json +3 -0
  3. package/LICENSE +20 -20
  4. package/README.md +147 -130
  5. package/admin/index_m.html +419 -419
  6. package/admin/style.css +18 -18
  7. package/admin/words.js +27 -27
  8. package/io-package.json +218 -192
  9. package/lib/support_tools.js +370 -370
  10. package/lib/tools.js +99 -99
  11. package/main.js +1232 -1232
  12. package/package.json +13 -11
  13. package/widgets/ebus/lib/js/flot/jquery.canvaswrapper.js +549 -549
  14. package/widgets/ebus/lib/js/flot/jquery.colorhelpers.js +199 -199
  15. package/widgets/ebus/lib/js/flot/jquery.flot.axislabels.js +212 -212
  16. package/widgets/ebus/lib/js/flot/jquery.flot.browser.js +98 -98
  17. package/widgets/ebus/lib/js/flot/jquery.flot.categories.js +202 -202
  18. package/widgets/ebus/lib/js/flot/jquery.flot.composeImages.js +330 -330
  19. package/widgets/ebus/lib/js/flot/jquery.flot.crosshair.js +202 -202
  20. package/widgets/ebus/lib/js/flot/jquery.flot.drawSeries.js +662 -662
  21. package/widgets/ebus/lib/js/flot/jquery.flot.errorbars.js +375 -375
  22. package/widgets/ebus/lib/js/flot/jquery.flot.fillbetween.js +254 -254
  23. package/widgets/ebus/lib/js/flot/jquery.flot.flatdata.js +47 -47
  24. package/widgets/ebus/lib/js/flot/jquery.flot.hover.js +361 -361
  25. package/widgets/ebus/lib/js/flot/jquery.flot.image.js +249 -249
  26. package/widgets/ebus/lib/js/flot/jquery.flot.js +2953 -2953
  27. package/widgets/ebus/lib/js/flot/jquery.flot.legend.js +437 -437
  28. package/widgets/ebus/lib/js/flot/jquery.flot.logaxis.js +298 -298
  29. package/widgets/ebus/lib/js/flot/jquery.flot.navigate.js +834 -834
  30. package/widgets/ebus/lib/js/flot/jquery.flot.pie.js +794 -794
  31. package/widgets/ebus/lib/js/flot/jquery.flot.resize.js +60 -60
  32. package/widgets/ebus/lib/js/flot/jquery.flot.saturated.js +43 -43
  33. package/widgets/ebus/lib/js/flot/jquery.flot.selection.js +527 -527
  34. package/widgets/ebus/lib/js/flot/jquery.flot.stack.js +220 -220
  35. package/widgets/ebus/lib/js/flot/jquery.flot.symbol.js +98 -98
  36. package/widgets/ebus/lib/js/flot/jquery.flot.threshold.js +143 -143
  37. package/widgets/ebus/lib/js/flot/jquery.flot.time.js +586 -586
  38. package/widgets/ebus/lib/js/flot/jquery.flot.touch.js +320 -320
  39. package/widgets/ebus/lib/js/flot/jquery.flot.touchNavigate.js +360 -360
  40. package/widgets/ebus/lib/js/flot/jquery.flot.uiConstants.js +10 -10
  41. package/widgets/ebus/lib/js/flot/jquery.js +9473 -9473
  42. package/widgets/ebus/lib/js/lib/globalize.culture.en-US.js +33 -33
  43. package/widgets/ebus/lib/js/lib/globalize.js +1601 -1601
  44. package/widgets/ebus/lib/js/lib/jquery.event.drag.js +145 -145
  45. package/widgets/ebus/lib/js/lib/jquery.mousewheel.js +86 -86
  46. package/widgets/ebus.html +2395 -2395
  47. package/readme.txt +0 -297
@@ -1,202 +1,202 @@
1
- /* Flot plugin for plotting textual data or categories.
2
-
3
- Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
- Licensed under the MIT license.
5
-
6
- Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
7
- allows you to plot such a dataset directly.
8
-
9
- To enable it, you must specify mode: "categories" on the axis with the textual
10
- labels, e.g.
11
-
12
- $.plot("#placeholder", data, { xaxis: { mode: "categories" } });
13
-
14
- By default, the labels are ordered as they are met in the data series. If you
15
- need a different ordering, you can specify "categories" on the axis options
16
- and list the categories there:
17
-
18
- xaxis: {
19
- mode: "categories",
20
- categories: ["February", "March", "April"]
21
- }
22
-
23
- If you need to customize the distances between the categories, you can specify
24
- "categories" as an object mapping labels to values
25
-
26
- xaxis: {
27
- mode: "categories",
28
- categories: { "February": 1, "March": 3, "April": 4 }
29
- }
30
-
31
- If you don't specify all categories, the remaining categories will be numbered
32
- from the max value plus 1 (with a spacing of 1 between each).
33
-
34
- Internally, the plugin works by transforming the input data through an auto-
35
- generated mapping where the first category becomes 0, the second 1, etc.
36
- Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
37
- is visible in hover and click events that return numbers rather than the
38
- category labels). The plugin also overrides the tick generator to spit out the
39
- categories as ticks instead of the values.
40
-
41
- If you need to map a value back to its label, the mapping is always accessible
42
- as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
43
-
44
- */
45
-
46
- (function ($) {
47
- var options = {
48
- xaxis: {
49
- categories: null
50
- },
51
- yaxis: {
52
- categories: null
53
- }
54
- };
55
-
56
- function processRawData(plot, series, data, datapoints) {
57
- // if categories are enabled, we need to disable
58
- // auto-transformation to numbers so the strings are intact
59
- // for later processing
60
-
61
- var xCategories = series.xaxis.options.mode === "categories",
62
- yCategories = series.yaxis.options.mode === "categories";
63
-
64
- if (!(xCategories || yCategories)) {
65
- return;
66
- }
67
-
68
- var format = datapoints.format;
69
-
70
- if (!format) {
71
- // FIXME: auto-detection should really not be defined here
72
- var s = series;
73
- format = [];
74
- format.push({ x: true, number: true, required: true, computeRange: true});
75
- format.push({ y: true, number: true, required: true, computeRange: true });
76
-
77
- if (s.bars.show || (s.lines.show && s.lines.fill)) {
78
- var autoScale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
79
- format.push({ y: true, number: true, required: false, defaultValue: 0, computeRange: autoScale });
80
- if (s.bars.horizontal) {
81
- delete format[format.length - 1].y;
82
- format[format.length - 1].x = true;
83
- }
84
- }
85
-
86
- datapoints.format = format;
87
- }
88
-
89
- for (var m = 0; m < format.length; ++m) {
90
- if (format[m].x && xCategories) {
91
- format[m].number = false;
92
- }
93
-
94
- if (format[m].y && yCategories) {
95
- format[m].number = false;
96
- format[m].computeRange = false;
97
- }
98
- }
99
- }
100
-
101
- function getNextIndex(categories) {
102
- var index = -1;
103
-
104
- for (var v in categories) {
105
- if (categories[v] > index) {
106
- index = categories[v];
107
- }
108
- }
109
-
110
- return index + 1;
111
- }
112
-
113
- function categoriesTickGenerator(axis) {
114
- var res = [];
115
- for (var label in axis.categories) {
116
- var v = axis.categories[label];
117
- if (v >= axis.min && v <= axis.max) {
118
- res.push([v, label]);
119
- }
120
- }
121
-
122
- res.sort(function (a, b) { return a[0] - b[0]; });
123
-
124
- return res;
125
- }
126
-
127
- function setupCategoriesForAxis(series, axis, datapoints) {
128
- if (series[axis].options.mode !== "categories") {
129
- return;
130
- }
131
-
132
- if (!series[axis].categories) {
133
- // parse options
134
- var c = {}, o = series[axis].options.categories || {};
135
- if ($.isArray(o)) {
136
- for (var i = 0; i < o.length; ++i) {
137
- c[o[i]] = i;
138
- }
139
- } else {
140
- for (var v in o) {
141
- c[v] = o[v];
142
- }
143
- }
144
-
145
- series[axis].categories = c;
146
- }
147
-
148
- // fix ticks
149
- if (!series[axis].options.ticks) {
150
- series[axis].options.ticks = categoriesTickGenerator;
151
- }
152
-
153
- transformPointsOnAxis(datapoints, axis, series[axis].categories);
154
- }
155
-
156
- function transformPointsOnAxis(datapoints, axis, categories) {
157
- // go through the points, transforming them
158
- var points = datapoints.points,
159
- ps = datapoints.pointsize,
160
- format = datapoints.format,
161
- formatColumn = axis.charAt(0),
162
- index = getNextIndex(categories);
163
-
164
- for (var i = 0; i < points.length; i += ps) {
165
- if (points[i] == null) {
166
- continue;
167
- }
168
-
169
- for (var m = 0; m < ps; ++m) {
170
- var val = points[i + m];
171
-
172
- if (val == null || !format[m][formatColumn]) {
173
- continue;
174
- }
175
-
176
- if (!(val in categories)) {
177
- categories[val] = index;
178
- ++index;
179
- }
180
-
181
- points[i + m] = categories[val];
182
- }
183
- }
184
- }
185
-
186
- function processDatapoints(plot, series, datapoints) {
187
- setupCategoriesForAxis(series, "xaxis", datapoints);
188
- setupCategoriesForAxis(series, "yaxis", datapoints);
189
- }
190
-
191
- function init(plot) {
192
- plot.hooks.processRawData.push(processRawData);
193
- plot.hooks.processDatapoints.push(processDatapoints);
194
- }
195
-
196
- $.plot.plugins.push({
197
- init: init,
198
- options: options,
199
- name: 'categories',
200
- version: '1.0'
201
- });
202
- })(jQuery);
1
+ /* Flot plugin for plotting textual data or categories.
2
+
3
+ Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
+ Licensed under the MIT license.
5
+
6
+ Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
7
+ allows you to plot such a dataset directly.
8
+
9
+ To enable it, you must specify mode: "categories" on the axis with the textual
10
+ labels, e.g.
11
+
12
+ $.plot("#placeholder", data, { xaxis: { mode: "categories" } });
13
+
14
+ By default, the labels are ordered as they are met in the data series. If you
15
+ need a different ordering, you can specify "categories" on the axis options
16
+ and list the categories there:
17
+
18
+ xaxis: {
19
+ mode: "categories",
20
+ categories: ["February", "March", "April"]
21
+ }
22
+
23
+ If you need to customize the distances between the categories, you can specify
24
+ "categories" as an object mapping labels to values
25
+
26
+ xaxis: {
27
+ mode: "categories",
28
+ categories: { "February": 1, "March": 3, "April": 4 }
29
+ }
30
+
31
+ If you don't specify all categories, the remaining categories will be numbered
32
+ from the max value plus 1 (with a spacing of 1 between each).
33
+
34
+ Internally, the plugin works by transforming the input data through an auto-
35
+ generated mapping where the first category becomes 0, the second 1, etc.
36
+ Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
37
+ is visible in hover and click events that return numbers rather than the
38
+ category labels). The plugin also overrides the tick generator to spit out the
39
+ categories as ticks instead of the values.
40
+
41
+ If you need to map a value back to its label, the mapping is always accessible
42
+ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
43
+
44
+ */
45
+
46
+ (function ($) {
47
+ var options = {
48
+ xaxis: {
49
+ categories: null
50
+ },
51
+ yaxis: {
52
+ categories: null
53
+ }
54
+ };
55
+
56
+ function processRawData(plot, series, data, datapoints) {
57
+ // if categories are enabled, we need to disable
58
+ // auto-transformation to numbers so the strings are intact
59
+ // for later processing
60
+
61
+ var xCategories = series.xaxis.options.mode === "categories",
62
+ yCategories = series.yaxis.options.mode === "categories";
63
+
64
+ if (!(xCategories || yCategories)) {
65
+ return;
66
+ }
67
+
68
+ var format = datapoints.format;
69
+
70
+ if (!format) {
71
+ // FIXME: auto-detection should really not be defined here
72
+ var s = series;
73
+ format = [];
74
+ format.push({ x: true, number: true, required: true, computeRange: true});
75
+ format.push({ y: true, number: true, required: true, computeRange: true });
76
+
77
+ if (s.bars.show || (s.lines.show && s.lines.fill)) {
78
+ var autoScale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
79
+ format.push({ y: true, number: true, required: false, defaultValue: 0, computeRange: autoScale });
80
+ if (s.bars.horizontal) {
81
+ delete format[format.length - 1].y;
82
+ format[format.length - 1].x = true;
83
+ }
84
+ }
85
+
86
+ datapoints.format = format;
87
+ }
88
+
89
+ for (var m = 0; m < format.length; ++m) {
90
+ if (format[m].x && xCategories) {
91
+ format[m].number = false;
92
+ }
93
+
94
+ if (format[m].y && yCategories) {
95
+ format[m].number = false;
96
+ format[m].computeRange = false;
97
+ }
98
+ }
99
+ }
100
+
101
+ function getNextIndex(categories) {
102
+ var index = -1;
103
+
104
+ for (var v in categories) {
105
+ if (categories[v] > index) {
106
+ index = categories[v];
107
+ }
108
+ }
109
+
110
+ return index + 1;
111
+ }
112
+
113
+ function categoriesTickGenerator(axis) {
114
+ var res = [];
115
+ for (var label in axis.categories) {
116
+ var v = axis.categories[label];
117
+ if (v >= axis.min && v <= axis.max) {
118
+ res.push([v, label]);
119
+ }
120
+ }
121
+
122
+ res.sort(function (a, b) { return a[0] - b[0]; });
123
+
124
+ return res;
125
+ }
126
+
127
+ function setupCategoriesForAxis(series, axis, datapoints) {
128
+ if (series[axis].options.mode !== "categories") {
129
+ return;
130
+ }
131
+
132
+ if (!series[axis].categories) {
133
+ // parse options
134
+ var c = {}, o = series[axis].options.categories || {};
135
+ if ($.isArray(o)) {
136
+ for (var i = 0; i < o.length; ++i) {
137
+ c[o[i]] = i;
138
+ }
139
+ } else {
140
+ for (var v in o) {
141
+ c[v] = o[v];
142
+ }
143
+ }
144
+
145
+ series[axis].categories = c;
146
+ }
147
+
148
+ // fix ticks
149
+ if (!series[axis].options.ticks) {
150
+ series[axis].options.ticks = categoriesTickGenerator;
151
+ }
152
+
153
+ transformPointsOnAxis(datapoints, axis, series[axis].categories);
154
+ }
155
+
156
+ function transformPointsOnAxis(datapoints, axis, categories) {
157
+ // go through the points, transforming them
158
+ var points = datapoints.points,
159
+ ps = datapoints.pointsize,
160
+ format = datapoints.format,
161
+ formatColumn = axis.charAt(0),
162
+ index = getNextIndex(categories);
163
+
164
+ for (var i = 0; i < points.length; i += ps) {
165
+ if (points[i] == null) {
166
+ continue;
167
+ }
168
+
169
+ for (var m = 0; m < ps; ++m) {
170
+ var val = points[i + m];
171
+
172
+ if (val == null || !format[m][formatColumn]) {
173
+ continue;
174
+ }
175
+
176
+ if (!(val in categories)) {
177
+ categories[val] = index;
178
+ ++index;
179
+ }
180
+
181
+ points[i + m] = categories[val];
182
+ }
183
+ }
184
+ }
185
+
186
+ function processDatapoints(plot, series, datapoints) {
187
+ setupCategoriesForAxis(series, "xaxis", datapoints);
188
+ setupCategoriesForAxis(series, "yaxis", datapoints);
189
+ }
190
+
191
+ function init(plot) {
192
+ plot.hooks.processRawData.push(processRawData);
193
+ plot.hooks.processDatapoints.push(processDatapoints);
194
+ }
195
+
196
+ $.plot.plugins.push({
197
+ init: init,
198
+ options: options,
199
+ name: 'categories',
200
+ version: '1.0'
201
+ });
202
+ })(jQuery);