@hestia-earth/ui-components 0.32.7 → 0.32.9

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 (32) hide show
  1. package/fesm2022/hestia-earth-ui-components.mjs +9 -8
  2. package/fesm2022/hestia-earth-ui-components.mjs.map +1 -1
  3. package/impact-assessments/impact-assessments-indicator-breakdown-chart/impact-assessments-indicator-breakdown-chart.component.d.ts +1 -0
  4. package/package.json +1 -1
  5. package/svg-icons/icons/archive-20px.svg +8 -0
  6. package/svg-icons/icons/archive-24px.svg +14 -0
  7. package/svg-icons/icons/archive-40px.svg +8 -0
  8. package/svg-icons/icons/archive-48px.svg +8 -0
  9. package/svg-icons/icons/aws-20px.svg +7 -0
  10. package/svg-icons/icons/aws-24px.svg +7 -0
  11. package/svg-icons/icons/aws-40px.svg +7 -0
  12. package/svg-icons/icons/aws-48px.svg +7 -0
  13. package/svg-icons/icons/certificate-20px.svg +6 -0
  14. package/svg-icons/icons/certificate-24px.svg +6 -0
  15. package/svg-icons/icons/certificate-40px.svg +6 -0
  16. package/svg-icons/icons/certificate-48px.svg +6 -0
  17. package/svg-icons/icons/commit-20px.svg +5 -0
  18. package/svg-icons/icons/commit-24px.svg +5 -0
  19. package/svg-icons/icons/commit-40px.svg +5 -0
  20. package/svg-icons/icons/commit-48px.svg +5 -0
  21. package/svg-icons/icons/filter-funnel-16px.svg +3 -0
  22. package/svg-icons/icons/filter-funnel-48px.svg +1 -1
  23. package/svg-icons/icons/incognito-20px.svg +8 -0
  24. package/svg-icons/icons/incognito-24px.svg +8 -0
  25. package/svg-icons/icons/incognito-40px.svg +8 -0
  26. package/svg-icons/icons/incognito-48px.svg +8 -0
  27. package/svg-icons/icons/private-eye-crossed-20px.svg +4 -0
  28. package/svg-icons/icons/private-eye-crossed-24px.svg +4 -0
  29. package/svg-icons/icons/private-eye-crossed-40px.svg +4 -0
  30. package/svg-icons/icons/private-eye-crossed-48px.svg +4 -0
  31. package/svg-icons/icons.d.ts +1 -1
  32. package/svg-icons/icons.json +101 -1
@@ -11183,7 +11183,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
11183
11183
  impacts: this.impacts()
11184
11184
  }),
11185
11185
  loader: ({ request: { impactAssessment, impacts } }) => impactAssessment
11186
- ? this.nodeService.getLog$({ ...impactAssessment, dataState: DataState.recalculated }).pipe(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) => {
11186
+ ? this.nodeService.getLog$({ ...impactAssessment, dataState: DataState.recalculated }).pipe(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)), groupBy(log => [log.impactTermId, log.blankNodeTermId, log.modelId].join('/')), mergeMap(group => group.pipe(toArray())), map((values) => {
11187
11187
  const log = values[0];
11188
11188
  const total = logsTotalValue(values, true);
11189
11189
  const blankNodes = [
@@ -11211,6 +11211,7 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
11211
11211
  this.logs = computed(() => (this.logsResource.value() ?? [])
11212
11212
  .filter(({ impactTermId, modelId }) => impactTermId === this.selectedTermId() && (!this.selectedMethodId() || modelId === this.selectedMethodId()))
11213
11213
  .sort((a, b) => b.value - a.value));
11214
+ this.nonZeroLogs = computed(() => this.logs().filter(log => log.value !== 0));
11214
11215
  this.emissions = toSignal(this.searchService
11215
11216
  .search$({
11216
11217
  fields: ['@type', '@id', 'name'],
@@ -11240,20 +11241,20 @@ class ImpactAssessmentsIndicatorBreakdownChartComponent {
11240
11241
  ...(this.impactAssessment()?.impacts || []),
11241
11242
  ...(this.impactAssessment()?.endpoints || [])
11242
11243
  ]);
11243
- this.noData = computed(() => this.logs()?.length === 0);
11244
- this.hasNegativeContributions = computed(() => this.logs()?.some(log => log.value < 0));
11244
+ this.noData = computed(() => this.nonZeroLogs()?.length === 0);
11245
+ this.hasNegativeContributions = computed(() => this.nonZeroLogs()?.some(log => log.value < 0));
11245
11246
  this.csvContent = computed(() => this.domSanitizer.bypassSecurityTrustResourceUrl(`data:text/html;charset=utf-8,${encodeURIComponent(logToCsv(this.logs(), this.impactAssessment()))}`));
11246
11247
  this.id = computed(() => this.impactAssessment()?.['@id'] || this.impactAssessment()?.id);
11247
11248
  this.downloadFilename = computed(() => `${this.id()}-logs.csv`);
11248
- this.total = computed(() => logsTotalValue(this.logs(), false));
11249
- this.labels = computed(() => this.logs().map(({ blankNodeTermId }) => this.emissions()?.find(v => v['@id'] === blankNodeTermId)?.name || blankNodeTermId));
11249
+ this.total = computed(() => logsTotalValue(this.nonZeroLogs(), false));
11250
+ this.labels = computed(() => this.nonZeroLogs().map(({ blankNodeTermId }) => this.emissions()?.find(v => v['@id'] === blankNodeTermId)?.name || blankNodeTermId));
11250
11251
  this.datasets = computed(() => [
11251
11252
  {
11252
11253
  label: this.selectedTerm()?.name ?? '',
11253
11254
  // do not show negative values in the chart
11254
- data: this.logs().map(({ value }) => Math.max(0, value)),
11255
- backgroundColor: this.logs().map(listColor),
11256
- borderColor: this.logs().map(listColor)
11255
+ data: this.nonZeroLogs().map(({ value }) => Math.max(0, value)),
11256
+ backgroundColor: this.nonZeroLogs().map(listColor),
11257
+ borderColor: this.nonZeroLogs().map(listColor)
11257
11258
  }
11258
11259
  ]);
11259
11260
  this.chartData = computed(() => ({