widget-common-container 0.0.0

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 (87) hide show
  1. package/.angular/cache/19.2.26/ng-packagr/0997d7866dbb7999756bcd6dce071e827244865f4ff149c26d049d1515686b01 +1 -0
  2. package/.angular/cache/19.2.26/ng-packagr/882519e10fb587011272af89a34932495c0e2cc97d0c030536d1033ee55ce561 +1 -0
  3. package/.angular/cache/19.2.26/ng-packagr/8b15b546ec32b4e82b20945f62d23ba911050bdc6a4a60d34875eea6fe236635 +1 -0
  4. package/.angular/cache/19.2.26/ng-packagr/9711df1afdc00e2ac901d2b22d9559a220e74d16c0bf6d3917e410c565aed496 +1 -0
  5. package/.angular/cache/19.2.26/ng-packagr/tsbuildinfo/inspark-widget-common.tsbuildinfo +1 -0
  6. package/.editorconfig +13 -0
  7. package/.eslintrc.json +28 -0
  8. package/README.md +27 -0
  9. package/angular.json +46 -0
  10. package/e2e/protractor.conf.js +28 -0
  11. package/e2e/src/app.e2e-spec.ts +14 -0
  12. package/e2e/src/app.po.ts +11 -0
  13. package/e2e/tsconfig.e2e.json +13 -0
  14. package/package.json +75 -0
  15. package/projects/widget-common/copy.json +8 -0
  16. package/projects/widget-common/karma.conf.js +31 -0
  17. package/projects/widget-common/ng-package.json +7 -0
  18. package/projects/widget-common/package-lock.json +78 -0
  19. package/projects/widget-common/package.json +23 -0
  20. package/projects/widget-common/src/assets/error.svg +6 -0
  21. package/projects/widget-common/src/assets/falsevalue.svg +6 -0
  22. package/projects/widget-common/src/assets/icon.svg +6 -0
  23. package/projects/widget-common/src/assets/none.svg +6 -0
  24. package/projects/widget-common/src/assets/success.svg +6 -0
  25. package/projects/widget-common/src/assets/warning.svg +6 -0
  26. package/projects/widget-common/src/lib/common.ts +23 -0
  27. package/projects/widget-common/src/lib/communication.service.ts +59 -0
  28. package/projects/widget-common/src/lib/echart/echart.component.html +2 -0
  29. package/projects/widget-common/src/lib/echart/echart.component.scss +40 -0
  30. package/projects/widget-common/src/lib/echart/echart.component.ts +703 -0
  31. package/projects/widget-common/src/lib/echart/en.ts +156 -0
  32. package/projects/widget-common/src/lib/echart/ru.ts +156 -0
  33. package/projects/widget-common/src/lib/forge/ParamAssign.ts +187 -0
  34. package/projects/widget-common/src/lib/forge/Script.service.ts +86 -0
  35. package/projects/widget-common/src/lib/forge/extenstion.ts +263 -0
  36. package/projects/widget-common/src/lib/forge/forge.component.html +2 -0
  37. package/projects/widget-common/src/lib/forge/forge.component.scss +6 -0
  38. package/projects/widget-common/src/lib/forge/forge.component.ts +184 -0
  39. package/projects/widget-common/src/lib/forge/forge.interface.ts +4 -0
  40. package/projects/widget-common/src/lib/loader.ts +19 -0
  41. package/projects/widget-common/src/lib/pie-chart/pie-chart.component.html +1 -0
  42. package/projects/widget-common/src/lib/pie-chart/pie-chart.component.scss +3 -0
  43. package/projects/widget-common/src/lib/pie-chart/pie-chart.component.ts +252 -0
  44. package/projects/widget-common/src/lib/shared.module.ts +40 -0
  45. package/projects/widget-common/src/lib/sprintf.ts +212 -0
  46. package/projects/widget-common/src/lib/widget-container/widget-container.component.ts +53 -0
  47. package/projects/widget-common/src/lib/widget.api.ts +24 -0
  48. package/projects/widget-common/src/lib/widget.component.ts +87 -0
  49. package/projects/widget-common/src/lib/widget.dialog.ts +14 -0
  50. package/projects/widget-common/src/lib/widget.generator.ts +1532 -0
  51. package/projects/widget-common/src/lib/widget.interface.ts +871 -0
  52. package/projects/widget-common/src/lib/widget.utils.ts +634 -0
  53. package/projects/widget-common/src/public_api.ts +9 -0
  54. package/projects/widget-common/src/scss/main.scss +24 -0
  55. package/projects/widget-common/src/test.ts +22 -0
  56. package/projects/widget-common/tsconfig.lib.json +38 -0
  57. package/projects/widget-common/tsconfig.lib.prod.json +6 -0
  58. package/projects/widget-common/tsconfig.spec.json +17 -0
  59. package/projects/widget-common/tslint.json +17 -0
  60. package/projects/widget-common/versions/full/copy.json +15 -0
  61. package/projects/widget-common/versions/full/package.json +7 -0
  62. package/projects/widget-common/versions/full/public_api.ts +19 -0
  63. package/projects/widget-common/versions/interfaces/copy.json +15 -0
  64. package/projects/widget-common/versions/interfaces/package.json +7 -0
  65. package/projects/widget-common/versions/interfaces/public_api.ts +9 -0
  66. package/src/app/app.component.html +20 -0
  67. package/src/app/app.component.scss +0 -0
  68. package/src/app/app.component.spec.ts +31 -0
  69. package/src/app/app.component.ts +10 -0
  70. package/src/app/app.module.ts +16 -0
  71. package/src/assets/.gitkeep +0 -0
  72. package/src/browserslist +11 -0
  73. package/src/environments/environment.prod.ts +3 -0
  74. package/src/environments/environment.ts +16 -0
  75. package/src/favicon.ico +0 -0
  76. package/src/index.html +14 -0
  77. package/src/karma.conf.js +31 -0
  78. package/src/main.ts +12 -0
  79. package/src/polyfills.ts +80 -0
  80. package/src/styles.scss +1 -0
  81. package/src/test.ts +20 -0
  82. package/src/tsconfig.app.json +11 -0
  83. package/src/tsconfig.spec.json +18 -0
  84. package/src/tslint.json +17 -0
  85. package/tsconfig.json +34 -0
  86. package/tslint.json +131 -0
  87. package/update_full.js +27 -0
@@ -0,0 +1,1532 @@
1
+ import {
2
+ Border,
3
+ ChartViews,
4
+ ChartViewToType,
5
+ EventValues,
6
+ GenerateConfigItem, IColConfig, IRowConfig,
7
+ ITEM_TYPE,
8
+ ItemCustom,
9
+ ItemInterval,
10
+ ItemSeries,
11
+ ItemSingle,
12
+ ItemSysInfo,
13
+ ItemLiftInfo,
14
+ ItemTable,
15
+ IWidget,
16
+ LineType,
17
+ ObjStateValues,
18
+ PARAM_STATE_INT,
19
+ PARAM_TYPE,
20
+ ParamConfigSeries,
21
+ ParamConfigurator,
22
+ SeriesDuration,
23
+ VALUE_TYPE,
24
+ WidgetItem,
25
+ WidgetParamChildren,
26
+ WidgetParamsChildren, DashboardType, IWidgetIconInfo
27
+ } from './widget.interface';
28
+ import {findParam} from './widget.utils';
29
+
30
+ export function generateValues(inputValues: WidgetParamsChildren | WidgetParamsChildren[] | WidgetParamChildren[],
31
+ params: ParamConfigurator[],
32
+ itemType = ITEM_TYPE.single, paramType = PARAM_TYPE.value, path = []): WidgetItem[] {
33
+ if (inputValues instanceof Array) {
34
+ // Проходимся по массив
35
+ const result: WidgetItem[] = [];
36
+ const conf: any = inputValues[0];
37
+ itemType = conf.item_type !== undefined ? conf.item_type : itemType;
38
+ paramType = conf.param_type !== undefined ? conf.param_type : paramType;
39
+ const param = findParam(params, path.join('.'));
40
+ const max = Math.min(param.generateConfig?.count || 3, conf.max || 10);
41
+ for (let i = 0; i < max; i++) {
42
+
43
+ if (paramType === PARAM_TYPE.virtual_object) {
44
+ const itemPath = [...path, 1];
45
+ result.push(generateValues(conf, params, itemType, paramType, itemPath));
46
+ } else {
47
+ result.push(generateValue(i, conf, paramType, itemType, param));
48
+ }
49
+ }
50
+ return result;
51
+ } else {
52
+ // Проходимся по объекту
53
+ const result: any = {};
54
+ for (const key in inputValues) {
55
+ if (inputValues.hasOwnProperty(key)) {
56
+ const itemPath = [...path, key];
57
+ const param = findParam(params, itemPath.join('.'));
58
+ const item = inputValues[key];
59
+ itemType = item.item_type || itemType;
60
+ paramType = item.param_type || paramType;
61
+ if (inputValues[key].items) {
62
+ if (inputValues[key].items instanceof Array) {
63
+ // Если элемент - массив
64
+ result[key] = {
65
+ items: generateValues(inputValues[key].items, params, itemType, paramType, itemPath),
66
+ config: generateParamConfig(itemType, param),
67
+ viewConfig: {...(param.param ? param.param.viewConfig : {})},
68
+ custom_data: inputValues[key].custom_data
69
+ };
70
+ } else {
71
+ // Если элемент - объект
72
+ result[key] = {
73
+ ...generateValues(inputValues[key].items, params, itemType, paramType, itemPath),
74
+ config: generateParamConfig(itemType, param),
75
+ viewConfig: {...(param.param ? param.param.viewConfig : {})},
76
+ custom_data: inputValues[key].custom_data
77
+ };
78
+ }
79
+ } else {
80
+ // Если элемент - простой
81
+ result[key] = generateValue(0, item, paramType, itemType, param);
82
+ }
83
+ }
84
+ }
85
+ return result;
86
+
87
+ }
88
+ }
89
+
90
+
91
+ function generateParamConfig<T>(itemType: ITEM_TYPE, param: ParamConfigurator, paramType: PARAM_TYPE = null)
92
+ : T {
93
+ switch (itemType) {
94
+ case ITEM_TYPE.custom:
95
+ return {
96
+ type: paramType,
97
+ value: 'text'
98
+ } as any;
99
+ case ITEM_TYPE.interval:
100
+ return {
101
+ dailyRange: 'dailyRange',
102
+ stateMap: false,
103
+ valueType: VALUE_TYPE.absolute,
104
+ duration: SeriesDuration.day,
105
+ count: 1,
106
+ } as any;
107
+
108
+ case ITEM_TYPE.single:
109
+ return {
110
+ valueType: VALUE_TYPE.absolute,
111
+ } as any;
112
+
113
+ case ITEM_TYPE.series:
114
+ const config = param.config as ParamConfigSeries;
115
+ return {
116
+ charttype: ChartViewToType[(config && config.viewtype) ? config.viewtype : ChartViews.lineChart],
117
+ viewtype: (config && config.viewtype) ? config.viewtype : ChartViews.lineChart,
118
+ duration: SeriesDuration.week,
119
+ count: 0,
120
+ generator: true
121
+ } as any;
122
+ case ITEM_TYPE.events:
123
+ return {
124
+ lineType: LineType.eventlog,
125
+ attrList: ['shortname', 'serialnumber', 'eventid', 'name', 'timestmp', 'msg'],
126
+ titleList: ['Short name', 'Serial number', 'Event', 'Full name', 'Time', 'Message'],
127
+ size: 10
128
+ } as any;
129
+
130
+ }
131
+
132
+ }
133
+
134
+ function generateValue(index: number, item: WidgetParamChildren, paramType: PARAM_TYPE, itemType: ITEM_TYPE, param: ParamConfigurator): WidgetItem {
135
+ let res;
136
+ switch (itemType) {
137
+ case ITEM_TYPE.series:
138
+ res = generateSeriesParam(index, paramType, item, param);
139
+ break;
140
+ case ITEM_TYPE.single:
141
+ res = generateSingleParams(index, paramType, item, param);
142
+ break;
143
+ case ITEM_TYPE.table:
144
+ res = generateTableParams(index, paramType, item, param);
145
+ break;
146
+ case ITEM_TYPE.events:
147
+ res = generateEventsParams(index, paramType, item, param);
148
+ break;
149
+ case ITEM_TYPE.objstate:
150
+ res = generateObjStateParams(index, paramType, item, param);
151
+ break;
152
+ case ITEM_TYPE.custom:
153
+ if (paramType === PARAM_TYPE.custom_external) {
154
+ res = generateSingleParams(index, paramType, item, param);
155
+ } else {
156
+ res = generateCustomParams(index, paramType, item, param);
157
+ }
158
+ break;
159
+ case ITEM_TYPE.interval:
160
+ res = generateIntervalParams(index, paramType, item, param);
161
+ break;
162
+ case ITEM_TYPE.sysinfo:
163
+ res = generateSysInfoParam(index, paramType, item, param);
164
+ break;
165
+ case ITEM_TYPE.liftinfo:
166
+ res = generateLiftInfoParam(index, paramType, item, param);
167
+ break;
168
+ }
169
+ if (item.custom_data) {
170
+ res.custom_data = res;
171
+ }
172
+ return res;
173
+ }
174
+
175
+ function updateValue(value) {
176
+
177
+ if (typeof value === 'boolean') {
178
+ return value ? 1 : 0;
179
+ } else {
180
+ return value;
181
+ }
182
+ }
183
+
184
+ function getRandomValue(paramType: PARAM_TYPE, item: WidgetParamChildren) {
185
+
186
+ if (item.available) {
187
+ return item.available[getRandom(0, item.available.length)];
188
+ } else {
189
+ if (paramType !== PARAM_TYPE.signal) {
190
+ return getRandom(10, 999);
191
+ } else {
192
+ return getRandom(0, 1);
193
+ }
194
+ }
195
+ }
196
+
197
+
198
+ function getIconSet(needIcons: boolean) {
199
+ if (!needIcons) {
200
+ return null;
201
+ }
202
+ return {
203
+ error: '',
204
+ falsevalue: '',
205
+ none: '',
206
+ success: '',
207
+ warning: '',
208
+ };
209
+ }
210
+
211
+ function generateSingleParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: any): ItemSingle {
212
+
213
+ const config = getConfig(param, index);
214
+ const value = (config.value === undefined || config.value === '') ? getRandomValue(paramType, item) : updateValue(config.value);
215
+ return {
216
+ device: config.param ? {
217
+ controller: {id: null, serialnumber: 'SN' + getRandom(10000, 99999), isOnline: config.isOnline},
218
+ object: {
219
+ id: null,
220
+ shortname: 'Object ' + getRandom(10000, 99999),
221
+ fullname: 'Object ' + getRandom(10000, 99999),
222
+ timezone: 3,
223
+ latitude: 0,
224
+ longitude: 0
225
+ },
226
+ isWorking: config.isWorkingDevice,
227
+ param: {
228
+ id: null,
229
+ name: 'deviceParam name',
230
+ measure: {
231
+ unit: generateMeasureUnit(),
232
+ title: 'Электричество',
233
+ id: getRandom(10000, 99999),
234
+ icon: generateWidgetIcon(),
235
+ },
236
+ type: PARAM_TYPE.value,
237
+ calc: false,
238
+ ctrability: config.ctrability,
239
+ },
240
+ zone: {id: getRandom(10000, 10005), name: `Zone ${getRandom(20000, 20005)}`},
241
+ room: {id: getRandom(10000, 10005), name: `Room ${getRandom(20000, 20005)}`},
242
+ unit: {id: getRandom(10000, 10005), name: `Unit ${getRandom(20000, 20005)}`},
243
+ classifier: {id: getRandom(10000, 10005), name: `Classifier ${getRandom(20000, 20005)}`},
244
+ state: (config.isWorkingDevice ? {
245
+ comment: 'Состояние канала устройства: работоспособен',
246
+ id: 1,
247
+ name: 'работоспособен'
248
+ } : {
249
+ comment: 'Состояние канала устройства: неработоспособен',
250
+ id: -1,
251
+ name: 'неработоспособен'
252
+ }),
253
+ } : null,
254
+ refName: '',
255
+ itemType: ITEM_TYPE.single,
256
+ widgetId: null,
257
+ title: config.title !== null ? config.title : 'Title param',
258
+ config: generateParamConfig(ITEM_TYPE.single, param),
259
+ value: config.data ? value : null,
260
+ viewConfig: {view: config.view, ...(param.param ? (param.param as ParamConfigurator).viewConfig : {})},
261
+ data: config.data ? {
262
+ date: 1548968400000,
263
+ value: value,
264
+ locked: config.locked,
265
+ manually: config.editable,
266
+ unit: {id: 2, available: true, name: '', unavailabilityDate: 0},
267
+ state: config.state ? {
268
+ color: PARAM_STATE_INT[config.state],
269
+ comment: 'comment',
270
+ idIcon: config.isIcon ? -1 : 0,
271
+ } : null,
272
+ } : null,
273
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
274
+ custom: {},
275
+ canEditable: config.editable,
276
+ borders: config.borders ? BORDERS : [],
277
+ icons: getIconSet(config.iconSet),
278
+ isEditing: false,
279
+ };
280
+ }
281
+
282
+
283
+ function generateSeriesParam(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemSeries {
284
+
285
+ const value = getRandomValue(paramType, item);
286
+ return {
287
+ device: {
288
+ controller: {id: null, serialnumber: 'SN' + getRandom(10000, 99999)},
289
+ object: {
290
+ id: null,
291
+ shortname: 'Object ' + getRandom(10000, 99999),
292
+ fullname: 'Object ' + getRandom(10000, 99999),
293
+ timezone: -3,
294
+ latitude: 0,
295
+ longitude: 0
296
+ },
297
+ param: {
298
+ id: null,
299
+ name: 'deviceParam name',
300
+ measure: {
301
+ unit: generateMeasureUnit(),
302
+ title: 'Электричество',
303
+ id: getRandom(10000, 99999),
304
+ icon: generateWidgetIcon(),
305
+ },
306
+ type: PARAM_TYPE.value,
307
+ calc: false,
308
+ },
309
+ zone: {id: getRandom(10000, 10005), name: `Zone ${getRandom(20000, 20005)}`},
310
+ room: {id: getRandom(10000, 10005), name: `Room ${getRandom(20000, 20005)}`},
311
+ unit: {id: getRandom(10000, 10005), name: `Unit ${getRandom(20000, 20005)}`},
312
+ classifier: {id: getRandom(10000, 10005), name: `Classifier ${getRandom(20000, 20005)}`},
313
+ },
314
+ refName: '',
315
+ itemType: ITEM_TYPE.single,
316
+ widgetId: null,
317
+ title: 'Title param',
318
+ config: {...generateParamConfig(ITEM_TYPE.series, param), ...param.config},
319
+ value,
320
+ viewConfig: null,
321
+ data: (param.config && (param.config as ParamConfigSeries).viewtype === ChartViews.candlestickBarChart) ? CANDLE_CHART : generateChartValues(),
322
+ custom: {},
323
+ borders: [],
324
+ isEditing: false,
325
+ };
326
+
327
+ }
328
+
329
+
330
+ function generateChartValues() {
331
+ const rand = Math.round(Math.random() * 100);
332
+ return CHART_VALUES.map(val => {
333
+ return {timestmp: val.timestmp, value: val.value + rand};
334
+ });
335
+ }
336
+
337
+ function generateIntervalParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemInterval {
338
+ const config = getConfig(param, index);
339
+ const value = (config.value === undefined || config.value === '') ? getRandomValue(paramType, item) : updateValue(config.value);
340
+ return {
341
+ device: {
342
+ controller: {id: null, serialnumber: 'SN' + getRandom(10000, 99999)},
343
+ object: {
344
+ id: null,
345
+ shortname: 'Object ' + getRandom(10000, 99999),
346
+ fullname: 'Object ' + getRandom(10000, 99999),
347
+ timezone: 3,
348
+ latitude: 0,
349
+ longitude: 0
350
+ },
351
+ param: {
352
+ id: null,
353
+ name: 'deviceParam name',
354
+ measure: {
355
+ unit: generateMeasureUnit(),
356
+ title: 'Электричество',
357
+ id: getRandom(10000, 99999),
358
+ icon: generateWidgetIcon(),
359
+ },
360
+ type: PARAM_TYPE.value,
361
+ calc: false,
362
+ ctrability: config.ctrability,
363
+ },
364
+ zone: {id: getRandom(10000, 10005), name: `Zone ${getRandom(20000, 20005)}`},
365
+ room: {id: getRandom(10000, 10005), name: `Room ${getRandom(20000, 20005)}`},
366
+ unit: {id: getRandom(10000, 10005), name: `Unit ${getRandom(20000, 20005)}`},
367
+ classifier: {id: getRandom(10000, 10005), name: `Classifier ${getRandom(20000, 20005)}`},
368
+ },
369
+ refName: '',
370
+ itemType: ITEM_TYPE.single,
371
+ widgetId: null,
372
+ title: config.title !== null ? config.title : 'Title param',
373
+ config: generateParamConfig(ITEM_TYPE.single, param),
374
+ value,
375
+ viewConfig: null,
376
+ data: config.data ? {
377
+ states: [{
378
+ 'interval': 21602841,
379
+ 'state': {'id': 3, 'name': 'критическое', 'color': 'error', 'comment': 'Критическое значение параметра'}
380
+ }, {
381
+ 'interval': 42698374,
382
+ 'state': {
383
+ 'id': 2,
384
+ 'name': 'отклонение',
385
+ 'color': 'warning',
386
+ 'comment': 'Значение параметра отклонилось от нормального'
387
+ }
388
+ }, {
389
+ 'interval': 21414971,
390
+ 'state': {'id': 1, 'name': 'норма', 'color': 'success', 'comment': 'Нормальное значение параметра'}
391
+ }, {
392
+ 'interval': 18053,
393
+ 'state': {'id': 0, 'name': 'нет контроля', 'color': 'none', 'comment': 'Значение параметра не контролируется'}
394
+ }], // absolute signal
395
+ switchCount: 1, // signal
396
+ value,
397
+ percent: 1, // relative и increment
398
+ min: 1, // absolute
399
+ max: 1, // absolute
400
+ state: config.state ? {
401
+ color: PARAM_STATE_INT[config.state],
402
+ comment: 'comment',
403
+ idIcon: config.isIcon ? -1 : 0,
404
+ } : null,
405
+ 'beginInterval': 1556658000000,
406
+ 'endInterval': 1557139222542,
407
+ valueMap: [{interval: -84606254, value: 0}, {interval: 1806254, value: 1}],
408
+ } : null,
409
+ custom: {},
410
+ borders: config.borders ? BORDERS : [],
411
+ isEditing: false,
412
+ };
413
+
414
+ }
415
+
416
+ function generateEventsParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): EventValues {
417
+
418
+ const getEvent = () => {
419
+ return {
420
+ 'id': Math.round(Math.random() * 100000),
421
+ 'shortname': 'БЕЛКА',
422
+ 'serialnumber': 'SQUIRREL',
423
+ 'eventid': Math.round(Math.random() * 100000),
424
+ 'name': '0pus334',
425
+ 'timestmp': 1694157120464,
426
+ 'paramname': null,
427
+ 'paramvalue': null,
428
+ 'msg': '0pus334',
429
+ 'cdpid': null,
430
+ 'ccpid': null,
431
+ 'categoryid': null,
432
+ 'media': [],
433
+ 'criticalId': 4,
434
+ 'criticalName': 'success',
435
+ 'closeTime': 1694157120464,
436
+ 'closed': Math.random() > 0.5,
437
+ 'processed': Math.random() > 0.5,
438
+ 'value': null
439
+ };
440
+ };
441
+ const rowList: any[] = [];
442
+
443
+ if (param.generateConfig.duration) {
444
+ for (let i = 0; i < getRandom(6, 30); i++) {
445
+ rowList.push(getEvent());
446
+ }
447
+ } else {
448
+ for (let i = 0; i < (param.generateConfig.count ?? 20); i++) {
449
+ rowList.push(getEvent());
450
+ }
451
+ }
452
+
453
+ return {
454
+ data: {rowList},
455
+ config: {attrList: ['shortname', 'serialnumber', 'msg'], titleList: ['Объект', 'Сер.номер', 'Сообщение']}
456
+ };
457
+ }
458
+
459
+ function generateObjStateParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ObjStateValues {
460
+ return {
461
+ config: {rubricId: 1},
462
+ data: {
463
+ date: 1697487855625,
464
+ states: [
465
+ {
466
+ count: 5,
467
+ id: 3,
468
+ name: 'активен',
469
+ },
470
+ {
471
+ count: 25,
472
+ id: 2,
473
+ name: 'не работает',
474
+ }
475
+ ]
476
+ }
477
+ };
478
+ }
479
+
480
+ function generateCustomParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemCustom {
481
+ const config = getConfig(param, index);
482
+ if (paramType === PARAM_TYPE.custom_string) {
483
+ const defValue = BIG_TEXT.slice(0, Math.min(config.paragraphCount || 2, 5)).join('\n');
484
+ return {
485
+ device: null,
486
+ refName: '',
487
+ itemType: ITEM_TYPE.custom,
488
+ widgetId: null,
489
+ title: config.title !== null ? config.title : 'Title param',
490
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
491
+ value: config.value ? config.value : defValue,
492
+ viewConfig: {},
493
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
494
+ custom: {},
495
+ canEditable: config.editable,
496
+ isEditing: false,
497
+ };
498
+ }
499
+
500
+ if (paramType === PARAM_TYPE.custom_objstate) {
501
+ const defValue = 3;
502
+ return {
503
+ device: null,
504
+ refName: '',
505
+ itemType: ITEM_TYPE.custom,
506
+ widgetId: null,
507
+ title: config.title !== null ? config.title : 'Title param',
508
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
509
+ value: config.value ? config.value : defValue,
510
+ viewConfig: {},
511
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
512
+ custom: {},
513
+ canEditable: config.editable,
514
+ isEditing: false,
515
+ };
516
+ }
517
+
518
+ if (paramType === PARAM_TYPE.custom_forge) {
519
+ return {
520
+ device: null,
521
+ refName: '',
522
+ itemType: ITEM_TYPE.custom,
523
+ widgetId: null,
524
+ title: config.title !== null ? config.title : 'Title param',
525
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
526
+ value: config.value ? config.value : '',
527
+ viewConfig: {},
528
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
529
+ custom: {},
530
+ canEditable: config.editable,
531
+ isEditing: false,
532
+ };
533
+ }
534
+
535
+ if (paramType === PARAM_TYPE.custom_fuxa) {
536
+ return {
537
+ device: null,
538
+ refName: '',
539
+ itemType: ITEM_TYPE.custom,
540
+ widgetId: null,
541
+ title: config.title !== null ? config.title : 'Title param',
542
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
543
+ value: config.value ? config.value : '',
544
+ viewConfig: {},
545
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
546
+ custom: {},
547
+ canEditable: config.editable,
548
+ isEditing: false,
549
+ };
550
+ }
551
+
552
+ if (paramType === PARAM_TYPE.custom_json) {
553
+
554
+ const defValue = undefined;
555
+ let json_value: any;
556
+ try {
557
+ json_value = config.value ? JSON.parse(config.value) : defValue;
558
+ } catch (e) {
559
+
560
+ }
561
+ return {
562
+ device: null,
563
+ refName: '',
564
+ itemType: ITEM_TYPE.custom,
565
+ widgetId: null,
566
+ title: config.title !== null ? config.title : 'Title param',
567
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
568
+ value: json_value,
569
+ viewConfig: {},
570
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
571
+ custom: {},
572
+ canEditable: config.editable,
573
+ isEditing: false,
574
+ };
575
+ }
576
+ if (paramType === PARAM_TYPE.custom_archer) {
577
+ const res = {
578
+ files: config.files ? {json: config.files.json, svg: config.files.svg} : null,
579
+ value: (config.archer && config.archer.value) ? config.archer.value : null,
580
+ viewConfig: {},
581
+ };
582
+
583
+ if (config.archer) {
584
+ for (const key in config.archer) {
585
+ if (config.archer.hasOwnProperty(key)) {
586
+ res[key] = config.archer[key];
587
+ }
588
+ }
589
+ }
590
+
591
+ return res as any;
592
+ }
593
+ if (paramType === PARAM_TYPE.custom_file) {
594
+ const res = {
595
+ files: config.files,
596
+ value: null,
597
+ viewConfig: {},
598
+ };
599
+
600
+ return res as any;
601
+ }
602
+
603
+ if (paramType === PARAM_TYPE.custom_select) {
604
+ const defValue = null;
605
+ return {
606
+ device: null,
607
+ refName: '',
608
+ itemType: ITEM_TYPE.custom,
609
+ widgetId: null,
610
+ title: config.title !== null ? config.title : 'Title param',
611
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
612
+ value: item.custom_data.items.find(val => val.value === config.selectValue),
613
+ viewConfig: {},
614
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
615
+ custom: {},
616
+ canEditable: config.editable,
617
+ isEditing: false,
618
+ };
619
+ }
620
+
621
+ if (paramType === PARAM_TYPE.custom_dashboard) {
622
+ const widgets: IWidget[] = [
623
+ {
624
+ title: 'Widget 1',
625
+ dashboard: {
626
+ id: 1,
627
+ dashname: 'Dash 1',
628
+ type: DashboardType.WEB,
629
+ objrubric: {
630
+ id: 0,
631
+ shortname: 'Rubric'
632
+ }
633
+ },
634
+ widgetclass: {
635
+ id: 1,
636
+ name: 'text',
637
+ storeId: 'text',
638
+ }
639
+ },
640
+ {
641
+ title: 'Widget 2',
642
+ dashboard: {
643
+ id: 1,
644
+ dashname: 'Dash 1',
645
+ type: DashboardType.WEB,
646
+ objrubric: {
647
+ id: 0,
648
+ shortname: 'Rubric'
649
+ }
650
+ },
651
+ widgetclass: {
652
+ id: 1,
653
+ name: 'text',
654
+ storeId: 'text',
655
+ }
656
+ },
657
+ {
658
+ title: 'Widget 3',
659
+ dashboard: {
660
+ id: 1,
661
+ dashname: 'Dash 1',
662
+ type: DashboardType.WEB,
663
+ objrubric: {
664
+ id: 0,
665
+ shortname: 'Rubric'
666
+ }
667
+ },
668
+ widgetclass: {
669
+ id: 1,
670
+ name: 'text',
671
+ storeId: 'text',
672
+ }
673
+ },
674
+ ];
675
+ return {
676
+ device: null,
677
+ refName: '',
678
+ itemType: ITEM_TYPE.custom,
679
+ widgetId: null,
680
+ title: config.title !== null ? config.title : 'Title param',
681
+ config: generateParamConfig(ITEM_TYPE.custom, param, paramType),
682
+ value: widgets,
683
+ viewConfig: {},
684
+ dashboardLink: config.pageLink ? {dashname: 'Test dashname', id: 2} : null,
685
+ custom: {},
686
+ };
687
+ }
688
+ }
689
+
690
+ function generateWidgetIcon(): IWidgetIconInfo {
691
+ return {
692
+ name: 'icon',
693
+ id: 1,
694
+ filepath: 'path',
695
+ iconset: {
696
+ id: 1,
697
+ name: 'iconset',
698
+ imagetype: 1
699
+ }
700
+ };
701
+ }
702
+
703
+ function generateTableParams(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemTable {
704
+
705
+
706
+ const values = [];
707
+
708
+
709
+ for (let i = 0; i < param.generateConfig.rows; i++) {
710
+ values[i] = [];
711
+ for (let j = 0; j < param.generateConfig.columns; j++) {
712
+ // if (Math.random() < 0.9) {
713
+ values[i][j] = generateSingleParams(index, paramType, item, param);
714
+ // } else {
715
+ // values[i][j] = null;
716
+ // }
717
+ }
718
+ }
719
+
720
+ const colConfig: IColConfig[] = [];
721
+
722
+ const rowConfig: IRowConfig[] = [];
723
+ for (let i = 1; i <= param.generateConfig.rows; i++) {
724
+ rowConfig.push({name: `Row ${i}`});
725
+ }
726
+ for (let i = 0; i <= param.generateConfig.columns; i++) {
727
+ colConfig.push(getRandomCol());
728
+ }
729
+
730
+ return {
731
+ device: null,
732
+ refName: '',
733
+ itemType: ITEM_TYPE.single,
734
+ widgetId: null,
735
+ title: 'Title param',
736
+ config: {},
737
+ values,
738
+ viewConfig: {
739
+ rowsName: ['row 1', 'row 2'],
740
+ colsName: ['col 1', 'col 2'],
741
+ cols: param.generateConfig.columns,
742
+ rows: param.generateConfig.rows,
743
+ visibleRow: param.generateConfig.visibleRow,
744
+ visibleCol: param.generateConfig.visibleCol,
745
+ view: param.generateConfig.view,
746
+ table: {
747
+ cols: param.generateConfig.columns,
748
+ rows: param.generateConfig.rows,
749
+ visibleRow: param.generateConfig.visibleRow,
750
+ visibleCol: param.generateConfig.visibleCol,
751
+ colConfig,
752
+ rowConfig,
753
+ }
754
+ },
755
+ custom: {},
756
+ borders: [],
757
+ isEditing: false,
758
+ };
759
+ }
760
+
761
+ function getRandomCol(hasLabel = true): IColConfig {
762
+ const rnd = Math.random();
763
+
764
+ if (rnd <= .25) {
765
+ return {name: hasLabel ? 'Col Fit' : undefined, widthType: 'fit-content'};
766
+ } else if (rnd <= .5) {
767
+ return {name: hasLabel ? 'Col Auto' : undefined, widthType: 'auto'};
768
+ } else if (rnd <= .8) {
769
+ return {name: hasLabel ? 'Col Fix Px100' : undefined, widthType: 'fix', size: {unit: 'px', value: 100}};
770
+ } else {
771
+ return {name: hasLabel ? 'Col Fix %20' : undefined, widthType: 'fix', size: {unit: '%', value: 20}};
772
+ }
773
+ }
774
+
775
+ function generateSysInfoParam(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemSysInfo {
776
+ return {
777
+ id: 1,
778
+ device: null,
779
+ refName: '',
780
+ itemType: ITEM_TYPE.sysinfo,
781
+ widgetId: null,
782
+ title: 'Title param',
783
+ config: {rubricId: 1174},
784
+ data: {
785
+ controllersInfo: {total: getRandom(0, 10), online: getRandom(0, 10), offline: getRandom(0, 10)},
786
+ date: Date.now()
787
+ }
788
+ };
789
+ }
790
+
791
+ function generateLiftInfoParam(index: number, paramType: PARAM_TYPE, item: WidgetParamChildren, param: ParamConfigurator): ItemLiftInfo {
792
+ return {
793
+ id: 1,
794
+ device: null,
795
+ refName: '',
796
+ itemType: ITEM_TYPE.liftinfo,
797
+ widgetId: null,
798
+ title: 'Title param',
799
+ config: {deviceClassifierId: 76, objectIds: [372]},
800
+ data: {
801
+ liftsInfo: {total: getRandom(0, 10), online: getRandom(0, 10), offline: getRandom(0, 10)},
802
+ date: Date.now()
803
+ }
804
+ };
805
+ }
806
+
807
+ function generateMeasureUnit() {
808
+ const units = ['град', '°C', 'лит', 'км', '%'];
809
+ return units[getRandom(0, units.length - 1)];
810
+ }
811
+
812
+ // Возвращает случайное число между min (включительно) и max (включительно)
813
+ export function getRandom(min, max) {
814
+ return Math.round(Math.random() * (max - min) + min);
815
+ }
816
+
817
+ function getConfig(param, index): GenerateConfigItem {
818
+ if (param?.generateConfig?.items) {
819
+ return param.generateConfig.items[index] || {};
820
+ }
821
+ return param?.generateConfig ?? {};
822
+ }
823
+
824
+ const BORDERS: Border[] = [{
825
+ 'state': {
826
+ 'id': 3,
827
+ 'name': 'критическое',
828
+ 'color': 'error',
829
+ 'comment': 'Критическое значение параметра'
830
+ }, 'intervals': [{'from': 70.0, 'to': null}]
831
+ }, {
832
+ 'state': {
833
+ 'id': 2,
834
+ 'name': 'отклонение',
835
+ 'color': 'warning',
836
+ 'comment': 'Значение параметра отклонилось от нормального'
837
+ }, 'intervals': [{'from': 30.0, 'to': 70.0}]
838
+ }, {
839
+ 'state': {'id': 1, 'name': 'норма', 'color': 'success', 'comment': 'Нормальное значение параметра'},
840
+ 'intervals': [{'from': 0.0, 'to': 30.0}]
841
+ }, {
842
+ 'state': {
843
+ 'id': 0,
844
+ 'name': 'нет контроля',
845
+ 'color': 'none',
846
+ 'comment': 'Значение параметра не контролируется'
847
+ }, 'intervals': [{'from': -20.0, 'to': 0.0}]
848
+ }, {
849
+ 'state': {
850
+ 'id': -1,
851
+ 'name': 'недостоверно',
852
+ 'color': 'falsevalue',
853
+ 'comment': 'Недостоверное значение параметра'
854
+ }, 'intervals': [{'from': null, 'to': -20.0}]
855
+ }].reverse();
856
+
857
+ const CHART_VALUES = [
858
+ {
859
+ 'timestmp': 1645551000000,
860
+ 'value': null
861
+ },
862
+ {
863
+ 'timestmp': 1645552800000,
864
+ 'value': 32.8258476
865
+ },
866
+ {
867
+ 'timestmp': 1645554600000,
868
+ 'value': 48.659893
869
+ },
870
+ {
871
+ 'timestmp': 1645556400000,
872
+ 'value': 50.5622482
873
+ },
874
+ {
875
+ 'timestmp': 1645558200000,
876
+ 'value': 51.6553383
877
+ },
878
+ {
879
+ 'timestmp': 1645560000000,
880
+ 'value': 50.4319
881
+ },
882
+ {
883
+ 'timestmp': 1645561800000,
884
+ 'value': 53.0366707
885
+ },
886
+ {
887
+ 'timestmp': 1645563600000,
888
+ 'value': 47.8176422
889
+ },
890
+ {
891
+ 'timestmp': 1645565400000,
892
+ 'value': 51.6424713
893
+ },
894
+ {
895
+ 'timestmp': 1645567200000,
896
+ 'value': 51.812233
897
+ },
898
+ {
899
+ 'timestmp': 1645569000000,
900
+ 'value': 47.3627434
901
+ },
902
+ {
903
+ 'timestmp': 1645570800000,
904
+ 'value': 51.7313538
905
+ },
906
+ {
907
+ 'timestmp': 1645572600000,
908
+ 'value': 49.4223938
909
+ },
910
+ {
911
+ 'timestmp': 1645574400000,
912
+ 'value': 52.5739746
913
+ },
914
+ {
915
+ 'timestmp': 1645576200000,
916
+ 'value': 51.6155472
917
+ },
918
+ {
919
+ 'timestmp': 1645578000000,
920
+ 'value': 49.1932793
921
+ },
922
+ {
923
+ 'timestmp': 1645579800000,
924
+ 'value': 51.5943527
925
+ },
926
+ {
927
+ 'timestmp': 1645581600000,
928
+ 'value': 50.5669518
929
+ },
930
+ {
931
+ 'timestmp': 1645583400000,
932
+ 'value': 48.7359962
933
+ },
934
+ {
935
+ 'timestmp': 1645585200000,
936
+ 'value': 53.4266319
937
+ },
938
+ {
939
+ 'timestmp': 1645587000000,
940
+ 'value': 50.285614
941
+ },
942
+ {
943
+ 'timestmp': 1645588800000,
944
+ 'value': 49.249176
945
+ },
946
+ {
947
+ 'timestmp': 1645590600000,
948
+ 'value': 50.412838
949
+ },
950
+ {
951
+ 'timestmp': 1645592400000,
952
+ 'value': 50.2692413
953
+ },
954
+ {
955
+ 'timestmp': 1645594200000,
956
+ 'value': 52.9794044
957
+ },
958
+ {
959
+ 'timestmp': 1645596000000,
960
+ 'value': 49.6678772
961
+ },
962
+ {
963
+ 'timestmp': 1645597800000,
964
+ 'value': 49.4464493
965
+ },
966
+ {
967
+ 'timestmp': 1645599600000,
968
+ 'value': 52.1587296
969
+ },
970
+ {
971
+ 'timestmp': 1645601400000,
972
+ 'value': 49.9102745
973
+ },
974
+ {
975
+ 'timestmp': 1645603200000,
976
+ 'value': 51.7093391
977
+ },
978
+ {
979
+ 'timestmp': 1645605000000,
980
+ 'value': 51.2751236
981
+ },
982
+ {
983
+ 'timestmp': 1645606800000,
984
+ 'value': 48.9914932
985
+ },
986
+ {
987
+ 'timestmp': 1645608600000,
988
+ 'value': 51.0573616
989
+ },
990
+ {
991
+ 'timestmp': 1645610400000,
992
+ 'value': 51.5929947
993
+ },
994
+ {
995
+ 'timestmp': 1645612200000,
996
+ 'value': 50.5275879
997
+ },
998
+ {
999
+ 'timestmp': 1645614000000,
1000
+ 'value': 52.7304688
1001
+ },
1002
+ {
1003
+ 'timestmp': 1645615800000,
1004
+ 'value': 48.162323
1005
+ },
1006
+ {
1007
+ 'timestmp': 1645617600000,
1008
+ 'value': 52.0599556
1009
+ },
1010
+ {
1011
+ 'timestmp': 1645619400000,
1012
+ 'value': 49.9631157
1013
+ },
1014
+ {
1015
+ 'timestmp': 1645621200000,
1016
+ 'value': 48.4315491
1017
+ },
1018
+ {
1019
+ 'timestmp': 1645623000000,
1020
+ 'value': 53.9735832
1021
+ },
1022
+ {
1023
+ 'timestmp': 1645624800000,
1024
+ 'value': 47.5742874
1025
+ },
1026
+ {
1027
+ 'timestmp': 1645626600000,
1028
+ 'value': 48.5623856
1029
+ },
1030
+ {
1031
+ 'timestmp': 1645628400000,
1032
+ 'value': 52.1424675
1033
+ },
1034
+ {
1035
+ 'timestmp': 1645630200000,
1036
+ 'value': 48.3597183
1037
+ },
1038
+ {
1039
+ 'timestmp': 1645632000000,
1040
+ 'value': 50.9834785
1041
+ },
1042
+ {
1043
+ 'timestmp': 1645633800000,
1044
+ 'value': 51.0054741
1045
+ },
1046
+ {
1047
+ 'timestmp': 1645635600000,
1048
+ 'value': 48.7688789
1049
+ },
1050
+ {
1051
+ 'timestmp': 1645637400000,
1052
+ 'value': 51.7769661
1053
+ },
1054
+ {
1055
+ 'timestmp': 1645639200000,
1056
+ 'value': 49.1443024
1057
+ },
1058
+ {
1059
+ 'timestmp': 1645641000000,
1060
+ 'value': 51.7417603
1061
+ },
1062
+ {
1063
+ 'timestmp': 1645642800000,
1064
+ 'value': 49.8708458
1065
+ },
1066
+ {
1067
+ 'timestmp': 1645644600000,
1068
+ 'value': 48.1264877
1069
+ },
1070
+ {
1071
+ 'timestmp': 1645646400000,
1072
+ 'value': 51.6495094
1073
+ },
1074
+ {
1075
+ 'timestmp': 1645648200000,
1076
+ 'value': 50.5347023
1077
+ },
1078
+ {
1079
+ 'timestmp': 1645650000000,
1080
+ 'value': 49.7064209
1081
+ },
1082
+ {
1083
+ 'timestmp': 1645651800000,
1084
+ 'value': 52.7749977
1085
+ },
1086
+ {
1087
+ 'timestmp': 1645653600000,
1088
+ 'value': 49.4221077
1089
+ },
1090
+ {
1091
+ 'timestmp': 1645655400000,
1092
+ 'value': 52.6562157
1093
+ },
1094
+ {
1095
+ 'timestmp': 1645657200000,
1096
+ 'value': 51.1348381
1097
+ },
1098
+ {
1099
+ 'timestmp': 1645659000000,
1100
+ 'value': 50.4315948
1101
+ },
1102
+ {
1103
+ 'timestmp': 1645660800000,
1104
+ 'value': 52.5681114
1105
+ },
1106
+ {
1107
+ 'timestmp': 1645662600000,
1108
+ 'value': 48.9252357
1109
+ },
1110
+ {
1111
+ 'timestmp': 1645664400000,
1112
+ 'value': 50.894516
1113
+ },
1114
+ {
1115
+ 'timestmp': 1645666200000,
1116
+ 'value': 51.7634201
1117
+ },
1118
+ {
1119
+ 'timestmp': 1645668000000,
1120
+ 'value': 51.0939255
1121
+ },
1122
+ {
1123
+ 'timestmp': 1645669800000,
1124
+ 'value': 53.2192345
1125
+ },
1126
+ {
1127
+ 'timestmp': 1645671600000,
1128
+ 'value': 51.7018623
1129
+ },
1130
+ {
1131
+ 'timestmp': 1645673400000,
1132
+ 'value': 50.0135651
1133
+ },
1134
+ {
1135
+ 'timestmp': 1645675200000,
1136
+ 'value': 51.3010292
1137
+ },
1138
+ {
1139
+ 'timestmp': 1645677000000,
1140
+ 'value': 46.5560951
1141
+ },
1142
+ {
1143
+ 'timestmp': 1645678800000,
1144
+ 'value': 52.3065147
1145
+ },
1146
+ {
1147
+ 'timestmp': 1645680600000,
1148
+ 'value': 49.7032089
1149
+ },
1150
+ {
1151
+ 'timestmp': 1645682400000,
1152
+ 'value': 48.5279617
1153
+ },
1154
+ {
1155
+ 'timestmp': 1645684200000,
1156
+ 'value': 52.1763
1157
+ },
1158
+ {
1159
+ 'timestmp': 1645686000000,
1160
+ 'value': 48.1455116
1161
+ },
1162
+ {
1163
+ 'timestmp': 1645687800000,
1164
+ 'value': 51.1893082
1165
+ },
1166
+ {
1167
+ 'timestmp': 1645689600000,
1168
+ 'value': 51.143837
1169
+ },
1170
+ {
1171
+ 'timestmp': 1645691400000,
1172
+ 'value': 48.4687042
1173
+ },
1174
+ {
1175
+ 'timestmp': 1645693200000,
1176
+ 'value': 51.5306282
1177
+ },
1178
+ {
1179
+ 'timestmp': 1645695000000,
1180
+ 'value': 50.565773
1181
+ },
1182
+ {
1183
+ 'timestmp': 1645696800000,
1184
+ 'value': 48.7029495
1185
+ },
1186
+ {
1187
+ 'timestmp': 1645698600000,
1188
+ 'value': 53.7815475
1189
+ },
1190
+ {
1191
+ 'timestmp': 1645700400000,
1192
+ 'value': 48.2070236
1193
+ },
1194
+ {
1195
+ 'timestmp': 1645702200000,
1196
+ 'value': 51.9778252
1197
+ },
1198
+ {
1199
+ 'timestmp': 1645704000000,
1200
+ 'value': 50.9588737
1201
+ },
1202
+ {
1203
+ 'timestmp': 1645705800000,
1204
+ 'value': 49.4310341
1205
+ },
1206
+ {
1207
+ 'timestmp': 1645707600000,
1208
+ 'value': 52.0059052
1209
+ },
1210
+ {
1211
+ 'timestmp': 1645709400000,
1212
+ 'value': 48.3030815
1213
+ },
1214
+ {
1215
+ 'timestmp': 1645711200000,
1216
+ 'value': 50.1639862
1217
+ },
1218
+ {
1219
+ 'timestmp': 1645713000000,
1220
+ 'value': 50.9100494
1221
+ },
1222
+ {
1223
+ 'timestmp': 1645714800000,
1224
+ 'value': 48.6635818
1225
+ },
1226
+ {
1227
+ 'timestmp': 1645716600000,
1228
+ 'value': 53.3434525
1229
+ },
1230
+ {
1231
+ 'timestmp': 1645718400000,
1232
+ 'value': 51.4400101
1233
+ },
1234
+ {
1235
+ 'timestmp': 1645720200000,
1236
+ 'value': 50.3772774
1237
+ },
1238
+ {
1239
+ 'timestmp': 1645722000000,
1240
+ 'value': 53.0157394
1241
+ },
1242
+ {
1243
+ 'timestmp': 1645723800000,
1244
+ 'value': 48.575489
1245
+ },
1246
+ {
1247
+ 'timestmp': 1645725600000,
1248
+ 'value': 50.9716911
1249
+ },
1250
+ {
1251
+ 'timestmp': 1645727400000,
1252
+ 'value': 51.041893
1253
+ },
1254
+ {
1255
+ 'timestmp': 1645729200000,
1256
+ 'value': 50.2014465
1257
+ },
1258
+ {
1259
+ 'timestmp': 1645731000000,
1260
+ 'value': 51.8398705
1261
+ },
1262
+ {
1263
+ 'timestmp': 1645732800000,
1264
+ 'value': 50.1148033
1265
+ },
1266
+ {
1267
+ 'timestmp': 1645734600000,
1268
+ 'value': 49.1726875
1269
+ },
1270
+ {
1271
+ 'timestmp': 1645736400000,
1272
+ 'value': 49.8998184
1273
+ },
1274
+ {
1275
+ 'timestmp': 1645738200000,
1276
+ 'value': 47.0266991
1277
+ },
1278
+ {
1279
+ 'timestmp': 1645740000000,
1280
+ 'value': 51.0160942
1281
+ },
1282
+ {
1283
+ 'timestmp': 1645741800000,
1284
+ 'value': 51.2925758
1285
+ },
1286
+ {
1287
+ 'timestmp': 1645743600000,
1288
+ 'value': 45.3985367
1289
+ },
1290
+ {
1291
+ 'timestmp': 1645745400000,
1292
+ 'value': 54.5472412
1293
+ },
1294
+ {
1295
+ 'timestmp': 1645747200000,
1296
+ 'value': 53.5879326
1297
+ },
1298
+ {
1299
+ 'timestmp': 1645749000000,
1300
+ 'value': 50.4831352
1301
+ },
1302
+ {
1303
+ 'timestmp': 1645750800000,
1304
+ 'value': 49.7594566
1305
+ },
1306
+ {
1307
+ 'timestmp': 1645752600000,
1308
+ 'value': 49.4067154
1309
+ },
1310
+ {
1311
+ 'timestmp': 1645754400000,
1312
+ 'value': 53.5835075
1313
+ },
1314
+ {
1315
+ 'timestmp': 1645756200000,
1316
+ 'value': 44.7278328
1317
+ },
1318
+ {
1319
+ 'timestmp': 1645758000000,
1320
+ 'value': 54.8701286
1321
+ },
1322
+ {
1323
+ 'timestmp': 1645759800000,
1324
+ 'value': 52.8954544
1325
+ },
1326
+ {
1327
+ 'timestmp': 1645761600000,
1328
+ 'value': 47.3508835
1329
+ },
1330
+ {
1331
+ 'timestmp': 1645763400000,
1332
+ 'value': 50.3395233
1333
+ },
1334
+ {
1335
+ 'timestmp': 1645765200000,
1336
+ 'value': 54.7109451
1337
+ },
1338
+ {
1339
+ 'timestmp': 1645767000000,
1340
+ 'value': 46.1835632
1341
+ },
1342
+ {
1343
+ 'timestmp': 1645768800000,
1344
+ 'value': 54.3547058
1345
+ },
1346
+ {
1347
+ 'timestmp': 1645770600000,
1348
+ 'value': 44.5034637
1349
+ },
1350
+ {
1351
+ 'timestmp': 1645772400000,
1352
+ 'value': 45.6780167
1353
+ },
1354
+ {
1355
+ 'timestmp': 1645774200000,
1356
+ 'value': 51.7169151
1357
+ },
1358
+ {
1359
+ 'timestmp': 1645776000000,
1360
+ 'value': 50.1562195
1361
+ },
1362
+ {
1363
+ 'timestmp': 1645777800000,
1364
+ 'value': 49.2977676
1365
+ },
1366
+ {
1367
+ 'timestmp': 1645779600000,
1368
+ 'value': 47.7331276
1369
+ },
1370
+ {
1371
+ 'timestmp': 1645781400000,
1372
+ 'value': 49.2630501
1373
+ },
1374
+ {
1375
+ 'timestmp': 1645783200000,
1376
+ 'value': 51.4490509
1377
+ },
1378
+ {
1379
+ 'timestmp': 1645785000000,
1380
+ 'value': 48.8069763
1381
+ },
1382
+ {
1383
+ 'timestmp': 1645786800000,
1384
+ 'value': 51.788662
1385
+ },
1386
+ {
1387
+ 'timestmp': 1645788600000,
1388
+ 'value': 50.8114243
1389
+ },
1390
+ {
1391
+ 'timestmp': 1645790400000,
1392
+ 'value': 48.7802238
1393
+ },
1394
+ {
1395
+ 'timestmp': 1645792200000,
1396
+ 'value': 52.4341049
1397
+ },
1398
+ {
1399
+ 'timestmp': 1645794000000,
1400
+ 'value': 42.9888535
1401
+ },
1402
+ {
1403
+ 'timestmp': 1645795800000,
1404
+ 'value': null
1405
+ }
1406
+ ];
1407
+
1408
+
1409
+ const CANDLE_CHART = [{'timestmp': 1548968400000, 'open': 24.0, 'close': 84.0, 'low': 1.0, 'high': 100.0}, {
1410
+ 'timestmp': 1548970200000,
1411
+ 'open': 84.0,
1412
+ 'close': 22.0,
1413
+ 'low': 1.0,
1414
+ 'high': 100.0
1415
+ }, {'timestmp': 1548972000000, 'open': 22.0, 'close': 55.0, 'low': 1.0, 'high': 100.0}, {
1416
+ 'timestmp': 1548973800000,
1417
+ 'open': 55.0,
1418
+ 'close': 58.0,
1419
+ 'low': 1.0,
1420
+ 'high': 100.0
1421
+ }, {'timestmp': 1548975600000, 'open': 58.0, 'close': 25.0, 'low': 1.0, 'high': 100.0}, {
1422
+ 'timestmp': 1548977400000,
1423
+ 'open': 25.0,
1424
+ 'close': 97.0,
1425
+ 'low': 1.0,
1426
+ 'high': 99.0
1427
+ }, {'timestmp': 1548979200000, 'open': 90.0, 'close': 16.0, 'low': 1.0, 'high': 99.0}, {
1428
+ 'timestmp': 1548981000000,
1429
+ 'open': 16.0,
1430
+ 'close': 57.0,
1431
+ 'low': 1.0,
1432
+ 'high': 100.0
1433
+ }, {'timestmp': 1548982800000, 'open': 57.0, 'close': 60.0, 'low': 1.0, 'high': 100.0}, {
1434
+ 'timestmp': 1548984600000,
1435
+ 'open': 60.0,
1436
+ 'close': 24.0,
1437
+ 'low': 2.0,
1438
+ 'high': 100.0
1439
+ }, {'timestmp': 1548986400000, 'open': 24.0, 'close': 85.0, 'low': 1.0, 'high': 100.0}, {
1440
+ 'timestmp': 1548988200000,
1441
+ 'open': 85.0,
1442
+ 'close': 26.0,
1443
+ 'low': 1.0,
1444
+ 'high': 100.0
1445
+ }, {'timestmp': 1548990000000, 'open': 26.0, 'close': 59.0, 'low': 1.0, 'high': 99.0}, {
1446
+ 'timestmp': 1548991800000,
1447
+ 'open': 59.0,
1448
+ 'close': 69.0,
1449
+ 'low': 1.0,
1450
+ 'high': 99.0
1451
+ }, {'timestmp': 1548993600000, 'open': 69.0, 'close': 18.0, 'low': 1.0, 'high': 100.0}, {
1452
+ 'timestmp': 1548995400000,
1453
+ 'open': 18.0,
1454
+ 'close': 86.0,
1455
+ 'low': 1.0,
1456
+ 'high': 100.0
1457
+ }, {'timestmp': 1548997200000, 'open': 86.0, 'close': 35.0, 'low': 1.0, 'high': 100.0}, {
1458
+ 'timestmp': 1548999000000,
1459
+ 'open': 35.0,
1460
+ 'close': 53.0,
1461
+ 'low': 1.0,
1462
+ 'high': 100.0
1463
+ }, {'timestmp': 1549000800000, 'open': 53.0, 'close': 62.0, 'low': 1.0, 'high': 100.0}, {
1464
+ 'timestmp': 1549002600000,
1465
+ 'open': 62.0,
1466
+ 'close': 30.0,
1467
+ 'low': 1.0,
1468
+ 'high': 100.0
1469
+ }, {'timestmp': 1549004400000, 'open': 30.0, 'close': 96.0, 'low': 1.0, 'high': 100.0}, {
1470
+ 'timestmp': 1549006200000,
1471
+ 'open': 96.0,
1472
+ 'close': 39.0,
1473
+ 'low': 2.0,
1474
+ 'high': 99.0
1475
+ }, {'timestmp': 1549008000000, 'open': 39.0, 'close': 49.0, 'low': 1.0, 'high': 100.0}, {
1476
+ 'timestmp': 1549009800000,
1477
+ 'open': 49.0,
1478
+ 'close': 56.0,
1479
+ 'low': 1.0,
1480
+ 'high': 100.0
1481
+ }, {'timestmp': 1549011600000, 'open': 56.0, 'close': 19.0, 'low': 1.0, 'high': 100.0}, {
1482
+ 'timestmp': 1549013400000,
1483
+ 'open': 19.0,
1484
+ 'close': 73.0,
1485
+ 'low': 1.0,
1486
+ 'high': 100.0
1487
+ }, {'timestmp': 1549015200000, 'open': 73.0, 'close': 22.0, 'low': 1.0, 'high': 99.0}, {
1488
+ 'timestmp': 1549017000000,
1489
+ 'open': 22.0,
1490
+ 'close': 43.0,
1491
+ 'low': 1.0,
1492
+ 'high': 100.0
1493
+ }, {'timestmp': 1549018800000, 'open': 43.0, 'close': 74.0, 'low': 1.0, 'high': 100.0}, {
1494
+ 'timestmp': 1549020600000,
1495
+ 'open': 74.0,
1496
+ 'close': 24.0,
1497
+ 'low': 1.0,
1498
+ 'high': 100.0
1499
+ }, {'timestmp': 1549022400000, 'open': 24.0, 'close': 78.0, 'low': 1.0, 'high': 100.0}, {
1500
+ 'timestmp': 1549024200000,
1501
+ 'open': 78.0,
1502
+ 'close': 43.0,
1503
+ 'low': 1.0,
1504
+ 'high': 100.0
1505
+ }, {'timestmp': 1549026000000, 'open': 43.0, 'close': 47.0, 'low': 2.0, 'high': 100.0}, {
1506
+ 'timestmp': 1549027800000,
1507
+ 'open': 47.0,
1508
+ 'close': 73.0,
1509
+ 'low': 1.0,
1510
+ 'high': 100.0
1511
+ }, {'timestmp': 1549029600000, 'open': 73.0, 'close': 2.0, 'low': 2.0, 'high': 100.0}, {
1512
+ 'timestmp': 1549031400000,
1513
+ 'open': 2.0,
1514
+ 'close': 76.0,
1515
+ 'low': 1.0,
1516
+ 'high': 100.0
1517
+ }, {'timestmp': 1549033200000, 'open': 76.0, 'close': 33.0, 'low': 1.0, 'high': 99.0}, {
1518
+ 'timestmp': 1549035000000,
1519
+ 'open': 33.0,
1520
+ 'close': 45.0,
1521
+ 'low': 2.0,
1522
+ 'high': 100.0
1523
+ }];
1524
+
1525
+
1526
+ const BIG_TEXT = [
1527
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi convallis congue nisi vel congue. Nulla vel sem non diam condimentum consectetur. Vivamus venenatis vehicula arcu, nec porta nisl. Aliquam vitae euismod arcu. Aenean fringilla, ligula et convallis fermentum, felis ligula commodo ante, non bibendum arcu diam vel ligula. Nullam lobortis interdum lorem ut convallis. Suspendisse potenti. Sed malesuada suscipit odio. Morbi a magna quis arcu semper consequat.',
1528
+ '\n\nMauris posuere, nunc eget pulvinar feugiat, urna quam egestas enim, non interdum enim arcu eu diam. Curabitur suscipit aliquet luctus. Proin eleifend nisl vitae tellus pulvinar elementum. Praesent sollicitudin, dui eu ultrices maximus, orci tortor efficitur libero, eu eleifend leo orci ut quam. Donec dignissim vel nibh sit amet congue. Suspendisse congue lacinia suscipit. Donec nec massa facilisis, aliquet leo nec, accumsan mi. Nam fringilla massa vitae tortor mollis congue. Sed purus arcu, ornare non turpis eu, molestie laoreet leo. Nunc eu rhoncus orci. Pellentesque quis nisi tempus, sagittis erat eu, finibus tortor. Fusce nisi ex, facilisis vitae aliquet in, rutrum sed neque. Aliquam pellentesque tellus risus, sit amet hendrerit nulla condimentum at. Aliquam ultrices, nisi nec sagittis imperdiet, velit orci semper dui, vitae bibendum sem felis vel leo. Ut non leo auctor, dictum nunc sodales, dapibus dolor.',
1529
+ '\n\nInteger blandit maximus sem, vel accumsan augue ultrices in. Curabitur ut dignissim magna, ut semper sem. Suspendisse tellus tortor, semper nec metus eu, maximus sodales tellus. Morbi sed tortor vel est vehicula blandit. Etiam id est risus. Ut consequat quis massa et commodo. Pellentesque fringilla commodo quam ac vestibulum. Quisque euismod elit velit, nec ultricies ligula consequat vitae. Ut aliquet sed sapien et elementum. Praesent rhoncus convallis nulla, vitae tempus magna euismod sit amet. Sed risus nunc, fringilla vel orci a, cursus rhoncus quam. Mauris tincidunt dolor lacus, et condimentum nisl tempor sit amet. Sed eros tortor, auctor a vulputate et, vulputate id ante. Quisque ultrices mollis vulputate. Aenean ut augue sem.',
1530
+ '\n\nDonec luctus mauris nec nibh varius, in posuere felis scelerisque. Donec vitae dapibus felis. In interdum, libero vehicula pellentesque iaculis, orci felis tempus mauris, vel ullamcorper leo odio quis nibh. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed fringilla vestibulum urna, nec sollicitudin lacus porta eu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean posuere ultrices nunc sit amet pretium. Quisque eget tortor semper, convallis diam sit amet, gravida purus. Maecenas finibus gravida mi eu convallis. Vivamus quis volutpat dui, vel elementum mauris. Aenean pretium odio tortor, et placerat ligula congue sit amet. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras ut tristique nisi. Suspendisse pharetra elit a ligula convallis dictum. Nunc egestas non leo eu ultrices.',
1531
+ '\n\nPraesent pulvinar nunc nec quam consectetur fringilla. Pellentesque tristique ex id mollis fermentum. Praesent sit amet lacinia nibh. Nulla at ex consequat, hendrerit sapien in, tincidunt tortor. Etiam eget efficitur libero. Proin consequat tellus at placerat sagittis. Nam vitae euismod sapien, sit amet ullamcorper odio. Sed tincidunt ut sem eu pellentesque. Sed efficitur nulla urna, sed finibus enim imperdiet in. Nulla ac nulla finibus, eleifend urna quis, semper felis.'
1532
+ ];