@iobroker/gui-components 10.0.11 → 10.0.12

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.
@@ -1276,39 +1276,6 @@ export function getValueStyle(options) {
1276
1276
  // }
1277
1277
  return { color };
1278
1278
  }
1279
- export function prepareSparkData(values, from) {
1280
- // set one point every hour
1281
- let time = from;
1282
- let i = 1;
1283
- const v = [];
1284
- while (i < values.length && time < from + 25 * 3600000) {
1285
- // find the interval
1286
- while (values[i - 1].ts < time && time <= values[i].ts && i < values.length) {
1287
- i++;
1288
- }
1289
- if (i === 1 && values[i - 1].ts >= time) {
1290
- // assume the value was always null
1291
- v.push(0);
1292
- }
1293
- else if (i < values.length) {
1294
- if (typeof values[i].val === 'boolean' || typeof values[i - 1].val === 'boolean') {
1295
- v.push(values[i].val ? 1 : 0);
1296
- }
1297
- else {
1298
- // remove nulls
1299
- values[i - 1].val ||= 0;
1300
- values[i].val ||= 0;
1301
- // interpolate
1302
- const nm1 = values[i - 1].val;
1303
- const n = values[i].val;
1304
- const val = nm1 + ((n - nm1) * (time - values[i - 1].ts)) / (values[i].ts - values[i - 1].ts);
1305
- v.push(val);
1306
- }
1307
- }
1308
- time += 3600000;
1309
- }
1310
- return v;
1311
- }
1312
1279
  export function getCustomValue(obj, it) {
1313
1280
  if (obj?._id?.startsWith(`${it.adapter}.`) && it.path.length > 1) {
1314
1281
  const p = it.path;