@hestia-earth/ui-components 0.9.4 → 0.9.5
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/engine/aggregation-engine.service.d.ts +1 -23
- package/esm2020/engine/aggregation-engine.service.mjs +2 -28
- package/esm2020/files/files-form.model.mjs +2 -2
- package/fesm2015/hestia-earth-ui-components.mjs +2 -29
- package/fesm2015/hestia-earth-ui-components.mjs.map +1 -1
- package/fesm2020/hestia-earth-ui-components.mjs +2 -27
- package/fesm2020/hestia-earth-ui-components.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -19,12 +19,11 @@ import { getColor } from 'random-material-color';
|
|
|
19
19
|
import { SchemaType, isExpandable, TermTermType, EmissionMethodTier, NodeType, productTermTermType, nestedSearchableKeys, SCHEMA_VERSION, sortKeysByType, isTypeNode, CycleFunctionalUnit, SiteSiteType, isTypeValid, typeToSchemaType } from '@hestia-earth/schema';
|
|
20
20
|
import { fileToExt, nodeTypeToParam, DataState, SupportedExtensions } from '@hestia-earth/api';
|
|
21
21
|
import * as i1$1 from '@angular/platform-browser';
|
|
22
|
-
import { ReplaySubject, of,
|
|
22
|
+
import { ReplaySubject, of, zip, from } from 'rxjs';
|
|
23
23
|
import { keyToLabel, isUndefined, isNumber, toPrecision, toDashCase, isBoolean, ConvertUnits, converters, convertValue, isEmpty, isEqual as isEqual$1, unique, diffInDays } from '@hestia-earth/utils';
|
|
24
24
|
import { propertyValue as propertyValue$1, emptyValue } from '@hestia-earth/utils/dist/term';
|
|
25
25
|
import { getDefaultModelId } from '@hestia-earth/glossary';
|
|
26
26
|
import { catchError, map, take, mergeAll, filter, toArray, mergeMap, debounceTime, distinctUntilChanged, tap, switchMap, reduce, distinct, groupBy } from 'rxjs/operators';
|
|
27
|
-
import * as csvtojson from 'csvtojson';
|
|
28
27
|
import * as i1$2 from '@angular/common/http';
|
|
29
28
|
import { DeltaDisplayType, delta, customDeltaFuncs } from '@hestia-earth/utils/dist/delta';
|
|
30
29
|
import orderBy from 'lodash.orderby';
|
|
@@ -40,7 +39,7 @@ import set from 'lodash.set';
|
|
|
40
39
|
import { Chart } from 'chart.js';
|
|
41
40
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
|
42
41
|
import * as semver from 'semver';
|
|
43
|
-
import
|
|
42
|
+
import moment from 'moment';
|
|
44
43
|
import 'moment/locale/en-gb';
|
|
45
44
|
import { v4 } from 'uuid';
|
|
46
45
|
import MarkerClusterer from '@googlemaps/markerclustererplus';
|
|
@@ -1403,9 +1402,6 @@ class HeAggregationEngineService {
|
|
|
1403
1402
|
this.modelsLoading = false;
|
|
1404
1403
|
this.modelsLoaded = false;
|
|
1405
1404
|
this._models = new ReplaySubject(1);
|
|
1406
|
-
this.lookupsLoading = false;
|
|
1407
|
-
this.lookupsLoaded = false;
|
|
1408
|
-
this._lookups = new ReplaySubject(1);
|
|
1409
1405
|
this.init();
|
|
1410
1406
|
}
|
|
1411
1407
|
async init() {
|
|
@@ -1436,27 +1432,6 @@ class HeAggregationEngineService {
|
|
|
1436
1432
|
model(model) {
|
|
1437
1433
|
return this.model$(model).pipe(take(1)).toPromise();
|
|
1438
1434
|
}
|
|
1439
|
-
async loadLookup(filename) {
|
|
1440
|
-
const data = await this.nodeService.downloadLookup(filename);
|
|
1441
|
-
return csvtojson({ delimiter: 'auto' }).fromString(data);
|
|
1442
|
-
}
|
|
1443
|
-
loadLookups() {
|
|
1444
|
-
return forkJoin({
|
|
1445
|
-
cropYield: from(this.loadLookup(lookups.cropYield)),
|
|
1446
|
-
crop: from(this.loadLookup(TermTermType.crop))
|
|
1447
|
-
}).pipe(map(values => {
|
|
1448
|
-
this._lookups.next(values);
|
|
1449
|
-
this.lookupsLoading = false;
|
|
1450
|
-
this.lookupsLoaded = true;
|
|
1451
|
-
return values;
|
|
1452
|
-
}));
|
|
1453
|
-
}
|
|
1454
|
-
get lookups$() {
|
|
1455
|
-
return this.lookupsLoading || this.lookupsLoaded ? this._lookups.asObservable() : this.loadLookups();
|
|
1456
|
-
}
|
|
1457
|
-
lookups() {
|
|
1458
|
-
return this.lookups$.pipe(take(1)).toPromise();
|
|
1459
|
-
}
|
|
1460
1435
|
}
|
|
1461
1436
|
HeAggregationEngineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: HeAggregationEngineService, deps: [{ token: i1$2.HttpClient }, { token: HeNodeService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1462
1437
|
HeAggregationEngineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: HeAggregationEngineService, providedIn: 'root' });
|