@provoly/dashboard 1.3.7 → 1.3.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.
- package/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.d.ts +5 -2
- package/admin/components/admin-fields/admin-fields-form/admin-fields-form.component.d.ts +47 -18
- package/admin/components/admin-fields/admin-fields-select/admin-fields-select.component.d.ts +6 -2
- package/admin/components/admin-fields/admin-fields.component.d.ts +4 -1
- package/admin/components/admin-fields/store/admin-fields.model.d.ts +1 -1
- package/admin/components/admin-fields/store/fields.actions.d.ts +19 -12
- package/admin/components/admin-fields/store/fields.effects.d.ts +16 -3
- package/admin/i18n/en.translations.d.ts +33 -14
- package/admin/i18n/fr.translations.d.ts +33 -14
- package/components/checkbox/checkbox.component.d.ts +4 -2
- package/components/data-format/data-format.pipe.d.ts +11 -1
- package/components/paginator/index.d.ts +5 -0
- package/components/paginator/paginator.component.d.ts +19 -0
- package/components/paginator/paginator.module.d.ts +10 -0
- package/components/paginator/public-api.d.ts +3 -0
- package/components/paginator/style/_o-pry-paginator.scss +11 -0
- package/components/paginator/style/css.component.d.ts +5 -0
- package/dataset/components/dataset-detail/dataset-detail.component.d.ts +5 -8
- package/dataset/dataset.module.d.ts +1 -1
- package/dataset/i18n/en.translations.d.ts +0 -12
- package/dataset/i18n/fr.translations.d.ts +0 -12
- package/esm2022/admin/components/admin-abac-rules/components/attribute-condition/attribute-condition.component.mjs +4 -6
- package/esm2022/admin/components/admin-classes/admin-classes-customize/symbol/admin-classes-customize-symbol.component.mjs +1 -1
- package/esm2022/admin/components/admin-classes/admin-classes-customize/tooltip/admin-classes-customize-tooltip.component.mjs +1 -1
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-form/admin-attributes-form.component.mjs +10 -12
- package/esm2022/admin/components/admin-classes/admin-classes-view/admin-classes-view.component.mjs +6 -5
- package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +2 -2
- package/esm2022/admin/components/admin-fields/admin-fields-form/admin-fields-form.component.mjs +142 -63
- package/esm2022/admin/components/admin-fields/admin-fields-select/admin-fields-select.component.mjs +7 -8
- package/esm2022/admin/components/admin-fields/admin-fields.component.mjs +15 -11
- package/esm2022/admin/components/admin-fields/store/admin-fields.model.mjs +1 -1
- package/esm2022/admin/components/admin-fields/store/fields.actions.mjs +6 -5
- package/esm2022/admin/components/admin-fields/store/fields.effects.mjs +12 -6
- package/esm2022/admin/i18n/en.translations.mjs +34 -15
- package/esm2022/admin/i18n/fr.translations.mjs +34 -15
- package/esm2022/components/checkbox/checkbox.component.mjs +15 -7
- package/esm2022/components/data-format/data-format.pipe.mjs +88 -7
- package/esm2022/components/paginator/paginator.component.mjs +51 -0
- package/esm2022/components/paginator/paginator.module.mjs +20 -0
- package/esm2022/components/paginator/provoly-dashboard-components-paginator.mjs +5 -0
- package/esm2022/components/paginator/public-api.mjs +4 -0
- package/esm2022/components/paginator/style/css.component.mjs +11 -0
- package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +16 -26
- package/esm2022/dataset/dataset.module.mjs +2 -5
- package/esm2022/dataset/i18n/en.translations.mjs +1 -13
- package/esm2022/dataset/i18n/fr.translations.mjs +2 -14
- package/esm2022/import/components/form/import-form.component.mjs +174 -0
- package/esm2022/import/components/list/import-list.component.mjs +73 -0
- package/esm2022/import/components/version-modal/version-modal.component.mjs +26 -0
- package/esm2022/import/i18n/en.translations.mjs +16 -2
- package/esm2022/import/i18n/fr.translations.mjs +16 -2
- package/esm2022/import/import-routing.module.mjs +3 -3
- package/esm2022/import/import.module.mjs +25 -10
- package/esm2022/import/public-api.mjs +4 -2
- package/esm2022/import/style/css.component.mjs +2 -2
- package/esm2022/lib/core/components/select/select.component.mjs +3 -3
- package/esm2022/lib/core/components/share/legacy-share/share.component.mjs +8 -8
- package/esm2022/lib/core/components/status-modal/status-modal.component.mjs +48 -0
- package/esm2022/lib/core/components/{modal-status/modal-status.module.mjs → status-modal/status-modal.module.mjs} +9 -9
- package/esm2022/lib/core/core.module.mjs +5 -5
- package/esm2022/lib/core/i18n/en.translations.mjs +39 -6
- package/esm2022/lib/core/i18n/fr.translations.mjs +41 -6
- package/esm2022/lib/core/model/admin-api.model.mjs +5 -69
- package/esm2022/lib/core/model/widget-analytic-manifest.interface.mjs +1 -1
- package/esm2022/lib/core/model/widget-table-manifest.interface.mjs +1 -1
- package/esm2022/lib/core/public-api.mjs +3 -3
- package/esm2022/lib/core/store/class/class.interface.mjs +1 -1
- package/esm2022/lib/core/store/class/class.selectors.mjs +2 -2
- package/esm2022/lib/core/store/data-source/data-source.actions.mjs +3 -3
- package/esm2022/lib/core/store/data-source/data-source.effects.mjs +7 -4
- package/esm2022/lib/core/store/data-source/data-source.model.mjs +1 -1
- package/esm2022/lib/core/store/data-source/data-source.reducer.mjs +5 -3
- package/esm2022/lib/core/store/data-source/data-source.selectors.mjs +3 -11
- package/esm2022/lib/core/store/data-source/data-source.service.mjs +23 -5
- package/esm2022/lib/core/store/field/field.interface.mjs +1 -3
- package/esm2022/lib/core/store/field/field.service.mjs +7 -2
- package/esm2022/lib/dashboard/components/context-menu/object-edition/object-edition.component.mjs +3 -3
- package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-card/datasource-card.component.mjs +3 -11
- package/esm2022/lib/dashboard/components/widgets/datasource-selector/datasource-list/datasource-list.component.mjs +2 -2
- package/esm2022/lib/dashboard/item-utils.mjs +5 -5
- package/esm2022/lib/dashboard/store/dashboard.actions.mjs +1 -4
- package/esm2022/lib/dashboard/store/dashboard.effects.mjs +1 -19
- package/esm2022/lib/dashboard/store/dashboard.reducers.mjs +1 -26
- package/esm2022/lib/dashboard/tooltip/components/default/default.tooltip.component.mjs +3 -3
- package/esm2022/lib/dashboard/tooltip/tooltip-factory.service.mjs +3 -2
- package/esm2022/search/search-mono-class/components/search-condition/search-condition.component.mjs +4 -4
- package/esm2022/search/search-mono-class/components/search-order/search-order.component.mjs +3 -3
- package/esm2022/search/search-mono-class/components/search-select-attribute/search-select-attribute.component.mjs +4 -5
- package/esm2022/search/search-mono-class/store/search-mono-class.effects.mjs +2 -2
- package/esm2022/search/search-mono-class/store/search-mono-class.service.mjs +5 -6
- package/esm2022/search/search-multi-class/store/search-multi-class.service.mjs +4 -4
- package/esm2022/toolbox/components/filter-settings/filter-settings.component.mjs +3 -3
- package/esm2022/toolbox/components/save-view/save-view.component.mjs +3 -3
- package/esm2022/tooltips/attribute/attribute-tooltip.component.mjs +17 -19
- package/esm2022/tooltips/attribute/attribute-tooltip.module.mjs +5 -4
- package/esm2022/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.mjs +54 -37
- package/esm2022/widgets/widget-analytic/component/widget-analytic.component.mjs +4 -16
- package/esm2022/widgets/widget-chart/component/widget-chart.component.mjs +9 -9
- package/esm2022/widgets/widget-detail/component/widget-detail.component.mjs +5 -5
- package/esm2022/widgets/widget-map/component/widget-map.component.mjs +30 -32
- package/esm2022/widgets/widget-map/pipe/widget-map-geometry-fields-for.pipe.mjs +2 -5
- package/esm2022/widgets/widget-map/utils/cql-utils.class.mjs +2 -2
- package/esm2022/widgets/widget-map/utils/widget-map.utils.mjs +6 -10
- package/esm2022/widgets/widget-table/component/widget-table.component.mjs +18 -14
- package/esm2022/widgets/widget-table/expand-value/expand-value.component.mjs +9 -5
- package/esm2022/widgets/widget-table/get-value/get-value.pipe.mjs +2 -2
- package/esm2022/widgets/widget-table/public-api.mjs +1 -2
- package/esm2022/widgets/widget-table/widget-table.module.mjs +12 -7
- package/esm2022/widgets/widget-tile/component/widget-tile.component.mjs +10 -15
- package/esm2022/widgets/widget-tile/widget-tile.module.mjs +8 -4
- package/esm2022/widgets/widget-vega/component/widget-vega.component.mjs +2 -2
- package/fesm2022/provoly-dashboard-admin.mjs +249 -126
- package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-checkbox.mjs +14 -6
- package/fesm2022/provoly-dashboard-components-checkbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-data-format.mjs +88 -7
- package/fesm2022/provoly-dashboard-components-data-format.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-components-paginator.mjs +82 -0
- package/fesm2022/provoly-dashboard-components-paginator.mjs.map +1 -0
- package/fesm2022/provoly-dashboard-dataset.mjs +21 -58
- package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-import.mjs +249 -116
- package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-search.mjs +15 -16
- package/fesm2022/provoly-dashboard-search.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-toolbox.mjs +4 -4
- package/fesm2022/provoly-dashboard-toolbox.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-tooltips-attribute.mjs +20 -21
- package/fesm2022/provoly-dashboard-tooltips-attribute.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs +53 -36
- package/fesm2022/provoly-dashboard-widgets-widget-aggregated-chart.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs +3 -15
- package/fesm2022/provoly-dashboard-widgets-widget-analytic.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs +9 -9
- package/fesm2022/provoly-dashboard-widgets-widget-chart.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs +4 -4
- package/fesm2022/provoly-dashboard-widgets-widget-detail.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +36 -45
- package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-table.mjs +32 -38
- package/fesm2022/provoly-dashboard-widgets-widget-table.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs +16 -17
- package/fesm2022/provoly-dashboard-widgets-widget-tile.mjs.map +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs +1 -1
- package/fesm2022/provoly-dashboard-widgets-widget-vega.mjs.map +1 -1
- package/fesm2022/provoly-dashboard.mjs +286 -338
- package/fesm2022/provoly-dashboard.mjs.map +1 -1
- package/import/components/{import.component.d.ts → form/import-form.component.d.ts} +8 -4
- package/import/components/list/import-list.component.d.ts +34 -0
- package/import/components/version-modal/version-modal.component.d.ts +13 -0
- package/import/i18n/en.translations.d.ts +14 -0
- package/import/i18n/fr.translations.d.ts +14 -0
- package/import/import.module.d.ts +13 -10
- package/import/public-api.d.ts +3 -1
- package/import/style/_o-import.scss +50 -6
- package/lib/core/components/share/legacy-share/share.component.d.ts +1 -1
- package/lib/core/components/{modal-status/modal-status.component.d.ts → status-modal/status-modal.component.d.ts} +10 -6
- package/lib/core/components/{modal-status/modal-status.module.d.ts → status-modal/status-modal.module.d.ts} +5 -5
- package/lib/core/core.module.d.ts +2 -2
- package/lib/core/i18n/en.translations.d.ts +33 -0
- package/lib/core/i18n/fr.translations.d.ts +35 -0
- package/lib/core/model/admin-api.model.d.ts +6 -8
- package/lib/core/model/widget-analytic-manifest.interface.d.ts +0 -3
- package/lib/core/model/widget-table-manifest.interface.d.ts +2 -0
- package/lib/core/public-api.d.ts +2 -2
- package/lib/core/store/class/class.interface.d.ts +2 -1
- package/lib/core/store/class/class.selectors.d.ts +10 -10
- package/lib/core/store/data-source/data-source.actions.d.ts +21 -1
- package/lib/core/store/data-source/data-source.effects.d.ts +11 -1
- package/lib/core/store/data-source/data-source.model.d.ts +3 -2
- package/lib/core/store/data-source/data-source.reducer.d.ts +1 -0
- package/lib/core/store/data-source/data-source.selectors.d.ts +3 -3
- package/lib/core/store/data-source/data-source.service.d.ts +11 -2
- package/lib/core/store/field/field.interface.d.ts +8 -4
- package/lib/core/store/field/field.service.d.ts +1 -0
- package/lib/dashboard/components/context-menu/object-edition/object-edition.component.d.ts +1 -1
- package/lib/dashboard/components/widgets/datasource-selector/datasource-card/datasource-card.component.d.ts +3 -7
- package/lib/dashboard/item-utils.d.ts +1 -1
- package/lib/dashboard/store/dashboard.actions.d.ts +0 -11
- package/lib/dashboard/store/dashboard.effects.d.ts +0 -3
- package/lib/dashboard/tooltip/tooltip-factory.service.d.ts +2 -1
- package/package.json +18 -12
- package/styles/base/_utils.scss +9 -1
- package/styles/components/_a-btn.scss +7 -0
- package/styles/components/_a-table.scss +2 -16
- package/styles/layout/_o-workspace.scss +1 -0
- package/tooltips/attribute/attribute-tooltip.component.d.ts +6 -6
- package/tooltips/attribute/attribute-tooltip.module.d.ts +2 -1
- package/widgets/widget-aggregated-chart/component/widget-aggregated-chart.component.d.ts +16 -3
- package/widgets/widget-analytic/component/widget-analytic.component.d.ts +2 -3
- package/widgets/widget-detail/component/widget-detail.component.d.ts +1 -4
- package/widgets/widget-table/component/widget-table.component.d.ts +1 -0
- package/widgets/widget-table/expand-value/expand-value.component.d.ts +4 -2
- package/widgets/widget-table/public-api.d.ts +0 -1
- package/widgets/widget-table/widget-table.module.d.ts +9 -8
- package/widgets/widget-tile/component/widget-tile.component.d.ts +1 -0
- package/widgets/widget-tile/widget-tile.module.d.ts +2 -1
- package/esm2022/import/components/import.component.mjs +0 -167
- package/esm2022/lib/core/components/modal-status/modal-status.component.mjs +0 -45
- package/esm2022/widgets/widget-table/expand-value/format-number.pipe.mjs +0 -24
- package/widgets/widget-table/expand-value/format-number.pipe.d.ts +0 -10
|
@@ -6,8 +6,11 @@ import { Component, NgModule } from '@angular/core';
|
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i1 from '@provoly/dashboard';
|
|
8
8
|
import { BaseTooltipComponent, ClassSelectors, BaseTooltipModule, PryCoreModule } from '@provoly/dashboard';
|
|
9
|
-
import { map,
|
|
9
|
+
import { map, of } from 'rxjs';
|
|
10
|
+
import { withLatestFrom } from 'rxjs/operators';
|
|
10
11
|
import * as i2 from '@ngrx/store';
|
|
12
|
+
import * as i4 from '@provoly/dashboard/components/data-format';
|
|
13
|
+
import { PryDataFormatModule } from '@provoly/dashboard/components/data-format';
|
|
11
14
|
|
|
12
15
|
class AttributeTooltipComponent extends BaseTooltipComponent {
|
|
13
16
|
constructor(translateIdPipe, store) {
|
|
@@ -15,27 +18,22 @@ class AttributeTooltipComponent extends BaseTooltipComponent {
|
|
|
15
18
|
this.translateIdPipe = translateIdPipe;
|
|
16
19
|
this.store = store;
|
|
17
20
|
this.context = this.context ?? { attributes: [] };
|
|
18
|
-
this.classes$ = this.store.select(ClassSelectors.classes);
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return this.classes$.pipe(map((classes) => classes
|
|
28
|
-
.map((clazz) => clazz.attributes)
|
|
29
|
-
.flat()
|
|
30
|
-
.find((attr) => attr.id === attribute)?.technicalName ?? attribute));
|
|
22
|
+
ngOnInit() {
|
|
23
|
+
this.attributes$ = this.store.select(ClassSelectors.classes).pipe(map((classes) => {
|
|
24
|
+
return classes
|
|
25
|
+
.map((c) => c.attributes)
|
|
26
|
+
.flat()
|
|
27
|
+
.filter((attr) => this.context.attributes.includes(attr.id));
|
|
28
|
+
}));
|
|
31
29
|
}
|
|
32
|
-
getValue(
|
|
33
|
-
return this.
|
|
30
|
+
getValue(attrTechnicalName, limit = 9999) {
|
|
31
|
+
return this._getValue(attrTechnicalName).pipe(withLatestFrom(this.attributes$), map(([value, attributes]) => {
|
|
32
|
+
const field = attributes.find((attr) => attr.technicalName === attrTechnicalName)?.field;
|
|
34
33
|
switch (typeof value) {
|
|
35
34
|
case 'undefined':
|
|
36
35
|
return '';
|
|
37
36
|
case 'number':
|
|
38
|
-
return value.toString();
|
|
39
37
|
case 'string':
|
|
40
38
|
return value;
|
|
41
39
|
default:
|
|
@@ -44,6 +42,7 @@ class AttributeTooltipComponent extends BaseTooltipComponent {
|
|
|
44
42
|
}
|
|
45
43
|
}));
|
|
46
44
|
}
|
|
45
|
+
// attribute: 'id' | 'oClass' | attributeTechnicalName
|
|
47
46
|
_getValue(attribute) {
|
|
48
47
|
if (!this.data.item.properties) {
|
|
49
48
|
// This is for Provoly-like items
|
|
@@ -65,11 +64,11 @@ class AttributeTooltipComponent extends BaseTooltipComponent {
|
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AttributeTooltipComponent, deps: [{ token: i1.TranslateIdPipe }, { token: i2.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
68
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AttributeTooltipComponent, selector: "pry-attribute-tooltip", usesInheritance: true, ngImport: i0, template: "<div class=\"m-tooltip__item__content\">\n <h3 class=\"a-h3 -attribute\">\n <img\n [src]=\"data.item | translateItemToSymbol | async\"\n [alt]=\"data.item.oClass | translateId
|
|
67
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AttributeTooltipComponent, selector: "pry-attribute-tooltip", usesInheritance: true, ngImport: i0, template: "<div class=\"m-tooltip__item__content\">\n <h3 class=\"a-h3 -attribute\">\n <img\n [src]=\"data.item | translateItemToSymbol | async\"\n [alt]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n width=\"32\"\n aria-hidden=\"true\"\n />\n <span [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\">{{\n data.item.oClass | translateId: { type: 'class', output: 'name' } | async\n }}</span>\n </h3>\n <ng-container *ngFor=\"let attribute of attributes$ | async\">\n <p [title]=\"getValue(attribute.technicalName) | async | dataFormat: attribute.field\">\n <span>{{ attribute.name }}:</span>\n {{ getValue(attribute.technicalName, 40) | async | dataFormat: attribute.field }}\n </p>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslateIdPipe, name: "translateId" }, { kind: "pipe", type: i1.TranslateItemToSymbolPipe, name: "translateItemToSymbol" }, { kind: "pipe", type: i4.DataFormatPipe, name: "dataFormat" }] }); }
|
|
69
68
|
}
|
|
70
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AttributeTooltipComponent, decorators: [{
|
|
71
70
|
type: Component,
|
|
72
|
-
args: [{ selector: 'pry-attribute-tooltip', template: "<div class=\"m-tooltip__item__content\">\n <h3 class=\"a-h3 -attribute\">\n <img\n [src]=\"data.item | translateItemToSymbol | async\"\n [alt]=\"data.item.oClass | translateId
|
|
71
|
+
args: [{ selector: 'pry-attribute-tooltip', template: "<div class=\"m-tooltip__item__content\">\n <h3 class=\"a-h3 -attribute\">\n <img\n [src]=\"data.item | translateItemToSymbol | async\"\n [alt]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n width=\"32\"\n aria-hidden=\"true\"\n />\n <span [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\">{{\n data.item.oClass | translateId: { type: 'class', output: 'name' } | async\n }}</span>\n </h3>\n <ng-container *ngFor=\"let attribute of attributes$ | async\">\n <p [title]=\"getValue(attribute.technicalName) | async | dataFormat: attribute.field\">\n <span>{{ attribute.name }}:</span>\n {{ getValue(attribute.technicalName, 40) | async | dataFormat: attribute.field }}\n </p>\n </ng-container>\n</div>\n" }]
|
|
73
72
|
}], ctorParameters: () => [{ type: i1.TranslateIdPipe }, { type: i2.Store }] });
|
|
74
73
|
|
|
75
74
|
class PryAttributeTooltipModule extends BaseTooltipModule {
|
|
@@ -77,14 +76,14 @@ class PryAttributeTooltipModule extends BaseTooltipModule {
|
|
|
77
76
|
return AttributeTooltipComponent;
|
|
78
77
|
}
|
|
79
78
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, deps: null, target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
80
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, declarations: [AttributeTooltipComponent], imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule], exports: [AttributeTooltipComponent] }); }
|
|
81
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule] }); }
|
|
79
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, declarations: [AttributeTooltipComponent], imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule, PryDataFormatModule], exports: [AttributeTooltipComponent] }); }
|
|
80
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule, PryDataFormatModule] }); }
|
|
82
81
|
}
|
|
83
82
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: PryAttributeTooltipModule, decorators: [{
|
|
84
83
|
type: NgModule,
|
|
85
84
|
args: [{
|
|
86
85
|
declarations: [AttributeTooltipComponent],
|
|
87
|
-
imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule],
|
|
86
|
+
imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule, PryDataFormatModule],
|
|
88
87
|
exports: [AttributeTooltipComponent]
|
|
89
88
|
}]
|
|
90
89
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provoly-dashboard-tooltips-attribute.mjs","sources":["../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.component.ts","../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.component.html","../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.module.ts","../../../../projects/provoly/dashboard/tooltips/attribute/provoly-dashboard-tooltips-attribute.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"provoly-dashboard-tooltips-attribute.mjs","sources":["../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.component.ts","../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.component.html","../../../../projects/provoly/dashboard/tooltips/attribute/attribute-tooltip.module.ts","../../../../projects/provoly/dashboard/tooltips/attribute/provoly-dashboard-tooltips-attribute.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { Attribute, BaseTooltipComponent, ClassSelectors, Field, TranslateIdPipe } from '@provoly/dashboard';\nimport { map, Observable, of } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport { withLatestFrom } from 'rxjs/operators';\n\n@Component({\n selector: 'pry-attribute-tooltip',\n templateUrl: './attribute-tooltip.component.html'\n})\nexport class AttributeTooltipComponent extends BaseTooltipComponent implements OnInit {\n protected attributes$!: Observable<Attribute[]>;\n\n constructor(\n private translateIdPipe: TranslateIdPipe,\n private store: Store<any>\n ) {\n super();\n this.context = this.context ?? { attributes: [] };\n }\n\n ngOnInit() {\n this.attributes$ = this.store.select(ClassSelectors.classes).pipe(\n map((classes) => {\n return classes\n .map((c) => c.attributes)\n .flat()\n .filter((attr) => this.context.attributes.includes(attr.id));\n })\n );\n }\n\n getValue(attrTechnicalName: string, limit = 9999): Observable<string | number> {\n return this._getValue(attrTechnicalName).pipe(\n withLatestFrom(this.attributes$),\n map(([value, attributes]) => {\n const field = attributes.find((attr) => attr.technicalName === attrTechnicalName)?.field;\n switch (typeof value) {\n case 'undefined':\n return '';\n case 'number':\n case 'string':\n return value;\n default:\n const result = JSON.stringify(value);\n return result.length > limit ? `${result.substring(0, limit)}...` : result;\n }\n })\n );\n }\n\n // attribute: 'id' | 'oClass' | attributeTechnicalName\n _getValue(attribute: string): Observable<string | undefined | number> {\n if (!this.data.item.properties) {\n // This is for Provoly-like items\n switch (attribute) {\n case 'id':\n return of(this.data.item[attribute]);\n case 'oClass':\n return this.translateIdPipe.transform(this.data.item[attribute], {\n type: 'class',\n output: 'name'\n }) as Observable<string>;\n default:\n return of(this.data.item.attributes[attribute]?.value);\n }\n } else {\n // This is for other items, like WMSFeatures\n return of(\n this.data.item.properties.find((prop: { key: string; value: string }) => prop.key === attribute)?.value\n );\n }\n }\n}\n","<div class=\"m-tooltip__item__content\">\n <h3 class=\"a-h3 -attribute\">\n <img\n [src]=\"data.item | translateItemToSymbol | async\"\n [alt]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\"\n width=\"32\"\n aria-hidden=\"true\"\n />\n <span [title]=\"data.item.oClass | translateId: { type: 'class', output: 'name' } | async\">{{\n data.item.oClass | translateId: { type: 'class', output: 'name' } | async\n }}</span>\n </h3>\n <ng-container *ngFor=\"let attribute of attributes$ | async\">\n <p [title]=\"getValue(attribute.technicalName) | async | dataFormat: attribute.field\">\n <span>{{ attribute.name }}:</span>\n {{ getValue(attribute.technicalName, 40) | async | dataFormat: attribute.field }}\n </p>\n </ng-container>\n</div>\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule, Type } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { BaseTooltipComponent, BaseTooltipModule, PryCoreModule } from '@provoly/dashboard';\nimport { AttributeTooltipComponent } from './attribute-tooltip.component';\nimport { PryDataFormatModule } from '@provoly/dashboard/components/data-format';\n\n@NgModule({\n declarations: [AttributeTooltipComponent],\n imports: [CommonModule, FormsModule, OverlayModule, PryCoreModule, PryDataFormatModule],\n exports: [AttributeTooltipComponent]\n})\nexport class PryAttributeTooltipModule extends BaseTooltipModule {\n override getComponent() {\n return AttributeTooltipComponent as Type<BaseTooltipComponent>;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"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"}
|
|
@@ -13,6 +13,7 @@ import { BehaviorSubject, Subject, map, filter, combineLatest, fromEvent, startW
|
|
|
13
13
|
import embed, { vega } from 'vega-embed';
|
|
14
14
|
import { mergeDeep } from 'vega-lite';
|
|
15
15
|
import { initConfig } from 'vega-lite/build/src/config';
|
|
16
|
+
import { toD3Format } from '@provoly/dashboard/components/data-format';
|
|
16
17
|
import * as i1 from '@ngrx/store';
|
|
17
18
|
import * as i3 from '@provoly/dashboard/components/scheme-picker';
|
|
18
19
|
import { PrySchemePickerModule } from '@provoly/dashboard/components/scheme-picker';
|
|
@@ -68,15 +69,17 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
68
69
|
});
|
|
69
70
|
this.fields$ = this.store.select(FieldSelectors.fields);
|
|
70
71
|
this.classes$ = this.store.select(ClassSelectors.classes);
|
|
72
|
+
const usedAttributes$ = combineLatest([this.usedDatasources$, this.classes$]).pipe(map(([datasources, classes]) => {
|
|
73
|
+
const usedClasses = datasources
|
|
74
|
+
.filter((ds) => ds.sourceType === 'dataset')
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
.map((ds) => ds.oClass);
|
|
77
|
+
return this.classes.filter((c) => usedClasses.includes(c.id));
|
|
78
|
+
}));
|
|
71
79
|
this.operations$ = combineLatest([this.usedDatasources$, this.classes$, this.fields$]).pipe(map(([datasources, classes, fields]) => classes
|
|
72
80
|
.filter((clazz) => datasources.map((ds) => ('oClass' in ds ? ds.oClass : undefined)).includes(clazz.id))
|
|
73
81
|
.map((clazz) => clazz.attributes)
|
|
74
|
-
.map((attrs) => attrs.filter((attr) =>
|
|
75
|
-
const field = fields.find((field) => {
|
|
76
|
-
return field.id === attr.field;
|
|
77
|
-
});
|
|
78
|
-
return !!field && [FieldType.INTEGER, FieldType.DECIMAL, FieldType.LONG].includes(field.type);
|
|
79
|
-
}))
|
|
82
|
+
.map((attrs) => attrs.filter((attr) => [FieldType.INTEGER, FieldType.DECIMAL, FieldType.LONG].includes(attr.field.type)))
|
|
80
83
|
.reduce((a, b) => [...a, ...b], [])
|
|
81
84
|
.filter((attr) => !!attr)), map((attributes) => (attributes.length > 0
|
|
82
85
|
? Object.values(Operation).filter((operation) => operation !== Operation.EXTENT)
|
|
@@ -108,7 +111,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
108
111
|
.map((clazz) => clazz.attributes)
|
|
109
112
|
.map((attrs) => attrs.filter((attr) => {
|
|
110
113
|
const field = fields.find((field) => {
|
|
111
|
-
return field.id === attr.field;
|
|
114
|
+
return field.id === attr.field.id;
|
|
112
115
|
});
|
|
113
116
|
return (!!field &&
|
|
114
117
|
field.type !== FieldType.RAW &&
|
|
@@ -124,7 +127,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
124
127
|
.map((clazz) => clazz.attributes)
|
|
125
128
|
.map((attrs) => attrs.filter((attr) => {
|
|
126
129
|
const field = fields.find((field) => {
|
|
127
|
-
return field.id === attr.field;
|
|
130
|
+
return field.id === attr.field.id;
|
|
128
131
|
});
|
|
129
132
|
if (this.optionsCopy$.value &&
|
|
130
133
|
[
|
|
@@ -160,25 +163,22 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
160
163
|
const groupBy = classes
|
|
161
164
|
.map((clazz) => clazz.attributes.find((attr) => attr.id === options?.groupBy?.attribute))
|
|
162
165
|
.find((attr) => !!attr);
|
|
163
|
-
const abscissaFieldType = fields.find((field) => field.id === abscissa?.field)?.type ?? FieldType.STRING;
|
|
164
|
-
const ordinateFieldType = fields.find((field) => field.id === ordinate?.field)?.type ?? FieldType.STRING;
|
|
165
|
-
const groupByFieldType = fields.find((field) => field.id === groupBy?.field)?.type ?? FieldType.STRING;
|
|
166
166
|
return {
|
|
167
167
|
abscissa: {
|
|
168
|
-
|
|
169
|
-
vegaType: this.translateToVegaType(
|
|
168
|
+
field: abscissa?.field,
|
|
169
|
+
vegaType: this.translateToVegaType(abscissa?.field.type, abscissa?.name ?? ''),
|
|
170
170
|
name: abscissa?.name ?? ''
|
|
171
171
|
},
|
|
172
172
|
ordinate: {
|
|
173
|
-
fieldType:
|
|
173
|
+
fieldType: ordinate?.field,
|
|
174
174
|
vegaType: options.ordinate.operation === Operation.COUNT || options.ordinate.operation === Operation.DISTINCT
|
|
175
175
|
? VegaType.QUANTITATIVE
|
|
176
|
-
: this.translateToVegaType(
|
|
176
|
+
: this.translateToVegaType(abscissa?.field.type, ordinate?.name ?? ''),
|
|
177
177
|
name: ordinate?.name ?? ''
|
|
178
178
|
},
|
|
179
179
|
groupBy: {
|
|
180
|
-
|
|
181
|
-
vegaType: this.translateToVegaType(
|
|
180
|
+
field: groupBy?.field,
|
|
181
|
+
vegaType: this.translateToVegaType(groupBy?.field.type, groupBy?.name),
|
|
182
182
|
name: groupBy?.name ?? ''
|
|
183
183
|
}
|
|
184
184
|
};
|
|
@@ -247,14 +247,9 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
247
247
|
bin: options.graph.type.indexOf('histogram') >= 0,
|
|
248
248
|
...this.getTimeUnit(options, types.abscissa.vegaType),
|
|
249
249
|
axis: {
|
|
250
|
-
//format: types.abscissa.vegaType === VegaType.TEMPORAL ? '%Y-%B-%dT%H:%M:%S' : undefined,
|
|
251
250
|
grid: false,
|
|
252
|
-
...WidgetAggregatedChartComponent.minTick(types.abscissa.
|
|
253
|
-
labelExpr:
|
|
254
|
-
? "timeFormat(datum.value, '%Y-%B-%dT%H:%M:%S')"
|
|
255
|
-
: 'truncate(datum.value, 10)'} : ${types.abscissa.vegaType === VegaType.TEMPORAL
|
|
256
|
-
? "timeFormat(datum.value, '%Y-%B-%dT%H:%M:%S')"
|
|
257
|
-
: 'datum.value'}`,
|
|
251
|
+
...WidgetAggregatedChartComponent.minTick(types.abscissa.field?.type ?? FieldType.STRING),
|
|
252
|
+
labelExpr: this.getAxisFormat(types.abscissa.vegaType, types.abscissa.field),
|
|
258
253
|
...this.getLabelAngle(types.abscissa.vegaType, values.data)
|
|
259
254
|
},
|
|
260
255
|
scale: {
|
|
@@ -271,7 +266,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
271
266
|
title: options.ordinate.label,
|
|
272
267
|
type: types.ordinate.vegaType,
|
|
273
268
|
axis: {
|
|
274
|
-
...WidgetAggregatedChartComponent.minTick(types.ordinate.
|
|
269
|
+
...WidgetAggregatedChartComponent.minTick(types.ordinate.field?.type ?? FieldType.STRING),
|
|
275
270
|
...this.setTickCount(values.data)
|
|
276
271
|
},
|
|
277
272
|
scale: {
|
|
@@ -306,11 +301,14 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
306
301
|
field: 'key',
|
|
307
302
|
type: types.abscissa.vegaType,
|
|
308
303
|
title: options.abscissa.label,
|
|
309
|
-
...(types.abscissa.vegaType
|
|
310
|
-
|
|
311
|
-
|
|
304
|
+
...this.getDataFormat(types.abscissa.vegaType, types.abscissa.field)
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
field: 'value',
|
|
308
|
+
type: types.ordinate.vegaType,
|
|
309
|
+
title: options.ordinate.label,
|
|
310
|
+
...this.getDataFormat(types.ordinate.vegaType, types.ordinate.field)
|
|
312
311
|
},
|
|
313
|
-
{ field: 'value', type: types.ordinate.vegaType, title: options.ordinate.label },
|
|
314
312
|
{
|
|
315
313
|
field: 'series',
|
|
316
314
|
title: legendTitle,
|
|
@@ -322,11 +320,14 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
322
320
|
field: 'key',
|
|
323
321
|
type: types.abscissa.vegaType,
|
|
324
322
|
title: options.abscissa.label,
|
|
325
|
-
...(types.abscissa.vegaType
|
|
326
|
-
? { format: '%Y-%B-%dT%H:%M:%S', scale: { type: 'utc' } }
|
|
327
|
-
: {})
|
|
323
|
+
...this.getDataFormat(types.abscissa.vegaType, types.abscissa.field)
|
|
328
324
|
},
|
|
329
|
-
{
|
|
325
|
+
{
|
|
326
|
+
field: 'value',
|
|
327
|
+
type: types.ordinate.vegaType,
|
|
328
|
+
title: options.ordinate.label,
|
|
329
|
+
...this.getDataFormat(types.ordinate.vegaType, types.ordinate.field)
|
|
330
|
+
}
|
|
330
331
|
]
|
|
331
332
|
: undefined
|
|
332
333
|
}
|
|
@@ -550,7 +551,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
550
551
|
...this.optionsCopy$.value,
|
|
551
552
|
abscissa: { ...this.optionsCopy$.value?.abscissa, label: attr?.name ?? 'attr-not-found' }
|
|
552
553
|
});
|
|
553
|
-
this.copyAbscissaField = this.fields.find((field) => attr?.field === field.id);
|
|
554
|
+
this.copyAbscissaField = this.fields.find((field) => attr?.field.id === field.id);
|
|
554
555
|
this.enableIntervals(!!this.optionsCopy$.value?.abscissa.interval);
|
|
555
556
|
}
|
|
556
557
|
}
|
|
@@ -576,7 +577,7 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
576
577
|
...this.optionsCopy$.value,
|
|
577
578
|
ordinate: { ...this.optionsCopy$.value?.ordinate, label: attr?.name ?? 'attr-not-found' }
|
|
578
579
|
});
|
|
579
|
-
this.copyOrdinateField = this.fields.find((field) => attr?.field === field.id);
|
|
580
|
+
this.copyOrdinateField = this.fields.find((field) => attr?.field.id === field.id);
|
|
580
581
|
}
|
|
581
582
|
}
|
|
582
583
|
changeOrdinateLabel($event) {
|
|
@@ -823,8 +824,24 @@ class WidgetAggregatedChartComponent extends DataWidgetComponent {
|
|
|
823
824
|
isTimeInterval(abscissaInterval) {
|
|
824
825
|
return typeof abscissaInterval === 'string';
|
|
825
826
|
}
|
|
827
|
+
getAxisFormat(axisType, field) {
|
|
828
|
+
const timeFormat = `timeFormat(datum.value, '${toD3Format(field?.format)}')`;
|
|
829
|
+
const numberFormat = `.${field?.decimalPrecision ?? 2}d`;
|
|
830
|
+
const truncatedFormat = 'truncate(datum.value, 10)';
|
|
831
|
+
return `height < 300 ? ${axisType === VegaType.TEMPORAL ? timeFormat : axisType === VegaType.QUANTITATIVE ? numberFormat : truncatedFormat} : ${axisType === VegaType.TEMPORAL ? timeFormat : axisType === VegaType.QUANTITATIVE ? numberFormat : 'datum.value'}`;
|
|
832
|
+
}
|
|
833
|
+
getDataFormat(axisType, field) {
|
|
834
|
+
switch (axisType) {
|
|
835
|
+
case VegaType.TEMPORAL:
|
|
836
|
+
return { format: toD3Format(field?.format), scale: { type: 'utc' } };
|
|
837
|
+
case VegaType.QUANTITATIVE:
|
|
838
|
+
return { format: `.${field?.decimalPrecision ?? 2}d` };
|
|
839
|
+
default:
|
|
840
|
+
return {};
|
|
841
|
+
}
|
|
842
|
+
}
|
|
826
843
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WidgetAggregatedChartComponent, deps: [{ token: i1.Store }, { token: i2.PryI18nService }, { token: i0.ElementRef }, { token: i2.PryAggregationService }, { token: i3.PrySchemeService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
827
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: WidgetAggregatedChartComponent, selector: "pry-widget-aggregated-chart", viewQueries: [{ propertyName: "vega", first: true, predicate: ["vega"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<pry-widget-aggregated-chart-css></pry-widget-aggregated-chart-css>\n<div\n class=\"o-widget o-widget--chart\"\n *ngIf=\"optionsCopy$ | async as optionsCopy\"\n [class.-has-header]=\"displayHeader$ | async\"\n>\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n #header\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n [displayCount]=\"false\"\n [openData$]=\"openData$\"\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [open$]=\"open$\"\n [header]=\"header\"\n class=\"o-settings\"\n >\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.title\"\n (ngModelChange)=\"changeChartTitle($event)\"\n [ngModel]=\"optionsCopy.graph.title\"\n ></pry-edit-input>\n </div>\n\n <div *ngIf=\"optionsCopy\" class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_type\">{{ '@pry.widget.chart.type' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeType($event)\"\n [items]=\"typeOptions\"\n [ngModel]=\"optionsCopy.graph.type\"\n bindLabel=\"label\"\n bindValue=\"id\"\n id=\"chart_type\"\n ></pry-select>\n </div>\n\n <ng-container *ngIf=\"optionsCopy.graph.type === GraphType.DONUT\">\n <pry-range\n [ngModel]=\"optionsCopy.graph.donutSize\"\n (ngModelChange)=\"changeDonutSize($event)\"\n labelTranslate=\"@pry.widget.chart.donutSize\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </ng-container>\n\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleLegend($event)\" [ngModel]=\"!!optionsCopy.graph.legend\">\n {{ '@pry.widget.chart.legend' | i18n }}\n </pry-checkbox>\n </div>\n </div>\n\n <ng-container *ngIf=\"!!optionsCopy.graph.type\">\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"abscissa\">{{ '@pry.widget.chart.abscissa' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeAbscissa($event)\"\n [items]=\"abscissaAttributes$ | async | prySortData: sortActive : sortDirection\"\n [ngModel]=\"optionsCopy.abscissa.attribute\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"abscissa\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.dataLabel\"\n (ngModelChange)=\"changeAbscissaLabel($event)\"\n [ngModel]=\"optionsCopy.abscissa.label\"\n ></pry-edit-input>\n </div>\n\n <div\n *ngIf=\"\n ['quantitative', 'temporal'].includes(translateToVegaType(copyAbscissaField?.type)) &&\n optionsCopy.graph.type !== GraphType.DONUT &&\n optionsCopy.graph.type !== GraphType.CIRCULAR\n \"\n class=\"m-form-label-field\"\n >\n <pry-checkbox (ngModelChange)=\"changeKeep0Abscissa($event)\" [ngModel]=\"optionsCopy.abscissa.keep0\"\n >{{ '@pry.widget.chart.origin' | i18n }}\n </pry-checkbox>\n\n <ng-container *ngIf=\"optionsCopy.graph.type === GraphType.HISTOGRAM\">\n <pry-checkbox\n (ngModelChange)=\"enableIntervals($event)\"\n [ngModel]=\"!!optionsCopy.abscissa.interval\"\n [disabled]=\"optionsCopy.graph.type === GraphType.HISTOGRAM\"\n >{{ '@pry.widget.chart.interval' | i18n }}\n </pry-checkbox>\n\n <ng-container *ngIf=\"!!optionsCopy.abscissa.interval\">\n <ng-container *ngIf=\"!isTimeInterval(optionsCopy.abscissa.interval); else timeInterval\">\n <pry-range\n [ngModel]=\"optionsCopy.abscissa.interval\"\n (ngModelChange)=\"changeInterval($event)\"\n labelTranslate=\"@pry.widget.chart.specifyInterval\"\n min=\"1\"\n max=\"10\"\n ></pry-range>\n </ng-container>\n\n <ng-template #timeInterval>\n <label class=\"a-label\" for=\"time_interval\">{{ '@pry.widget.chart.timeInterval' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeTimeInterval($event)\"\n [items]=\"['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']\"\n [ngModel]=\"optionsCopy.abscissa.interval\"\n i18nPrefix=\"@pry.widget.chart.time.\"\n id=\"time_interval\"\n ></pry-select>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"operations\">{{ '@pry.widget.chart.operation.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeOperation($event)\"\n [items]=\"operations$ | async\"\n [ngModel]=\"optionsCopy.ordinate.operation\"\n bindLabel=\"label\"\n bindValue=\"id\"\n id=\"operations\"\n ></pry-select>\n </div>\n\n <ng-container *ngIf=\"optionsCopy.ordinate.operation !== Operation.COUNT\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"ordinate\">{{ '@pry.widget.chart.ordinate' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeOrdinate($event)\"\n [items]=\"ordinateAttributes$ | async | prySortData: sortActive : sortDirection\"\n [ngModel]=\"optionsCopy.ordinate.attribute\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"ordinate\"\n ></pry-select>\n </div>\n </ng-container>\n\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.dataLabel\"\n (ngModelChange)=\"changeOrdinateLabel($event)\"\n [ngModel]=\"optionsCopy.ordinate.label\"\n ></pry-edit-input>\n </div>\n\n <div *ngIf=\"translateToVegaType(copyOrdinateField?.type) === 'quantitative'\" class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeKeep0Ordinate($event)\" [ngModel]=\"optionsCopy.ordinate.keep0\"\n >{{ '@pry.widget.chart.origin' | i18n }}\n </pry-checkbox>\n </div>\n </div>\n\n <ng-container\n *ngIf=\"optionsCopy.graph.type !== GraphType.DONUT && optionsCopy.graph.type !== GraphType.CIRCULAR\"\n >\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleGroupBy($event)\" [ngModel]=\"!!optionsCopy.groupBy\"\n >{{ '@pry.widget.chart.groupBy' | i18n }}\n </pry-checkbox>\n </div>\n\n <ng-container *ngIf=\"!!optionsCopy.groupBy\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_seriesAttr\">{{ '@pry.widget.chart.groupAttr' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeGroupBy($event)\"\n [ngModel]=\"optionsCopy.groupBy.attribute\"\n [items]=\"abscissaAttributes$ | async | prySortData: sortActive : sortDirection\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"chart_seriesAttr\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-scheme-picker\n (ngModelChange)=\"changeColorScheme($event)\"\n [ngModel]=\"optionsCopy.groupBy.color\"\n ></pry-scheme-picker>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-checkbox [ngModel]=\"optionsCopy.graph.stacked\" (ngModelChange)=\"toggleStacked($event)\">\n {{ '@pry.widget.chart.stacked' | i18n }}\n </pry-checkbox>\n </div>\n </ng-container>\n </div>\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox\n (ngModelChange)=\"toggleLimitItems($event)\"\n [ngModel]=\"optionsCopy.abscissa.limit !== undefined && optionsCopy.abscissa.limit !== null\"\n >\n {{ '@pry.widget.chart.limit' | i18n }}\n </pry-checkbox>\n </div>\n <ng-container *ngIf=\"optionsCopy.abscissa.limit !== undefined && optionsCopy.abscissa.limit !== null\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_limitItemsValue\">{{ '@pry.widget.chart.limitMaxNb' | i18n }}</label>\n <input\n type=\"number\"\n id=\"chart_limitItemsValue\"\n class=\"a-form-field\"\n [ngModel]=\"optionsCopy.abscissa.limit\"\n (ngModelChange)=\"changeLimitValue($event)\"\n min=\"1\"\n step=\"1\"\n [attr.aria-invalid]=\"optionsCopy.abscissa.limit < 1\"\n />\n </div>\n </ng-container>\n </div>\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleSort($event)\" [ngModel]=\"!!optionsCopy.graph.sort\"\n >{{ '@pry.widget.chart.sort.title' | i18n }}\n </pry-checkbox>\n </div>\n <ng-container *ngIf=\"!!optionsCopy.graph.sort\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_sortValue\">{{ '@pry.widget.chart.sort.attribute' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeSortValue($event)\"\n [ngModel]=\"optionsCopy.graph.sort.value\"\n [items]=\"sortValues$ | async\"\n bindValue=\"value\"\n bindLabel=\"label\"\n id=\"chart_sortValue\"\n ></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_sortDirection\">{{ '@pry.widget.chart.sort.direction' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeSortDirection($event)\"\n [ngModel]=\"optionsCopy.graph.sort.direction\"\n [items]=\"sortDirections\"\n bindValue=\"value\"\n bindLabel=\"label\"\n id=\"chart_sortDirection\"\n ></pry-select>\n </div>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container\n *ngIf=\"optionsCopy.graph.type === GraphType.DONUT || optionsCopy.graph.type === GraphType.CIRCULAR\"\n >\n <pry-scheme-picker\n (ngModelChange)=\"changeCircleColorScheme($event)\"\n [ngModel]=\"optionsCopy.circleColorScheme\"\n ></pry-scheme-picker>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n optionsCopy.graph.type !== GraphType.DONUT &&\n optionsCopy.graph.type !== GraphType.CIRCULAR &&\n !optionsCopy.groupBy\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_baseColor\">{{ '@pry.widget.chart.color' | i18n }}</label>\n <pry-color-picker\n (ngModelChange)=\"changeBaseColor($event)\"\n [ngModel]=\"optionsCopy.baseColor\"\n id=\"chart_baseColor\"\n ></pry-color-picker>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <div class=\"a-chip -md\" [style.background-color]=\"item\">{{ item }}</div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </ng-container>\n </pry-settings>\n </pry-widget-header>\n\n <ng-container *ngIf=\"(isChartValid$ | async) && !(noData$ | async) && !(noAggregationData$ | async)\">\n <div #vega></div>\n </ng-container>\n\n <ng-container *ngIf=\"noData$ | async\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.noData' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.noData' | i18n }}</span>\n <button type=\"button\" (click)=\"openData()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.tooltip.readSearch' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!(noData$ | async) && (noAggregationData$ | async)\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.aggNoResult' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.aggNoResult' | i18n }}</span>\n <button type=\"button\" (click)=\"openSettings()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.settings.title' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!(noData$ | async) && !(noAggregationData$ | async) && !(isChartValid$ | async)\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.chooseParameters' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.chooseParameters' | i18n }}</span>\n <button type=\"button\" (click)=\"openSettings()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.settings.title' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.SettingsComponent, selector: "pry-settings", inputs: ["widgetIndex", "isDisable", "headerPresent", "open$", "header"], outputs: ["triggerClick", "saveTriggered", "changeTitle"] }, { kind: "component", type: i2.PryWidgetHeaderComponent, selector: "pry-widget-header", inputs: ["manifest", "openData$", "additionalOptions", "headerOptions", "displayCount", "datasourceIds", "widgetIndex"], outputs: ["manifestModified"] }, { kind: "component", type: i2.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i6.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "component", type: i2.PryEditInputComponent, selector: "pry-edit-input", inputs: ["label", "editButtonTooltip", "confirmButtonTooltip"], outputs: ["validated"] }, { kind: "component", type: i2.PryRangeComponent, selector: "pry-range", inputs: ["min", "max", "step", "disabled", "labelTranslate"] }, { kind: "component", type: i7.PryColorPickerComponent, selector: "pry-color-picker" }, { kind: "component", type: i3.PrySchemePickerComponent, selector: "pry-scheme-picker" }, { kind: "component", type: PryWidgetAggregatedChartCssComponent, selector: "pry-widget-aggregated-chart-css" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: i2.PrySortDataPipe, name: "prySortData" }] }); }
|
|
844
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: WidgetAggregatedChartComponent, selector: "pry-widget-aggregated-chart", viewQueries: [{ propertyName: "vega", first: true, predicate: ["vega"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<pry-widget-aggregated-chart-css></pry-widget-aggregated-chart-css>\n<div\n class=\"o-widget o-widget--chart\"\n *ngIf=\"optionsCopy$ | async as optionsCopy\"\n [class.-has-header]=\"displayHeader$ | async\"\n>\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n #header\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n [displayCount]=\"false\"\n [openData$]=\"openData$\"\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n (changeTitle)=\"changeWidgetTitle($event)\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [open$]=\"open$\"\n [header]=\"header\"\n class=\"o-settings\"\n >\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.title\"\n (ngModelChange)=\"changeChartTitle($event)\"\n [ngModel]=\"optionsCopy.graph.title\"\n ></pry-edit-input>\n </div>\n\n <div *ngIf=\"optionsCopy\" class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_type\">{{ '@pry.widget.chart.type' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeType($event)\"\n [items]=\"typeOptions\"\n [ngModel]=\"optionsCopy.graph.type\"\n bindLabel=\"label\"\n bindValue=\"id\"\n id=\"chart_type\"\n ></pry-select>\n </div>\n\n <ng-container *ngIf=\"optionsCopy.graph.type === GraphType.DONUT\">\n <pry-range\n [ngModel]=\"optionsCopy.graph.donutSize\"\n (ngModelChange)=\"changeDonutSize($event)\"\n labelTranslate=\"@pry.widget.chart.donutSize\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </ng-container>\n\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleLegend($event)\" [ngModel]=\"!!optionsCopy.graph.legend\">\n {{ '@pry.widget.chart.legend' | i18n }}\n </pry-checkbox>\n </div>\n </div>\n\n <ng-container *ngIf=\"!!optionsCopy.graph.type\">\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"abscissa\">{{ '@pry.widget.chart.abscissa' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeAbscissa($event)\"\n [items]=\"abscissaAttributes$ | async | prySortData: sortActive : sortDirection\"\n [ngModel]=\"optionsCopy.abscissa.attribute\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"abscissa\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.dataLabel\"\n (ngModelChange)=\"changeAbscissaLabel($event)\"\n [ngModel]=\"optionsCopy.abscissa.label\"\n ></pry-edit-input>\n </div>\n\n <div\n *ngIf=\"\n ['quantitative', 'temporal'].includes(translateToVegaType(copyAbscissaField?.type)) &&\n optionsCopy.graph.type !== GraphType.DONUT &&\n optionsCopy.graph.type !== GraphType.CIRCULAR\n \"\n class=\"m-form-label-field\"\n >\n <pry-checkbox (ngModelChange)=\"changeKeep0Abscissa($event)\" [ngModel]=\"optionsCopy.abscissa.keep0\"\n >{{ '@pry.widget.chart.origin' | i18n }}\n </pry-checkbox>\n\n <ng-container *ngIf=\"optionsCopy.graph.type === GraphType.HISTOGRAM\">\n <pry-checkbox\n (ngModelChange)=\"enableIntervals($event)\"\n [ngModel]=\"!!optionsCopy.abscissa.interval\"\n [disabled]=\"optionsCopy.graph.type === GraphType.HISTOGRAM\"\n >{{ '@pry.widget.chart.interval' | i18n }}\n </pry-checkbox>\n\n <ng-container *ngIf=\"!!optionsCopy.abscissa.interval\">\n <ng-container *ngIf=\"!isTimeInterval(optionsCopy.abscissa.interval); else timeInterval\">\n <pry-range\n [ngModel]=\"optionsCopy.abscissa.interval\"\n (ngModelChange)=\"changeInterval($event)\"\n labelTranslate=\"@pry.widget.chart.specifyInterval\"\n min=\"1\"\n max=\"10\"\n ></pry-range>\n </ng-container>\n\n <ng-template #timeInterval>\n <label class=\"a-label\" for=\"time_interval\">{{ '@pry.widget.chart.timeInterval' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeTimeInterval($event)\"\n [items]=\"['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']\"\n [ngModel]=\"optionsCopy.abscissa.interval\"\n i18nPrefix=\"@pry.widget.chart.time.\"\n id=\"time_interval\"\n ></pry-select>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"operations\">{{ '@pry.widget.chart.operation.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeOperation($event)\"\n [items]=\"operations$ | async\"\n [ngModel]=\"optionsCopy.ordinate.operation\"\n bindLabel=\"label\"\n bindValue=\"id\"\n id=\"operations\"\n ></pry-select>\n </div>\n\n <ng-container *ngIf=\"optionsCopy.ordinate.operation !== Operation.COUNT\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"ordinate\">{{ '@pry.widget.chart.ordinate' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeOrdinate($event)\"\n [items]=\"ordinateAttributes$ | async | prySortData: sortActive : sortDirection\"\n [ngModel]=\"optionsCopy.ordinate.attribute\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"ordinate\"\n ></pry-select>\n </div>\n </ng-container>\n\n <div class=\"m-form-label-field\">\n <pry-edit-input\n label=\"@pry.widget.chart.dataLabel\"\n (ngModelChange)=\"changeOrdinateLabel($event)\"\n [ngModel]=\"optionsCopy.ordinate.label\"\n ></pry-edit-input>\n </div>\n\n <div *ngIf=\"translateToVegaType(copyOrdinateField?.type) === 'quantitative'\" class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeKeep0Ordinate($event)\" [ngModel]=\"optionsCopy.ordinate.keep0\"\n >{{ '@pry.widget.chart.origin' | i18n }}\n </pry-checkbox>\n </div>\n </div>\n\n <ng-container\n *ngIf=\"optionsCopy.graph.type !== GraphType.DONUT && optionsCopy.graph.type !== GraphType.CIRCULAR\"\n >\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleGroupBy($event)\" [ngModel]=\"!!optionsCopy.groupBy\"\n >{{ '@pry.widget.chart.groupBy' | i18n }}\n </pry-checkbox>\n </div>\n\n <ng-container *ngIf=\"!!optionsCopy.groupBy\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_seriesAttr\">{{ '@pry.widget.chart.groupAttr' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeGroupBy($event)\"\n [ngModel]=\"optionsCopy.groupBy.attribute\"\n [items]=\"abscissaAttributes$ | async | prySortData: sortActive : sortDirection\"\n bindLabel=\"name\"\n bindValue=\"id\"\n id=\"chart_seriesAttr\"\n ></pry-select>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-scheme-picker\n (ngModelChange)=\"changeColorScheme($event)\"\n [ngModel]=\"optionsCopy.groupBy.color\"\n ></pry-scheme-picker>\n </div>\n\n <div class=\"m-form-label-field\">\n <pry-checkbox [ngModel]=\"optionsCopy.graph.stacked\" (ngModelChange)=\"toggleStacked($event)\">\n {{ '@pry.widget.chart.stacked' | i18n }}\n </pry-checkbox>\n </div>\n </ng-container>\n </div>\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox\n (ngModelChange)=\"toggleLimitItems($event)\"\n [ngModel]=\"optionsCopy.abscissa.limit !== undefined && optionsCopy.abscissa.limit !== null\"\n >\n {{ '@pry.widget.chart.limit' | i18n }}\n </pry-checkbox>\n </div>\n <ng-container *ngIf=\"optionsCopy.abscissa.limit !== undefined && optionsCopy.abscissa.limit !== null\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_limitItemsValue\">{{ '@pry.widget.chart.limitMaxNb' | i18n }}</label>\n <input\n type=\"number\"\n id=\"chart_limitItemsValue\"\n class=\"a-form-field\"\n [ngModel]=\"optionsCopy.abscissa.limit\"\n (ngModelChange)=\"changeLimitValue($event)\"\n min=\"1\"\n step=\"1\"\n [attr.aria-invalid]=\"optionsCopy.abscissa.limit < 1\"\n />\n </div>\n </ng-container>\n </div>\n <div class=\"o-settings__popup__content__fields -condensed\">\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"toggleSort($event)\" [ngModel]=\"!!optionsCopy.graph.sort\"\n >{{ '@pry.widget.chart.sort.title' | i18n }}\n </pry-checkbox>\n </div>\n <ng-container *ngIf=\"!!optionsCopy.graph.sort\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_sortValue\">{{ '@pry.widget.chart.sort.attribute' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeSortValue($event)\"\n [ngModel]=\"optionsCopy.graph.sort.value\"\n [items]=\"sortValues$ | async\"\n bindValue=\"value\"\n bindLabel=\"label\"\n id=\"chart_sortValue\"\n ></pry-select>\n </div>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_sortDirection\">{{ '@pry.widget.chart.sort.direction' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeSortDirection($event)\"\n [ngModel]=\"optionsCopy.graph.sort.direction\"\n [items]=\"sortDirections\"\n bindValue=\"value\"\n bindLabel=\"label\"\n id=\"chart_sortDirection\"\n ></pry-select>\n </div>\n </ng-container>\n </div>\n </ng-container>\n\n <ng-container\n *ngIf=\"optionsCopy.graph.type === GraphType.DONUT || optionsCopy.graph.type === GraphType.CIRCULAR\"\n >\n <pry-scheme-picker\n (ngModelChange)=\"changeCircleColorScheme($event)\"\n [ngModel]=\"optionsCopy.circleColorScheme\"\n ></pry-scheme-picker>\n </ng-container>\n\n <ng-container\n *ngIf=\"\n optionsCopy.graph.type !== GraphType.DONUT &&\n optionsCopy.graph.type !== GraphType.CIRCULAR &&\n !optionsCopy.groupBy\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"chart_baseColor\">{{ '@pry.widget.chart.color' | i18n }}</label>\n <pry-color-picker\n (ngModelChange)=\"changeBaseColor($event)\"\n [ngModel]=\"optionsCopy.baseColor\"\n id=\"chart_baseColor\"\n ></pry-color-picker>\n <ng-template #templateOption let-item=\"item\">\n <div class=\"aligned-option\">\n <div class=\"a-chip -md\" [style.background-color]=\"item\">{{ item }}</div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </ng-container>\n </pry-settings>\n </pry-widget-header>\n\n <ng-container *ngIf=\"(isChartValid$ | async) && !(noData$ | async) && !(noAggregationData$ | async)\">\n <div #vega></div>\n </ng-container>\n\n <ng-container *ngIf=\"noData$ | async\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.noData' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.noData' | i18n }}</span>\n <button type=\"button\" (click)=\"openData()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.tooltip.readSearch' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!(noData$ | async) && (noAggregationData$ | async)\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.aggNoResult' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.aggNoResult' | i18n }}</span>\n <button type=\"button\" (click)=\"openSettings()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.settings.title' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!(noData$ | async) && !(noAggregationData$ | async) && !(isChartValid$ | async)\">\n <div class=\"o-widget__choose-parameters\">\n <img\n class=\"no-result__search\"\n src=\"../../../assets/svgs/pry_recherche_pas_de_resultat.svg\"\n alt=\"{{ '@pry.widget.chart.chooseParameters' | i18n }}\"\n aria-hidden=\"true\"\n />\n <span class=\"no-result__text\">{{ '@pry.widget.chart.chooseParameters' | i18n }}</span>\n <button type=\"button\" (click)=\"openSettings()\" class=\"a-btn a-btn--primary\">\n <pry-icon [height]=\"20\" [width]=\"20\" iconSvg=\"control\"></pry-icon>\n <span>{{ '@pry.widget.settings.title' | i18n }}</span>\n </button>\n </div>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.SettingsComponent, selector: "pry-settings", inputs: ["widgetIndex", "isDisable", "headerPresent", "open$", "header"], outputs: ["triggerClick", "saveTriggered", "changeTitle"] }, { kind: "component", type: i2.PryWidgetHeaderComponent, selector: "pry-widget-header", inputs: ["manifest", "openData$", "additionalOptions", "headerOptions", "displayCount", "datasourceIds", "widgetIndex"], outputs: ["manifestModified"] }, { kind: "component", type: i2.PrySelectComponent, selector: "pry-select", inputs: ["items", "clearable", "multiple", "closeOnSelect", "placeholder", "isForm", "required", "name", "readonly", "autocomplete", "alwaysShowAutosuggestedValues", "externalAutocompleteService", "bindValue", "bindLabel", "iconSize", "bindIcon", "template", "i18nPrefix", "bindClasses", "loading", "elementRef"], outputs: ["searched", "cleared", "clicked"] }, { kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i6.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle", "name", "inputId", "inhibit"] }, { kind: "component", type: i2.PryEditInputComponent, selector: "pry-edit-input", inputs: ["label", "editButtonTooltip", "confirmButtonTooltip"], outputs: ["validated"] }, { kind: "component", type: i2.PryRangeComponent, selector: "pry-range", inputs: ["min", "max", "step", "disabled", "labelTranslate"] }, { kind: "component", type: i7.PryColorPickerComponent, selector: "pry-color-picker" }, { kind: "component", type: i3.PrySchemePickerComponent, selector: "pry-scheme-picker" }, { kind: "component", type: PryWidgetAggregatedChartCssComponent, selector: "pry-widget-aggregated-chart-css" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: i2.PrySortDataPipe, name: "prySortData" }] }); }
|
|
828
845
|
}
|
|
829
846
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: WidgetAggregatedChartComponent, decorators: [{
|
|
830
847
|
type: Component,
|