@hestia-earth/ui-components 0.28.0-0 → 0.28.0-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/esm2022/cycles/cycles-emissions-chart/cycles-emissions-chart.component.mjs +7 -7
- package/esm2022/cycles/cycles-result/cycles-result.component.mjs +9 -12
- package/esm2022/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.mjs +6 -6
- package/esm2022/impact-assessments/impact-assessments-indicators-chart/impact-assessments-indicators-chart.component.mjs +6 -6
- package/fesm2022/hestia-earth-ui-components.mjs +23 -26
- package/fesm2022/hestia-earth-ui-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ import { faCircle, faClone, faIdBadge } from '@fortawesome/free-regular-svg-icon
|
|
|
40
40
|
import set from 'lodash.set';
|
|
41
41
|
import uniqBy from 'lodash.uniqby';
|
|
42
42
|
import * as semver from 'semver';
|
|
43
|
-
import { Chart, CategoryScale, LinearScale, BarController, BarElement } from 'chart.js';
|
|
43
|
+
import { Chart, CategoryScale, LinearScale, BarController, BarElement, Tooltip } from 'chart.js';
|
|
44
44
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
|
45
45
|
import { create, formatters } from 'jsondiffpatch';
|
|
46
46
|
import omit from 'lodash.omit';
|
|
@@ -6409,7 +6409,7 @@ class CyclesEmissionsChartComponent {
|
|
|
6409
6409
|
borderColor: this.colors()
|
|
6410
6410
|
}
|
|
6411
6411
|
]);
|
|
6412
|
-
Chart.register(CategoryScale, LinearScale, BarController, BarElement,
|
|
6412
|
+
Chart.register(CategoryScale, LinearScale, BarController, BarElement, Tooltip);
|
|
6413
6413
|
effect(() => {
|
|
6414
6414
|
this.chart = new Chart(this.chartRef().nativeElement, {
|
|
6415
6415
|
type: 'bar',
|
|
@@ -6417,19 +6417,20 @@ class CyclesEmissionsChartComponent {
|
|
|
6417
6417
|
labels: [],
|
|
6418
6418
|
datasets: []
|
|
6419
6419
|
},
|
|
6420
|
+
plugins: [ChartDataLabels],
|
|
6420
6421
|
options: {
|
|
6421
6422
|
plugins: {
|
|
6422
6423
|
legend: {
|
|
6423
6424
|
display: false
|
|
6424
6425
|
},
|
|
6426
|
+
tooltip: {
|
|
6427
|
+
enabled: true
|
|
6428
|
+
},
|
|
6425
6429
|
datalabels: {
|
|
6426
6430
|
color: 'black',
|
|
6427
6431
|
formatter: value => toPrecision(value, 3),
|
|
6428
6432
|
anchor: 'center',
|
|
6429
6433
|
clamp: true
|
|
6430
|
-
},
|
|
6431
|
-
tooltip: {
|
|
6432
|
-
enabled: true
|
|
6433
6434
|
}
|
|
6434
6435
|
},
|
|
6435
6436
|
responsive: true,
|
|
@@ -6461,7 +6462,6 @@ class CyclesEmissionsChartComponent {
|
|
|
6461
6462
|
});
|
|
6462
6463
|
}
|
|
6463
6464
|
ngOnDestroy() {
|
|
6464
|
-
Chart.unregister(ChartDataLabels);
|
|
6465
6465
|
return this.chart && this.chart.destroy();
|
|
6466
6466
|
}
|
|
6467
6467
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: CyclesEmissionsChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -6601,7 +6601,7 @@ class CyclesResultComponent {
|
|
|
6601
6601
|
data: this.cycles().map(({ '@id': id }) => (values[id] ? propertyValue$1(values[id].value, termId) : 0))
|
|
6602
6602
|
};
|
|
6603
6603
|
}));
|
|
6604
|
-
Chart.register(CategoryScale, LinearScale, BarController, BarElement);
|
|
6604
|
+
Chart.register(CategoryScale, LinearScale, BarController, BarElement, Tooltip);
|
|
6605
6605
|
effect(() => {
|
|
6606
6606
|
this.chart = new Chart(this.chartRef().nativeElement, {
|
|
6607
6607
|
type: 'bar',
|
|
@@ -6615,18 +6615,15 @@ class CyclesResultComponent {
|
|
|
6615
6615
|
maintainAspectRatio: false,
|
|
6616
6616
|
plugins: {
|
|
6617
6617
|
legend: {
|
|
6618
|
-
display:
|
|
6618
|
+
display: false
|
|
6619
6619
|
},
|
|
6620
6620
|
tooltip: {
|
|
6621
6621
|
enabled: true,
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
// return 'test';
|
|
6628
|
-
// }
|
|
6629
|
-
// }
|
|
6622
|
+
callbacks: {
|
|
6623
|
+
title([{ dataIndex }]) {
|
|
6624
|
+
return this.chart.data.labels[dataIndex];
|
|
6625
|
+
}
|
|
6626
|
+
}
|
|
6630
6627
|
}
|
|
6631
6628
|
},
|
|
6632
6629
|
scales: {
|
|
@@ -10249,7 +10246,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
10249
10246
|
borderColor: this.logs().map(listColor)
|
|
10250
10247
|
}
|
|
10251
10248
|
]);
|
|
10252
|
-
Chart.register(CategoryScale, LinearScale, BarController, BarElement
|
|
10249
|
+
Chart.register(CategoryScale, LinearScale, BarController, BarElement);
|
|
10253
10250
|
this.impactAssessment$
|
|
10254
10251
|
.pipe(filter(v => !!v), distinctUntilChangedDeep(), take(1), tap(() => this.loading.set(true)), mergeMap(node => (node ? this.nodeService.getLog({ ...node, dataState: DataState.recalculated }) : of(''))), map(value => (value ? parseLines(value) : [])), mergeAll(), filter(({ data }) => data.logger === 'hestia_earth.models' && data.level === Level.debug), filter(({ data: { message } }) => !!message), map(({ data: { message } }) => parseMessage$1(message)), filter(message => 'node' in message), map(parseLog), filter(log => !!log.impactTermId && !!log.blankNodeTermId && !isNaN(log.value) && log.value > 0), groupBy(log => [log.impactTermId, log.blankNodeTermId, log.modelId].join('/')), mergeMap(group => group.pipe(toArray())), map((values) => {
|
|
10255
10252
|
const log = values[0];
|
|
@@ -10282,12 +10279,16 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
10282
10279
|
labels: [],
|
|
10283
10280
|
datasets: []
|
|
10284
10281
|
},
|
|
10282
|
+
plugins: [ChartDataLabels],
|
|
10285
10283
|
options: {
|
|
10286
10284
|
indexAxis: 'y',
|
|
10287
10285
|
plugins: {
|
|
10288
10286
|
legend: {
|
|
10289
10287
|
display: false
|
|
10290
10288
|
},
|
|
10289
|
+
tooltip: {
|
|
10290
|
+
enabled: false
|
|
10291
|
+
},
|
|
10291
10292
|
datalabels: {
|
|
10292
10293
|
color: 'black',
|
|
10293
10294
|
formatter: value => {
|
|
@@ -10295,9 +10296,6 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
10295
10296
|
return value > 0 ? `${toPrecision(value, 3)} (${ratio}%)` : '';
|
|
10296
10297
|
},
|
|
10297
10298
|
align: 'end'
|
|
10298
|
-
},
|
|
10299
|
-
tooltip: {
|
|
10300
|
-
enabled: false
|
|
10301
10299
|
}
|
|
10302
10300
|
},
|
|
10303
10301
|
responsive: true,
|
|
@@ -10328,7 +10326,6 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
|
|
|
10328
10326
|
});
|
|
10329
10327
|
}
|
|
10330
10328
|
ngOnDestroy() {
|
|
10331
|
-
Chart.unregister(ChartDataLabels);
|
|
10332
10329
|
return this.chart && this.chart.destroy();
|
|
10333
10330
|
}
|
|
10334
10331
|
selectTerm({ target: { value } }) {
|
|
@@ -10374,7 +10371,7 @@ class ImpactAssessmentsIndicatorsChartComponent {
|
|
|
10374
10371
|
borderColor: this.colors()
|
|
10375
10372
|
}
|
|
10376
10373
|
]);
|
|
10377
|
-
Chart.register(CategoryScale, LinearScale, BarController, BarElement
|
|
10374
|
+
Chart.register(CategoryScale, LinearScale, BarController, BarElement);
|
|
10378
10375
|
effect(() => {
|
|
10379
10376
|
this.chart = new Chart(this.chartRef()?.nativeElement, {
|
|
10380
10377
|
type: 'bar',
|
|
@@ -10382,19 +10379,20 @@ class ImpactAssessmentsIndicatorsChartComponent {
|
|
|
10382
10379
|
labels: [],
|
|
10383
10380
|
datasets: []
|
|
10384
10381
|
},
|
|
10382
|
+
plugins: [ChartDataLabels],
|
|
10385
10383
|
options: {
|
|
10386
10384
|
plugins: {
|
|
10387
10385
|
legend: {
|
|
10388
10386
|
display: false
|
|
10389
10387
|
},
|
|
10388
|
+
tooltip: {
|
|
10389
|
+
enabled: false
|
|
10390
|
+
},
|
|
10390
10391
|
datalabels: {
|
|
10391
10392
|
color: 'black',
|
|
10392
10393
|
formatter: value => toPrecision(value, 3),
|
|
10393
10394
|
anchor: 'center',
|
|
10394
10395
|
clamp: true
|
|
10395
|
-
},
|
|
10396
|
-
tooltip: {
|
|
10397
|
-
enabled: false
|
|
10398
10396
|
}
|
|
10399
10397
|
},
|
|
10400
10398
|
responsive: true,
|
|
@@ -10426,7 +10424,6 @@ class ImpactAssessmentsIndicatorsChartComponent {
|
|
|
10426
10424
|
});
|
|
10427
10425
|
}
|
|
10428
10426
|
ngOnDestroy() {
|
|
10429
|
-
Chart.unregister(ChartDataLabels);
|
|
10430
10427
|
return this.chart && this.chart.destroy();
|
|
10431
10428
|
}
|
|
10432
10429
|
selectTerm({ target: { value } }) {
|