myio-js-library 0.1.569 → 0.1.570
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/dist/index.cjs +33 -12
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -12
- package/dist/myio-js-library.umd.js +33 -12
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -953,7 +953,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
953
953
|
// package.json
|
|
954
954
|
var package_default = {
|
|
955
955
|
name: "myio-js-library",
|
|
956
|
-
version: "0.1.
|
|
956
|
+
version: "0.1.570",
|
|
957
957
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
958
958
|
license: "MIT",
|
|
959
959
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -36698,8 +36698,9 @@ function renderTemperatureBarsPng(opts) {
|
|
|
36698
36698
|
ctx.fillStyle = "#6b7280";
|
|
36699
36699
|
ctx.font = "20px Helvetica, Arial, sans-serif";
|
|
36700
36700
|
ctx.textBaseline = "middle";
|
|
36701
|
-
const
|
|
36702
|
-
|
|
36701
|
+
const unit = opts.unit || "\xB0C";
|
|
36702
|
+
const scale = `Escala ${fmt2(lo)}\u2013${fmt2(hi)} ${unit}`;
|
|
36703
|
+
ctx.fillText(ideal ? `${scale} \xB7 faixa ideal ${fmt2(ideal.min)}\u2013${fmt2(ideal.max)} ${unit}` : scale, 16, 26);
|
|
36703
36704
|
opts.items.forEach((item, i) => {
|
|
36704
36705
|
const y = TOP + i * ROW;
|
|
36705
36706
|
const cy = y + ROW / 2;
|
|
@@ -36747,7 +36748,8 @@ var DOMAIN_CONFIG = {
|
|
|
36747
36748
|
label: "Consumo (kWh)",
|
|
36748
36749
|
formatter: (v) => fmtPt(v),
|
|
36749
36750
|
summaryType: "total",
|
|
36750
|
-
summaryLabel: "Total"
|
|
36751
|
+
summaryLabel: "Total",
|
|
36752
|
+
measureLabel: "Consumo"
|
|
36751
36753
|
},
|
|
36752
36754
|
water: {
|
|
36753
36755
|
endpoint: "water",
|
|
@@ -36755,7 +36757,8 @@ var DOMAIN_CONFIG = {
|
|
|
36755
36757
|
label: "Consumo (m\xB3)",
|
|
36756
36758
|
formatter: (v) => fmtPt(v),
|
|
36757
36759
|
summaryType: "total",
|
|
36758
|
-
summaryLabel: "Total"
|
|
36760
|
+
summaryLabel: "Total",
|
|
36761
|
+
measureLabel: "Consumo"
|
|
36759
36762
|
},
|
|
36760
36763
|
temperature: {
|
|
36761
36764
|
endpoint: "temperature",
|
|
@@ -36763,7 +36766,23 @@ var DOMAIN_CONFIG = {
|
|
|
36763
36766
|
label: "Temperatura (\xB0C)",
|
|
36764
36767
|
formatter: (v) => fmtPt(v),
|
|
36765
36768
|
summaryType: "average",
|
|
36766
|
-
summaryLabel: "M\xE9dia"
|
|
36769
|
+
summaryLabel: "M\xE9dia",
|
|
36770
|
+
measureLabel: "Temperatura",
|
|
36771
|
+
rankingDayTitle: "Dias mais quentes (m\xE9dia do dia)",
|
|
36772
|
+
rankingHourTitle: "Horas mais quentes"
|
|
36773
|
+
},
|
|
36774
|
+
// Nível de tanque/caixa/cisterna — não existe no Ingestion; o chamador injeta um
|
|
36775
|
+
// `fetcher` que lê o timeseries do ThingsBoard (water_percentage × 100).
|
|
36776
|
+
water_level: {
|
|
36777
|
+
endpoint: "water_level",
|
|
36778
|
+
unit: "%",
|
|
36779
|
+
label: "N\xEDvel (%)",
|
|
36780
|
+
formatter: (v) => fmtPt(v),
|
|
36781
|
+
summaryType: "average",
|
|
36782
|
+
summaryLabel: "M\xE9dia",
|
|
36783
|
+
measureLabel: "N\xEDvel",
|
|
36784
|
+
rankingDayTitle: "Dias com maior n\xEDvel (m\xE9dia do dia)",
|
|
36785
|
+
rankingHourTitle: "Horas com maior n\xEDvel"
|
|
36767
36786
|
}
|
|
36768
36787
|
};
|
|
36769
36788
|
var createDefaultEnergyFetcher = (params, getGranularity) => {
|
|
@@ -37335,12 +37354,12 @@ var DeviceReportModal = class {
|
|
|
37335
37354
|
kpis.push(
|
|
37336
37355
|
{
|
|
37337
37356
|
value: maxRow ? fmt2(maxRow.consumption) : "\u2014",
|
|
37338
|
-
label: `${rowLabel} com Maior ${
|
|
37357
|
+
label: `${rowLabel} com Maior ${this.domainConfig.measureLabel} (${unit})`,
|
|
37339
37358
|
...maxRow ? { sub: this.formatDate(maxRow.date) } : {}
|
|
37340
37359
|
},
|
|
37341
37360
|
{
|
|
37342
37361
|
value: minRow ? fmt2(minRow.consumption) : "\u2014",
|
|
37343
|
-
label: `${rowLabel} com Menor ${
|
|
37362
|
+
label: `${rowLabel} com Menor ${this.domainConfig.measureLabel} (${unit})`,
|
|
37344
37363
|
...minRow ? { sub: this.formatDate(minRow.date) } : {}
|
|
37345
37364
|
}
|
|
37346
37365
|
);
|
|
@@ -37396,12 +37415,13 @@ var DeviceReportModal = class {
|
|
|
37396
37415
|
<div style="position:absolute;top:2px;bottom:2px;left:0;width:${pos(r.consumption)};background:${color(r.consumption)};border-radius:4px;opacity:.85;"></div></div>` : `<span style="font-size:11px;color:var(--myio-text-muted,#9ca3af);">Sem leitura</span>`}
|
|
37397
37416
|
<span style="text-align:right;font-variant-numeric:tabular-nums;font-weight:600;">${r ? this.domainConfig.formatter(r.consumption) : "\u2014"}</span>
|
|
37398
37417
|
</div>`;
|
|
37399
|
-
const
|
|
37418
|
+
const unit = this.domainConfig.unit;
|
|
37419
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > TOP_HOURS ? ` (top ${TOP_HOURS})` : ""}` : this.domainConfig.rankingDayTitle;
|
|
37400
37420
|
container.innerHTML = `
|
|
37401
37421
|
<div style="border:1px solid var(--myio-border,#e5e7eb);border-radius:10px;padding:12px 14px;max-height:620px;overflow-y:auto;">
|
|
37402
37422
|
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">${title}</div>
|
|
37403
37423
|
<div style="font-size:11px;color:var(--myio-text-muted,#6b7280);margin-bottom:10px;">
|
|
37404
|
-
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)}
|
|
37424
|
+
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)} ${unit}${hasIdeal ? ` \xB7 <span style="color:#16a34a;">faixa ideal ${this.domainConfig.formatter(Number(ideal.min))}\u2013${this.domainConfig.formatter(Number(ideal.max))} ${unit}</span>` : ""}
|
|
37405
37425
|
</div>
|
|
37406
37426
|
${shown.map((r) => line(this.formatDate(r.date), r)).join("")}
|
|
37407
37427
|
${noData.map((r) => line(this.formatDate(r.date), null)).join("")}
|
|
@@ -37614,9 +37634,10 @@ var DeviceReportModal = class {
|
|
|
37614
37634
|
...noData.map((r) => ({ label: this.formatDate(r.date), value: null }))
|
|
37615
37635
|
],
|
|
37616
37636
|
ideal: this.params.temperatureIdealRange ?? null,
|
|
37617
|
-
accent: this.resolveAccentHex()
|
|
37637
|
+
accent: this.resolveAccentHex(),
|
|
37638
|
+
unit: this.domainConfig.unit
|
|
37618
37639
|
});
|
|
37619
|
-
const title = isHourly ?
|
|
37640
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > 24 ? " (top 24)" : ""}` : this.domainConfig.rankingDayTitle;
|
|
37620
37641
|
return png ? { ...png, title } : null;
|
|
37621
37642
|
}
|
|
37622
37643
|
const chartPng = await this.participationChart?.toPngDataUrl?.().catch(() => null);
|
package/dist/index.d.cts
CHANGED
|
@@ -6319,7 +6319,7 @@ interface OpenDeviceReportParams {
|
|
|
6319
6319
|
deviceId?: string;
|
|
6320
6320
|
identifier?: string;
|
|
6321
6321
|
label?: string;
|
|
6322
|
-
domain?: 'energy' | 'water' | 'temperature';
|
|
6322
|
+
domain?: 'energy' | 'water' | 'temperature' | 'water_level';
|
|
6323
6323
|
granularity?: '1d' | '1h';
|
|
6324
6324
|
ui?: BaseUiCfg;
|
|
6325
6325
|
api: BaseApiCfg;
|
package/dist/index.d.ts
CHANGED
|
@@ -6319,7 +6319,7 @@ interface OpenDeviceReportParams {
|
|
|
6319
6319
|
deviceId?: string;
|
|
6320
6320
|
identifier?: string;
|
|
6321
6321
|
label?: string;
|
|
6322
|
-
domain?: 'energy' | 'water' | 'temperature';
|
|
6322
|
+
domain?: 'energy' | 'water' | 'temperature' | 'water_level';
|
|
6323
6323
|
granularity?: '1d' | '1h';
|
|
6324
6324
|
ui?: BaseUiCfg;
|
|
6325
6325
|
api: BaseApiCfg;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
// package.json
|
|
11
11
|
var package_default = {
|
|
12
12
|
name: "myio-js-library",
|
|
13
|
-
version: "0.1.
|
|
13
|
+
version: "0.1.570",
|
|
14
14
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
15
15
|
license: "MIT",
|
|
16
16
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -35030,8 +35030,9 @@ function renderTemperatureBarsPng(opts) {
|
|
|
35030
35030
|
ctx.fillStyle = "#6b7280";
|
|
35031
35031
|
ctx.font = "20px Helvetica, Arial, sans-serif";
|
|
35032
35032
|
ctx.textBaseline = "middle";
|
|
35033
|
-
const
|
|
35034
|
-
|
|
35033
|
+
const unit = opts.unit || "\xB0C";
|
|
35034
|
+
const scale = `Escala ${fmt2(lo)}\u2013${fmt2(hi)} ${unit}`;
|
|
35035
|
+
ctx.fillText(ideal ? `${scale} \xB7 faixa ideal ${fmt2(ideal.min)}\u2013${fmt2(ideal.max)} ${unit}` : scale, 16, 26);
|
|
35035
35036
|
opts.items.forEach((item, i) => {
|
|
35036
35037
|
const y = TOP + i * ROW;
|
|
35037
35038
|
const cy = y + ROW / 2;
|
|
@@ -35079,7 +35080,8 @@ var DOMAIN_CONFIG = {
|
|
|
35079
35080
|
label: "Consumo (kWh)",
|
|
35080
35081
|
formatter: (v) => fmtPt(v),
|
|
35081
35082
|
summaryType: "total",
|
|
35082
|
-
summaryLabel: "Total"
|
|
35083
|
+
summaryLabel: "Total",
|
|
35084
|
+
measureLabel: "Consumo"
|
|
35083
35085
|
},
|
|
35084
35086
|
water: {
|
|
35085
35087
|
endpoint: "water",
|
|
@@ -35087,7 +35089,8 @@ var DOMAIN_CONFIG = {
|
|
|
35087
35089
|
label: "Consumo (m\xB3)",
|
|
35088
35090
|
formatter: (v) => fmtPt(v),
|
|
35089
35091
|
summaryType: "total",
|
|
35090
|
-
summaryLabel: "Total"
|
|
35092
|
+
summaryLabel: "Total",
|
|
35093
|
+
measureLabel: "Consumo"
|
|
35091
35094
|
},
|
|
35092
35095
|
temperature: {
|
|
35093
35096
|
endpoint: "temperature",
|
|
@@ -35095,7 +35098,23 @@ var DOMAIN_CONFIG = {
|
|
|
35095
35098
|
label: "Temperatura (\xB0C)",
|
|
35096
35099
|
formatter: (v) => fmtPt(v),
|
|
35097
35100
|
summaryType: "average",
|
|
35098
|
-
summaryLabel: "M\xE9dia"
|
|
35101
|
+
summaryLabel: "M\xE9dia",
|
|
35102
|
+
measureLabel: "Temperatura",
|
|
35103
|
+
rankingDayTitle: "Dias mais quentes (m\xE9dia do dia)",
|
|
35104
|
+
rankingHourTitle: "Horas mais quentes"
|
|
35105
|
+
},
|
|
35106
|
+
// Nível de tanque/caixa/cisterna — não existe no Ingestion; o chamador injeta um
|
|
35107
|
+
// `fetcher` que lê o timeseries do ThingsBoard (water_percentage × 100).
|
|
35108
|
+
water_level: {
|
|
35109
|
+
endpoint: "water_level",
|
|
35110
|
+
unit: "%",
|
|
35111
|
+
label: "N\xEDvel (%)",
|
|
35112
|
+
formatter: (v) => fmtPt(v),
|
|
35113
|
+
summaryType: "average",
|
|
35114
|
+
summaryLabel: "M\xE9dia",
|
|
35115
|
+
measureLabel: "N\xEDvel",
|
|
35116
|
+
rankingDayTitle: "Dias com maior n\xEDvel (m\xE9dia do dia)",
|
|
35117
|
+
rankingHourTitle: "Horas com maior n\xEDvel"
|
|
35099
35118
|
}
|
|
35100
35119
|
};
|
|
35101
35120
|
var createDefaultEnergyFetcher = (params, getGranularity) => {
|
|
@@ -35667,12 +35686,12 @@ var DeviceReportModal = class {
|
|
|
35667
35686
|
kpis.push(
|
|
35668
35687
|
{
|
|
35669
35688
|
value: maxRow ? fmt2(maxRow.consumption) : "\u2014",
|
|
35670
|
-
label: `${rowLabel} com Maior ${
|
|
35689
|
+
label: `${rowLabel} com Maior ${this.domainConfig.measureLabel} (${unit})`,
|
|
35671
35690
|
...maxRow ? { sub: this.formatDate(maxRow.date) } : {}
|
|
35672
35691
|
},
|
|
35673
35692
|
{
|
|
35674
35693
|
value: minRow ? fmt2(minRow.consumption) : "\u2014",
|
|
35675
|
-
label: `${rowLabel} com Menor ${
|
|
35694
|
+
label: `${rowLabel} com Menor ${this.domainConfig.measureLabel} (${unit})`,
|
|
35676
35695
|
...minRow ? { sub: this.formatDate(minRow.date) } : {}
|
|
35677
35696
|
}
|
|
35678
35697
|
);
|
|
@@ -35728,12 +35747,13 @@ var DeviceReportModal = class {
|
|
|
35728
35747
|
<div style="position:absolute;top:2px;bottom:2px;left:0;width:${pos(r.consumption)};background:${color(r.consumption)};border-radius:4px;opacity:.85;"></div></div>` : `<span style="font-size:11px;color:var(--myio-text-muted,#9ca3af);">Sem leitura</span>`}
|
|
35729
35748
|
<span style="text-align:right;font-variant-numeric:tabular-nums;font-weight:600;">${r ? this.domainConfig.formatter(r.consumption) : "\u2014"}</span>
|
|
35730
35749
|
</div>`;
|
|
35731
|
-
const
|
|
35750
|
+
const unit = this.domainConfig.unit;
|
|
35751
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > TOP_HOURS ? ` (top ${TOP_HOURS})` : ""}` : this.domainConfig.rankingDayTitle;
|
|
35732
35752
|
container.innerHTML = `
|
|
35733
35753
|
<div style="border:1px solid var(--myio-border,#e5e7eb);border-radius:10px;padding:12px 14px;max-height:620px;overflow-y:auto;">
|
|
35734
35754
|
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">${title}</div>
|
|
35735
35755
|
<div style="font-size:11px;color:var(--myio-text-muted,#6b7280);margin-bottom:10px;">
|
|
35736
|
-
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)}
|
|
35756
|
+
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)} ${unit}${hasIdeal ? ` \xB7 <span style="color:#16a34a;">faixa ideal ${this.domainConfig.formatter(Number(ideal.min))}\u2013${this.domainConfig.formatter(Number(ideal.max))} ${unit}</span>` : ""}
|
|
35737
35757
|
</div>
|
|
35738
35758
|
${shown.map((r) => line(this.formatDate(r.date), r)).join("")}
|
|
35739
35759
|
${noData.map((r) => line(this.formatDate(r.date), null)).join("")}
|
|
@@ -35946,9 +35966,10 @@ var DeviceReportModal = class {
|
|
|
35946
35966
|
...noData.map((r) => ({ label: this.formatDate(r.date), value: null }))
|
|
35947
35967
|
],
|
|
35948
35968
|
ideal: this.params.temperatureIdealRange ?? null,
|
|
35949
|
-
accent: this.resolveAccentHex()
|
|
35969
|
+
accent: this.resolveAccentHex(),
|
|
35970
|
+
unit: this.domainConfig.unit
|
|
35950
35971
|
});
|
|
35951
|
-
const title = isHourly ?
|
|
35972
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > 24 ? " (top 24)" : ""}` : this.domainConfig.rankingDayTitle;
|
|
35952
35973
|
return png ? { ...png, title } : null;
|
|
35953
35974
|
}
|
|
35954
35975
|
const chartPng = await this.participationChart?.toPngDataUrl?.().catch(() => null);
|
|
@@ -5524,7 +5524,7 @@
|
|
|
5524
5524
|
|
|
5525
5525
|
// package.json
|
|
5526
5526
|
var package_default = {
|
|
5527
|
-
version: "0.1.
|
|
5527
|
+
version: "0.1.570"};
|
|
5528
5528
|
|
|
5529
5529
|
// src/utils/format/energy.ts
|
|
5530
5530
|
function formatPower(value, decimals = 2) {
|
|
@@ -40419,8 +40419,9 @@ ${kpiRows}` : ""}
|
|
|
40419
40419
|
ctx.fillStyle = "#6b7280";
|
|
40420
40420
|
ctx.font = "20px Helvetica, Arial, sans-serif";
|
|
40421
40421
|
ctx.textBaseline = "middle";
|
|
40422
|
-
const
|
|
40423
|
-
|
|
40422
|
+
const unit = opts.unit || "\xB0C";
|
|
40423
|
+
const scale = `Escala ${fmt2(lo)}\u2013${fmt2(hi)} ${unit}`;
|
|
40424
|
+
ctx.fillText(ideal ? `${scale} \xB7 faixa ideal ${fmt2(ideal.min)}\u2013${fmt2(ideal.max)} ${unit}` : scale, 16, 26);
|
|
40424
40425
|
opts.items.forEach((item, i) => {
|
|
40425
40426
|
const y = TOP + i * ROW;
|
|
40426
40427
|
const cy = y + ROW / 2;
|
|
@@ -40468,7 +40469,8 @@ ${kpiRows}` : ""}
|
|
|
40468
40469
|
label: "Consumo (kWh)",
|
|
40469
40470
|
formatter: (v) => fmtPt(v),
|
|
40470
40471
|
summaryType: "total",
|
|
40471
|
-
summaryLabel: "Total"
|
|
40472
|
+
summaryLabel: "Total",
|
|
40473
|
+
measureLabel: "Consumo"
|
|
40472
40474
|
},
|
|
40473
40475
|
water: {
|
|
40474
40476
|
endpoint: "water",
|
|
@@ -40476,7 +40478,8 @@ ${kpiRows}` : ""}
|
|
|
40476
40478
|
label: "Consumo (m\xB3)",
|
|
40477
40479
|
formatter: (v) => fmtPt(v),
|
|
40478
40480
|
summaryType: "total",
|
|
40479
|
-
summaryLabel: "Total"
|
|
40481
|
+
summaryLabel: "Total",
|
|
40482
|
+
measureLabel: "Consumo"
|
|
40480
40483
|
},
|
|
40481
40484
|
temperature: {
|
|
40482
40485
|
endpoint: "temperature",
|
|
@@ -40484,7 +40487,23 @@ ${kpiRows}` : ""}
|
|
|
40484
40487
|
label: "Temperatura (\xB0C)",
|
|
40485
40488
|
formatter: (v) => fmtPt(v),
|
|
40486
40489
|
summaryType: "average",
|
|
40487
|
-
summaryLabel: "M\xE9dia"
|
|
40490
|
+
summaryLabel: "M\xE9dia",
|
|
40491
|
+
measureLabel: "Temperatura",
|
|
40492
|
+
rankingDayTitle: "Dias mais quentes (m\xE9dia do dia)",
|
|
40493
|
+
rankingHourTitle: "Horas mais quentes"
|
|
40494
|
+
},
|
|
40495
|
+
// Nível de tanque/caixa/cisterna — não existe no Ingestion; o chamador injeta um
|
|
40496
|
+
// `fetcher` que lê o timeseries do ThingsBoard (water_percentage × 100).
|
|
40497
|
+
water_level: {
|
|
40498
|
+
endpoint: "water_level",
|
|
40499
|
+
unit: "%",
|
|
40500
|
+
label: "N\xEDvel (%)",
|
|
40501
|
+
formatter: (v) => fmtPt(v),
|
|
40502
|
+
summaryType: "average",
|
|
40503
|
+
summaryLabel: "M\xE9dia",
|
|
40504
|
+
measureLabel: "N\xEDvel",
|
|
40505
|
+
rankingDayTitle: "Dias com maior n\xEDvel (m\xE9dia do dia)",
|
|
40506
|
+
rankingHourTitle: "Horas com maior n\xEDvel"
|
|
40488
40507
|
}
|
|
40489
40508
|
};
|
|
40490
40509
|
var createDefaultEnergyFetcher = (params, getGranularity) => {
|
|
@@ -41056,12 +41075,12 @@ ${kpiRows}` : ""}
|
|
|
41056
41075
|
kpis.push(
|
|
41057
41076
|
{
|
|
41058
41077
|
value: maxRow ? fmt2(maxRow.consumption) : "\u2014",
|
|
41059
|
-
label: `${rowLabel} com Maior ${
|
|
41078
|
+
label: `${rowLabel} com Maior ${this.domainConfig.measureLabel} (${unit})`,
|
|
41060
41079
|
...maxRow ? { sub: this.formatDate(maxRow.date) } : {}
|
|
41061
41080
|
},
|
|
41062
41081
|
{
|
|
41063
41082
|
value: minRow ? fmt2(minRow.consumption) : "\u2014",
|
|
41064
|
-
label: `${rowLabel} com Menor ${
|
|
41083
|
+
label: `${rowLabel} com Menor ${this.domainConfig.measureLabel} (${unit})`,
|
|
41065
41084
|
...minRow ? { sub: this.formatDate(minRow.date) } : {}
|
|
41066
41085
|
}
|
|
41067
41086
|
);
|
|
@@ -41117,12 +41136,13 @@ ${kpiRows}` : ""}
|
|
|
41117
41136
|
<div style="position:absolute;top:2px;bottom:2px;left:0;width:${pos(r.consumption)};background:${color(r.consumption)};border-radius:4px;opacity:.85;"></div></div>` : `<span style="font-size:11px;color:var(--myio-text-muted,#9ca3af);">Sem leitura</span>`}
|
|
41118
41137
|
<span style="text-align:right;font-variant-numeric:tabular-nums;font-weight:600;">${r ? this.domainConfig.formatter(r.consumption) : "\u2014"}</span>
|
|
41119
41138
|
</div>`;
|
|
41120
|
-
const
|
|
41139
|
+
const unit = this.domainConfig.unit;
|
|
41140
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > TOP_HOURS ? ` (top ${TOP_HOURS})` : ""}` : this.domainConfig.rankingDayTitle;
|
|
41121
41141
|
container.innerHTML = `
|
|
41122
41142
|
<div style="border:1px solid var(--myio-border,#e5e7eb);border-radius:10px;padding:12px 14px;max-height:620px;overflow-y:auto;">
|
|
41123
41143
|
<div style="font-weight:700;font-size:14px;margin-bottom:2px;">${title}</div>
|
|
41124
41144
|
<div style="font-size:11px;color:var(--myio-text-muted,#6b7280);margin-bottom:10px;">
|
|
41125
|
-
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)}
|
|
41145
|
+
Escala ${this.domainConfig.formatter(lo)}\u2013${this.domainConfig.formatter(hi)} ${unit}${hasIdeal ? ` \xB7 <span style="color:#16a34a;">faixa ideal ${this.domainConfig.formatter(Number(ideal.min))}\u2013${this.domainConfig.formatter(Number(ideal.max))} ${unit}</span>` : ""}
|
|
41126
41146
|
</div>
|
|
41127
41147
|
${shown.map((r) => line(this.formatDate(r.date), r)).join("")}
|
|
41128
41148
|
${noData.map((r) => line(this.formatDate(r.date), null)).join("")}
|
|
@@ -41334,9 +41354,10 @@ ${kpiRows}` : ""}
|
|
|
41334
41354
|
...noData.map((r) => ({ label: this.formatDate(r.date), value: null }))
|
|
41335
41355
|
],
|
|
41336
41356
|
ideal: this.params.temperatureIdealRange ?? null,
|
|
41337
|
-
accent: this.resolveAccentHex()
|
|
41357
|
+
accent: this.resolveAccentHex(),
|
|
41358
|
+
unit: this.domainConfig.unit
|
|
41338
41359
|
});
|
|
41339
|
-
const title = isHourly ?
|
|
41360
|
+
const title = isHourly ? `${this.domainConfig.rankingHourTitle}${ranked.length > 24 ? " (top 24)" : ""}` : this.domainConfig.rankingDayTitle;
|
|
41340
41361
|
return png ? { ...png, title } : null;
|
|
41341
41362
|
}
|
|
41342
41363
|
const chartPng = await this.participationChart?.toPngDataUrl?.().catch(() => null);
|