ng-kinintel 0.0.317
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/README.md +24 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +11 -0
- package/src/lib/components/alert-groups/alert-groups.component.html +140 -0
- package/src/lib/components/alert-groups/alert-groups.component.sass +4 -0
- package/src/lib/components/alert-groups/alert-groups.component.spec.ts +25 -0
- package/src/lib/components/alert-groups/alert-groups.component.ts +86 -0
- package/src/lib/components/alert-groups/edit-alert-group/edit-alert-group.component.html +91 -0
- package/src/lib/components/alert-groups/edit-alert-group/edit-alert-group.component.sass +2 -0
- package/src/lib/components/alert-groups/edit-alert-group/edit-alert-group.component.spec.ts +25 -0
- package/src/lib/components/alert-groups/edit-alert-group/edit-alert-group.component.ts +78 -0
- package/src/lib/components/dashboard-editor/configure-item/configure-item.component.html +2006 -0
- package/src/lib/components/dashboard-editor/configure-item/configure-item.component.sass +106 -0
- package/src/lib/components/dashboard-editor/configure-item/configure-item.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/configure-item/configure-item.component.ts +967 -0
- package/src/lib/components/dashboard-editor/configure-item/edit-dashboard-alert/edit-dashboard-alert.component.html +81 -0
- package/src/lib/components/dashboard-editor/configure-item/edit-dashboard-alert/edit-dashboard-alert.component.sass +0 -0
- package/src/lib/components/dashboard-editor/configure-item/edit-dashboard-alert/edit-dashboard-alert.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/configure-item/edit-dashboard-alert/edit-dashboard-alert.component.ts +48 -0
- package/src/lib/components/dashboard-editor/configure-item/html-documentation/html-documentation.component.html +142 -0
- package/src/lib/components/dashboard-editor/configure-item/html-documentation/html-documentation.component.sass +0 -0
- package/src/lib/components/dashboard-editor/configure-item/html-documentation/html-documentation.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/configure-item/html-documentation/html-documentation.component.ts +117 -0
- package/src/lib/components/dashboard-editor/configure-item/table-cell-formatter/table-cell-formatter.component.html +224 -0
- package/src/lib/components/dashboard-editor/configure-item/table-cell-formatter/table-cell-formatter.component.sass +0 -0
- package/src/lib/components/dashboard-editor/configure-item/table-cell-formatter/table-cell-formatter.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/configure-item/table-cell-formatter/table-cell-formatter.component.ts +149 -0
- package/src/lib/components/dashboard-editor/configure-item/vis-network-options.json +135 -0
- package/src/lib/components/dashboard-editor/dashboard-editor.component.html +205 -0
- package/src/lib/components/dashboard-editor/dashboard-editor.component.sass +247 -0
- package/src/lib/components/dashboard-editor/dashboard-editor.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/dashboard-editor.component.ts +645 -0
- package/src/lib/components/dashboard-editor/dashboard-parameter/dashboard-parameter.component.html +1 -0
- package/src/lib/components/dashboard-editor/dashboard-parameter/dashboard-parameter.component.sass +0 -0
- package/src/lib/components/dashboard-editor/dashboard-parameter/dashboard-parameter.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/dashboard-parameter/dashboard-parameter.component.ts +16 -0
- package/src/lib/components/dashboard-editor/dashboard-settings/dashboard-settings.component.html +167 -0
- package/src/lib/components/dashboard-editor/dashboard-settings/dashboard-settings.component.sass +0 -0
- package/src/lib/components/dashboard-editor/dashboard-settings/dashboard-settings.component.spec.ts +23 -0
- package/src/lib/components/dashboard-editor/dashboard-settings/dashboard-settings.component.ts +47 -0
- package/src/lib/components/dashboard-editor/item-component/item-component.component.html +486 -0
- package/src/lib/components/dashboard-editor/item-component/item-component.component.sass +137 -0
- package/src/lib/components/dashboard-editor/item-component/item-component.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/item-component/item-component.component.ts +1381 -0
- package/src/lib/components/dashboard-editor/source-selector-dialog/source-selector-dialog.component.html +48 -0
- package/src/lib/components/dashboard-editor/source-selector-dialog/source-selector-dialog.component.sass +3 -0
- package/src/lib/components/dashboard-editor/source-selector-dialog/source-selector-dialog.component.spec.ts +25 -0
- package/src/lib/components/dashboard-editor/source-selector-dialog/source-selector-dialog.component.ts +111 -0
- package/src/lib/components/dashboards/dashboards.component.html +175 -0
- package/src/lib/components/dashboards/dashboards.component.sass +64 -0
- package/src/lib/components/dashboards/dashboards.component.spec.ts +25 -0
- package/src/lib/components/dashboards/dashboards.component.ts +176 -0
- package/src/lib/components/dashboards/view-dashboard/view-dashboard.component.html +138 -0
- package/src/lib/components/dashboards/view-dashboard/view-dashboard.component.sass +284 -0
- package/src/lib/components/dashboards/view-dashboard/view-dashboard.component.spec.ts +25 -0
- package/src/lib/components/dashboards/view-dashboard/view-dashboard.component.ts +462 -0
- package/src/lib/components/data-explorer/change-source-warning/change-source-warning.component.html +35 -0
- package/src/lib/components/data-explorer/change-source-warning/change-source-warning.component.sass +0 -0
- package/src/lib/components/data-explorer/change-source-warning/change-source-warning.component.spec.ts +23 -0
- package/src/lib/components/data-explorer/change-source-warning/change-source-warning.component.ts +21 -0
- package/src/lib/components/data-explorer/data-explorer.component.html +326 -0
- package/src/lib/components/data-explorer/data-explorer.component.sass +96 -0
- package/src/lib/components/data-explorer/data-explorer.component.spec.ts +25 -0
- package/src/lib/components/data-explorer/data-explorer.component.ts +267 -0
- package/src/lib/components/data-explorer/export-data/export-data.component.html +69 -0
- package/src/lib/components/data-explorer/export-data/export-data.component.sass +0 -0
- package/src/lib/components/data-explorer/export-data/export-data.component.spec.ts +25 -0
- package/src/lib/components/data-explorer/export-data/export-data.component.ts +56 -0
- package/src/lib/components/data-explorer/snapshot-api-access/snapshot-api-access.component.html +195 -0
- package/src/lib/components/data-explorer/snapshot-api-access/snapshot-api-access.component.sass +0 -0
- package/src/lib/components/data-explorer/snapshot-api-access/snapshot-api-access.component.spec.ts +23 -0
- package/src/lib/components/data-explorer/snapshot-api-access/snapshot-api-access.component.ts +79 -0
- package/src/lib/components/data-explorer/snapshot-profile-dialog/snapshot-profile-dialog.component.html +375 -0
- package/src/lib/components/data-explorer/snapshot-profile-dialog/snapshot-profile-dialog.component.sass +21 -0
- package/src/lib/components/data-explorer/snapshot-profile-dialog/snapshot-profile-dialog.component.spec.ts +25 -0
- package/src/lib/components/data-explorer/snapshot-profile-dialog/snapshot-profile-dialog.component.ts +197 -0
- package/src/lib/components/data-picker/data-picker.component.html +127 -0
- package/src/lib/components/data-picker/data-picker.component.sass +0 -0
- package/src/lib/components/data-picker/data-picker.component.spec.ts +25 -0
- package/src/lib/components/data-picker/data-picker.component.ts +90 -0
- package/src/lib/components/data-search/data-search.component.html +1 -0
- package/src/lib/components/data-search/data-search.component.sass +0 -0
- package/src/lib/components/data-search/data-search.component.spec.ts +23 -0
- package/src/lib/components/data-search/data-search.component.ts +10 -0
- package/src/lib/components/data-sharing-invite/data-sharing-invite.component.html +53 -0
- package/src/lib/components/data-sharing-invite/data-sharing-invite.component.sass +0 -0
- package/src/lib/components/data-sharing-invite/data-sharing-invite.component.spec.ts +23 -0
- package/src/lib/components/data-sharing-invite/data-sharing-invite.component.ts +56 -0
- package/src/lib/components/dataset/create-dataset/create-dataset.component.html +25 -0
- package/src/lib/components/dataset/create-dataset/create-dataset.component.sass +0 -0
- package/src/lib/components/dataset/create-dataset/create-dataset.component.spec.ts +25 -0
- package/src/lib/components/dataset/create-dataset/create-dataset.component.ts +44 -0
- package/src/lib/components/dataset/dataset-editor/available-columns/available-columns.component.html +28 -0
- package/src/lib/components/dataset/dataset-editor/available-columns/available-columns.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/available-columns/available-columns.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/available-columns/available-columns.component.ts +22 -0
- package/src/lib/components/dataset/dataset-editor/dataset-add-join/dataset-add-join.component.html +196 -0
- package/src/lib/components/dataset/dataset-editor/dataset-add-join/dataset-add-join.component.sass +17 -0
- package/src/lib/components/dataset/dataset-editor/dataset-add-join/dataset-add-join.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-add-join/dataset-add-join.component.ts +422 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-editor/dataset-column-editor.component.html +30 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-editor/dataset-column-editor.component.sass +47 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-editor/dataset-column-editor.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-editor/dataset-column-editor.component.ts +78 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-settings.component.html +86 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-settings.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-settings.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-column-settings/dataset-column-settings.component.ts +49 -0
- package/src/lib/components/dataset/dataset-editor/dataset-create-formula/dataset-create-formula.component.html +68 -0
- package/src/lib/components/dataset/dataset-editor/dataset-create-formula/dataset-create-formula.component.sass +15 -0
- package/src/lib/components/dataset/dataset-editor/dataset-create-formula/dataset-create-formula.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-create-formula/dataset-create-formula.component.ts +65 -0
- package/src/lib/components/dataset/dataset-editor/dataset-editor-popup.html +19 -0
- package/src/lib/components/dataset/dataset-editor/dataset-editor.component.html +609 -0
- package/src/lib/components/dataset/dataset-editor/dataset-editor.component.sass +267 -0
- package/src/lib/components/dataset/dataset-editor/dataset-editor.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-editor.component.ts +1228 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter/dataset-filter.component.html +309 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter/dataset-filter.component.sass +41 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter/dataset-filter.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter/dataset-filter.component.ts +215 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-inclusion/dataset-filter-inclusion.component.html +33 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-inclusion/dataset-filter-inclusion.component.sass +3 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-inclusion/dataset-filter-inclusion.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-inclusion/dataset-filter-inclusion.component.ts +20 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-junction/dataset-filter-junction.component.html +52 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-junction/dataset-filter-junction.component.sass +14 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-junction/dataset-filter-junction.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filter-junction/dataset-filter-junction.component.ts +58 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filters.component.html +47 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filters.component.sass +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filters.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-filters/dataset-filters.component.ts +49 -0
- package/src/lib/components/dataset/dataset-editor/dataset-name-dialog/dataset-name-dialog.component.html +49 -0
- package/src/lib/components/dataset/dataset-editor/dataset-name-dialog/dataset-name-dialog.component.sass +2 -0
- package/src/lib/components/dataset/dataset-editor/dataset-name-dialog/dataset-name-dialog.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-name-dialog/dataset-name-dialog.component.ts +39 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-add-parameter/dataset-add-parameter.component.html +195 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-add-parameter/dataset-add-parameter.component.sass +14 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-add-parameter/dataset-add-parameter.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-add-parameter/dataset-add-parameter.component.ts +82 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-type/dataset-parameter-type.component.html +78 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-type/dataset-parameter-type.component.sass +16 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-type/dataset-parameter-type.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-type/dataset-parameter-type.component.ts +32 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-values.component.html +24 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-values.component.sass +22 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-values.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-parameter-values/dataset-parameter-values.component.ts +64 -0
- package/src/lib/components/dataset/dataset-editor/dataset-summarise/dataset-summarise.component.html +177 -0
- package/src/lib/components/dataset/dataset-editor/dataset-summarise/dataset-summarise.component.sass +80 -0
- package/src/lib/components/dataset/dataset-editor/dataset-summarise/dataset-summarise.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset-editor/dataset-summarise/dataset-summarise.component.ts +113 -0
- package/src/lib/components/dataset/dataset-editor/move-transformation-confirmation/move-transformation-confirmation.component.html +32 -0
- package/src/lib/components/dataset/dataset-editor/move-transformation-confirmation/move-transformation-confirmation.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/move-transformation-confirmation/move-transformation-confirmation.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/move-transformation-confirmation/move-transformation-confirmation.component.ts +20 -0
- package/src/lib/components/dataset/dataset-editor/remove-transformation-warning/remove-transformation-warning.component.html +37 -0
- package/src/lib/components/dataset/dataset-editor/remove-transformation-warning/remove-transformation-warning.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/remove-transformation-warning/remove-transformation-warning.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/remove-transformation-warning/remove-transformation-warning.component.ts +19 -0
- package/src/lib/components/dataset/dataset-editor/save-as-query/save-as-query.component.html +69 -0
- package/src/lib/components/dataset/dataset-editor/save-as-query/save-as-query.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/save-as-query/save-as-query.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/save-as-query/save-as-query.component.ts +58 -0
- package/src/lib/components/dataset/dataset-editor/share-query/share-query.component.html +195 -0
- package/src/lib/components/dataset/dataset-editor/share-query/share-query.component.sass +0 -0
- package/src/lib/components/dataset/dataset-editor/share-query/share-query.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/share-query/share-query.component.ts +128 -0
- package/src/lib/components/dataset/dataset-editor/upstream-changes-confirmation/upstream-changes-confirmation.component.html +34 -0
- package/src/lib/components/dataset/dataset-editor/upstream-changes-confirmation/upstream-changes-confirmation.component.sass +3 -0
- package/src/lib/components/dataset/dataset-editor/upstream-changes-confirmation/upstream-changes-confirmation.component.spec.ts +23 -0
- package/src/lib/components/dataset/dataset-editor/upstream-changes-confirmation/upstream-changes-confirmation.component.ts +21 -0
- package/src/lib/components/dataset/dataset.component.html +317 -0
- package/src/lib/components/dataset/dataset.component.sass +73 -0
- package/src/lib/components/dataset/dataset.component.spec.ts +25 -0
- package/src/lib/components/dataset/dataset.component.ts +320 -0
- package/src/lib/components/datasource/create-datasource/advanced-settings/advanced-settings.component.html +133 -0
- package/src/lib/components/datasource/create-datasource/advanced-settings/advanced-settings.component.sass +51 -0
- package/src/lib/components/datasource/create-datasource/advanced-settings/advanced-settings.component.spec.ts +23 -0
- package/src/lib/components/datasource/create-datasource/advanced-settings/advanced-settings.component.ts +140 -0
- package/src/lib/components/datasource/create-datasource/api-access/api-access.component.html +257 -0
- package/src/lib/components/datasource/create-datasource/api-access/api-access.component.sass +0 -0
- package/src/lib/components/datasource/create-datasource/api-access/api-access.component.spec.ts +23 -0
- package/src/lib/components/datasource/create-datasource/api-access/api-access.component.ts +148 -0
- package/src/lib/components/datasource/create-datasource/create-datasource.component.html +430 -0
- package/src/lib/components/datasource/create-datasource/create-datasource.component.sass +162 -0
- package/src/lib/components/datasource/create-datasource/create-datasource.component.spec.ts +25 -0
- package/src/lib/components/datasource/create-datasource/create-datasource.component.ts +789 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-data.component.html +119 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-data.component.sass +8 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-data.component.spec.ts +25 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-data.component.ts +163 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-wizard/import-wizard.component.html +239 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-wizard/import-wizard.component.sass +0 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-wizard/import-wizard.component.spec.ts +23 -0
- package/src/lib/components/datasource/create-datasource/import-data/import-wizard/import-wizard.component.ts +182 -0
- package/src/lib/components/datasource/create-datasource/tabular-datasource/tabular-datasource.component.html +167 -0
- package/src/lib/components/datasource/create-datasource/tabular-datasource/tabular-datasource.component.sass +87 -0
- package/src/lib/components/datasource/create-datasource/tabular-datasource/tabular-datasource.component.spec.ts +23 -0
- package/src/lib/components/datasource/create-datasource/tabular-datasource/tabular-datasource.component.ts +164 -0
- package/src/lib/components/datasource/datasource.component.html +165 -0
- package/src/lib/components/datasource/datasource.component.sass +4 -0
- package/src/lib/components/datasource/datasource.component.spec.ts +25 -0
- package/src/lib/components/datasource/datasource.component.ts +174 -0
- package/src/lib/components/datasource/document-datasource/document-datasource.component.html +558 -0
- package/src/lib/components/datasource/document-datasource/document-datasource.component.sass +84 -0
- package/src/lib/components/datasource/document-datasource/document-datasource.component.spec.ts +25 -0
- package/src/lib/components/datasource/document-datasource/document-datasource.component.ts +351 -0
- package/src/lib/components/export-project/export-project.component.html +280 -0
- package/src/lib/components/export-project/export-project.component.sass +0 -0
- package/src/lib/components/export-project/export-project.component.spec.ts +23 -0
- package/src/lib/components/export-project/export-project.component.ts +29 -0
- package/src/lib/components/feeds/feed/feed.component.html +144 -0
- package/src/lib/components/feeds/feed/feed.component.sass +0 -0
- package/src/lib/components/feeds/feed/feed.component.spec.ts +25 -0
- package/src/lib/components/feeds/feed/feed.component.ts +102 -0
- package/src/lib/components/feeds/feeds.component.html +210 -0
- package/src/lib/components/feeds/feeds.component.sass +4 -0
- package/src/lib/components/feeds/feeds.component.spec.ts +25 -0
- package/src/lib/components/feeds/feeds.component.ts +163 -0
- package/src/lib/components/job-tasks/job-tasks.component.html +22 -0
- package/src/lib/components/job-tasks/job-tasks.component.sass +0 -0
- package/src/lib/components/job-tasks/job-tasks.component.spec.ts +25 -0
- package/src/lib/components/job-tasks/job-tasks.component.ts +19 -0
- package/src/lib/components/marketplace/marketplace.component.html +143 -0
- package/src/lib/components/marketplace/marketplace.component.sass +0 -0
- package/src/lib/components/marketplace/marketplace.component.spec.ts +23 -0
- package/src/lib/components/marketplace/marketplace.component.ts +73 -0
- package/src/lib/components/metadata/metadata.component.html +62 -0
- package/src/lib/components/metadata/metadata.component.sass +0 -0
- package/src/lib/components/metadata/metadata.component.spec.ts +25 -0
- package/src/lib/components/metadata/metadata.component.ts +67 -0
- package/src/lib/components/notification-groups/edit-notification-group/edit-notification-group.component.html +82 -0
- package/src/lib/components/notification-groups/edit-notification-group/edit-notification-group.component.sass +21 -0
- package/src/lib/components/notification-groups/edit-notification-group/edit-notification-group.component.spec.ts +25 -0
- package/src/lib/components/notification-groups/edit-notification-group/edit-notification-group.component.ts +123 -0
- package/src/lib/components/notification-groups/notification-groups.component.html +125 -0
- package/src/lib/components/notification-groups/notification-groups.component.sass +4 -0
- package/src/lib/components/notification-groups/notification-groups.component.spec.ts +25 -0
- package/src/lib/components/notification-groups/notification-groups.component.ts +98 -0
- package/src/lib/components/project-picker/project-picker.component.html +167 -0
- package/src/lib/components/project-picker/project-picker.component.sass +1 -0
- package/src/lib/components/project-picker/project-picker.component.spec.ts +25 -0
- package/src/lib/components/project-picker/project-picker.component.ts +138 -0
- package/src/lib/components/project-settings/project-link-selection/project-link-selection.component.html +120 -0
- package/src/lib/components/project-settings/project-link-selection/project-link-selection.component.sass +0 -0
- package/src/lib/components/project-settings/project-link-selection/project-link-selection.component.spec.ts +23 -0
- package/src/lib/components/project-settings/project-link-selection/project-link-selection.component.ts +161 -0
- package/src/lib/components/project-settings/project-settings.component.html +353 -0
- package/src/lib/components/project-settings/project-settings.component.sass +0 -0
- package/src/lib/components/project-settings/project-settings.component.spec.ts +23 -0
- package/src/lib/components/project-settings/project-settings.component.ts +178 -0
- package/src/lib/components/query-caching/edit-query-cache/edit-query-cache.component.html +96 -0
- package/src/lib/components/query-caching/edit-query-cache/edit-query-cache.component.sass +0 -0
- package/src/lib/components/query-caching/edit-query-cache/edit-query-cache.component.spec.ts +23 -0
- package/src/lib/components/query-caching/edit-query-cache/edit-query-cache.component.ts +48 -0
- package/src/lib/components/query-caching/query-caching.component.html +122 -0
- package/src/lib/components/query-caching/query-caching.component.sass +0 -0
- package/src/lib/components/query-caching/query-caching.component.spec.ts +23 -0
- package/src/lib/components/query-caching/query-caching.component.ts +184 -0
- package/src/lib/components/shared-with-me/shared-with-me.component.html +115 -0
- package/src/lib/components/shared-with-me/shared-with-me.component.sass +0 -0
- package/src/lib/components/shared-with-me/shared-with-me.component.spec.ts +23 -0
- package/src/lib/components/shared-with-me/shared-with-me.component.ts +123 -0
- package/src/lib/components/snapshots/snapshots.component.html +408 -0
- package/src/lib/components/snapshots/snapshots.component.sass +4 -0
- package/src/lib/components/snapshots/snapshots.component.spec.ts +25 -0
- package/src/lib/components/snapshots/snapshots.component.ts +286 -0
- package/src/lib/components/tag-picker/tag-picker.component.html +155 -0
- package/src/lib/components/tag-picker/tag-picker.component.sass +2 -0
- package/src/lib/components/tag-picker/tag-picker.component.spec.ts +25 -0
- package/src/lib/components/tag-picker/tag-picker.component.ts +82 -0
- package/src/lib/components/task-time-periods/task-time-periods.component.html +93 -0
- package/src/lib/components/task-time-periods/task-time-periods.component.sass +7 -0
- package/src/lib/components/task-time-periods/task-time-periods.component.spec.ts +25 -0
- package/src/lib/components/task-time-periods/task-time-periods.component.ts +50 -0
- package/src/lib/components/whitelisted-sql-functions/whitelisted-sql-functions.component.html +111 -0
- package/src/lib/components/whitelisted-sql-functions/whitelisted-sql-functions.component.sass +0 -0
- package/src/lib/components/whitelisted-sql-functions/whitelisted-sql-functions.component.spec.ts +25 -0
- package/src/lib/components/whitelisted-sql-functions/whitelisted-sql-functions.component.ts +38 -0
- package/src/lib/guards/dashboard-changes.guard.spec.ts +16 -0
- package/src/lib/guards/dashboard-changes.guard.ts +27 -0
- package/src/lib/ng-kinintel.module.ts +272 -0
- package/src/lib/objects/action-event.spec.ts +7 -0
- package/src/lib/objects/action-event.ts +27 -0
- package/src/lib/services/alert.service.spec.ts +16 -0
- package/src/lib/services/alert.service.ts +49 -0
- package/src/lib/services/dashboard.service.spec.ts +16 -0
- package/src/lib/services/dashboard.service.ts +79 -0
- package/src/lib/services/data-processor.service.spec.ts +16 -0
- package/src/lib/services/data-processor.service.ts +61 -0
- package/src/lib/services/data-search.service.spec.ts +16 -0
- package/src/lib/services/data-search.service.ts +31 -0
- package/src/lib/services/dataset.service.spec.ts +16 -0
- package/src/lib/services/dataset.service.ts +234 -0
- package/src/lib/services/datasource.service.spec.ts +16 -0
- package/src/lib/services/datasource.service.ts +116 -0
- package/src/lib/services/external.service.spec.ts +16 -0
- package/src/lib/services/external.service.ts +29 -0
- package/src/lib/services/feed.service.spec.ts +16 -0
- package/src/lib/services/feed.service.ts +48 -0
- package/src/lib/services/notification.service.spec.ts +16 -0
- package/src/lib/services/notification.service.ts +38 -0
- package/src/lib/services/project.service.spec.ts +16 -0
- package/src/lib/services/project.service.ts +146 -0
- package/src/lib/services/tag.service.spec.ts +16 -0
- package/src/lib/services/tag.service.ts +61 -0
- package/src/public-api.ts +46 -0
- package/src/test.ts +17 -0
- package/tsconfig.lib.json +24 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import {Component, Inject, OnInit, ViewChild} from '@angular/core';
|
|
2
|
+
import {
|
|
3
|
+
MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA,
|
|
4
|
+
MatLegacyDialog as MatDialog,
|
|
5
|
+
MatLegacyDialogRef as MatDialogRef
|
|
6
|
+
} from '@angular/material/legacy-dialog';
|
|
7
|
+
import {
|
|
8
|
+
SourceSelectorDialogComponent
|
|
9
|
+
} from '../../dashboard-editor/source-selector-dialog/source-selector-dialog.component';
|
|
10
|
+
import {DashboardService} from '../../../services/dashboard.service';
|
|
11
|
+
import * as lodash from 'lodash';
|
|
12
|
+
|
|
13
|
+
const _ = lodash.default;
|
|
14
|
+
import chroma from 'chroma-js';
|
|
15
|
+
import {DatasetService} from '../../../services/dataset.service';
|
|
16
|
+
import {EditDashboardAlertComponent} from '../configure-item/edit-dashboard-alert/edit-dashboard-alert.component';
|
|
17
|
+
import {
|
|
18
|
+
DatasetFilterComponent
|
|
19
|
+
} from '../../dataset/dataset-editor/dataset-filters/dataset-filter/dataset-filter.component';
|
|
20
|
+
import {Router} from '@angular/router';
|
|
21
|
+
import {DatasourceService} from '../../../services/datasource.service';
|
|
22
|
+
import {BehaviorSubject, Subject} from 'rxjs';
|
|
23
|
+
import {ActionEvent} from '../../../objects/action-event';
|
|
24
|
+
import {BaseChartDirective} from 'ng2-charts';
|
|
25
|
+
import regression from 'regression';
|
|
26
|
+
import {ProjectService} from '../../../services/project.service';
|
|
27
|
+
import {scales} from 'chart.js';
|
|
28
|
+
import visNetworkOptions from './vis-network-options.json';
|
|
29
|
+
import {CreateDatasetComponent} from '../../dataset/create-dataset/create-dataset.component';
|
|
30
|
+
import {
|
|
31
|
+
ChangeSourceWarningComponent
|
|
32
|
+
} from '../../data-explorer/change-source-warning/change-source-warning.component';
|
|
33
|
+
import {DatasetEditorComponent} from '../../dataset/dataset-editor/dataset-editor.component';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
selector: 'ki-configure-item',
|
|
37
|
+
templateUrl: './configure-item.component.html',
|
|
38
|
+
styleUrls: ['./configure-item.component.sass'],
|
|
39
|
+
host: {class: 'configure-dialog'}
|
|
40
|
+
})
|
|
41
|
+
export class ConfigureItemComponent implements OnInit {
|
|
42
|
+
|
|
43
|
+
@ViewChild(BaseChartDirective) chart: BaseChartDirective;
|
|
44
|
+
@ViewChild('datasetEditorComponent') datasetEditorComponent: DatasetEditorComponent;
|
|
45
|
+
|
|
46
|
+
public grid;
|
|
47
|
+
public chartData: any;
|
|
48
|
+
public metric: any = {};
|
|
49
|
+
public textData: any = {};
|
|
50
|
+
public networkData: any = {};
|
|
51
|
+
public wordCloud: any = {};
|
|
52
|
+
public imageData: any = {};
|
|
53
|
+
public tabular: any = {};
|
|
54
|
+
public tableCells: any = {};
|
|
55
|
+
public general: any = {};
|
|
56
|
+
public dependencies: any = {};
|
|
57
|
+
public callToAction: any = {};
|
|
58
|
+
public actionItem: any = {};
|
|
59
|
+
public dashboard;
|
|
60
|
+
public dashboardItemType;
|
|
61
|
+
public dashboardDatasetInstance: any;
|
|
62
|
+
public dashboards: any = [];
|
|
63
|
+
public sharedDashboards: any = [];
|
|
64
|
+
public privateDashboards: any = [];
|
|
65
|
+
public dashboardParameters: any = [];
|
|
66
|
+
public dashboardParamValues: any = [];
|
|
67
|
+
public actionEvents: ActionEvent[] = [];
|
|
68
|
+
public admin: boolean;
|
|
69
|
+
public filterFields: any = [];
|
|
70
|
+
public chartTypes = ['line', 'bar', 'pie', 'doughnut', 'scatter'];
|
|
71
|
+
public metricFormats = ['Currency', 'Number', 'Percentage'];
|
|
72
|
+
public currencies = [
|
|
73
|
+
{
|
|
74
|
+
name: 'British Pound (£)',
|
|
75
|
+
value: 'GBP',
|
|
76
|
+
symbol: '£'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'US Dollar ($)',
|
|
80
|
+
value: 'USD',
|
|
81
|
+
symbol: '$'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Euro (€)',
|
|
85
|
+
value: 'EUR',
|
|
86
|
+
symbol: '€'
|
|
87
|
+
}
|
|
88
|
+
];
|
|
89
|
+
public filterJunction = {
|
|
90
|
+
logic: 'AND',
|
|
91
|
+
filters: [{
|
|
92
|
+
lhsExpression: '',
|
|
93
|
+
rhsExpression: '',
|
|
94
|
+
filterType: ''
|
|
95
|
+
}],
|
|
96
|
+
filterJunctions: []
|
|
97
|
+
};
|
|
98
|
+
public columnFormats: any = [
|
|
99
|
+
{
|
|
100
|
+
title: 'Number',
|
|
101
|
+
type: 'number'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: 'Currency',
|
|
105
|
+
type: 'currency'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
title: 'Percentage',
|
|
109
|
+
type: 'percentage'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
title: 'Date & Time',
|
|
113
|
+
type: 'datetime'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
title: 'Comparison',
|
|
117
|
+
type: 'comparison'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: 'Link',
|
|
121
|
+
type: 'link'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: 'Custom',
|
|
125
|
+
type: 'custom'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: 'Hide Column',
|
|
129
|
+
type: 'hide'
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
public showAlertWarning = false;
|
|
133
|
+
public dapFeeds: any = [];
|
|
134
|
+
public sideOpen = false;
|
|
135
|
+
public openSide = new BehaviorSubject(false);
|
|
136
|
+
public dataset: any;
|
|
137
|
+
public edgeDataset: any;
|
|
138
|
+
public fullEdgeDataset: any;
|
|
139
|
+
public _ = _;
|
|
140
|
+
public docColumns = new Subject();
|
|
141
|
+
public canSetAlerts = false;
|
|
142
|
+
public colourPalettes: any = [];
|
|
143
|
+
public visNetworkOptions = visNetworkOptions;
|
|
144
|
+
public availableNodeOptions: string[] = [];
|
|
145
|
+
public availableEdgeOptions: string[] = [];
|
|
146
|
+
public datasetNodes: any = [];
|
|
147
|
+
public datasetEdges: any = [];
|
|
148
|
+
public nodeGroups: any;
|
|
149
|
+
public widgetParameters: any = {};
|
|
150
|
+
|
|
151
|
+
protected readonly Array = Array;
|
|
152
|
+
protected readonly Object = Object;
|
|
153
|
+
|
|
154
|
+
constructor(public dialogRef: MatDialogRef<ConfigureItemComponent>,
|
|
155
|
+
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
156
|
+
private dialog: MatDialog,
|
|
157
|
+
private dashboardService: DashboardService,
|
|
158
|
+
private datasetService: DatasetService,
|
|
159
|
+
private datasourceService: DatasourceService,
|
|
160
|
+
private router: Router,
|
|
161
|
+
private projectService: ProjectService) {
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async ngOnInit(): Promise<any> {
|
|
165
|
+
this.availableNodeOptions = Object.keys(this.visNetworkOptions.nodes);
|
|
166
|
+
this.availableEdgeOptions = Object.keys(this.visNetworkOptions.edges);
|
|
167
|
+
|
|
168
|
+
this.grid = this.data.grid;
|
|
169
|
+
this.dashboard = this.data.dashboard;
|
|
170
|
+
this.dashboardDatasetInstance = this.data.dashboardDatasetInstance;
|
|
171
|
+
this.dashboardItemType = this.data.dashboardItemType;
|
|
172
|
+
this.admin = !!this.data.admin;
|
|
173
|
+
this.actionEvents = this.data.actionEvents || [];
|
|
174
|
+
this.canSetAlerts = this.projectService.doesActiveProjectHavePrivilege('alertmanage');
|
|
175
|
+
|
|
176
|
+
if (this.actionEvents.length) {
|
|
177
|
+
this.columnFormats.push({
|
|
178
|
+
title: 'Action',
|
|
179
|
+
type: 'action'
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!this.dashboardItemType.colourMode) {
|
|
184
|
+
this.dashboardItemType.colourMode = 'lrgb';
|
|
185
|
+
}
|
|
186
|
+
if (!this.dashboardItemType.borderColor || !Array.isArray(this.dashboardItemType.borderColor)) {
|
|
187
|
+
this.dashboardItemType.borderColor = [_.isString(this.dashboardItemType.borderColor) ? this.dashboardItemType.borderColor : ''];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (!this.dashboardDatasetInstance) {
|
|
191
|
+
this.selectedDatasource();
|
|
192
|
+
} else {
|
|
193
|
+
this.loadDashboardItems();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
this.dashboardService.getDashboards(
|
|
197
|
+
'',
|
|
198
|
+
'100',
|
|
199
|
+
'0'
|
|
200
|
+
).toPromise().then(dashboards => {
|
|
201
|
+
this.dashboards = dashboards;
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
this.dashboardService.getDashboards(
|
|
205
|
+
'',
|
|
206
|
+
'100',
|
|
207
|
+
'0',
|
|
208
|
+
null
|
|
209
|
+
).toPromise().then(dashboards => {
|
|
210
|
+
this.sharedDashboards = dashboards;
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
this.dashboardService.getDashboards(
|
|
214
|
+
'',
|
|
215
|
+
'100',
|
|
216
|
+
'0',
|
|
217
|
+
0
|
|
218
|
+
).toPromise().then(dashboards => {
|
|
219
|
+
this.privateDashboards = dashboards;
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
this.dapFeeds = await this.datasetService.getDatasets(
|
|
223
|
+
'',
|
|
224
|
+
'1000',
|
|
225
|
+
'0',
|
|
226
|
+
'',
|
|
227
|
+
''
|
|
228
|
+
).toPromise();
|
|
229
|
+
|
|
230
|
+
this.openSide.subscribe((open: boolean) => {
|
|
231
|
+
if (open) {
|
|
232
|
+
document.getElementById('sidebarWrapper2')?.classList.add('z-20');
|
|
233
|
+
document.getElementById('sidebarWrapper2')?.classList.remove('-z-10');
|
|
234
|
+
this.docColumns.next(this.filterFields);
|
|
235
|
+
} else {
|
|
236
|
+
setTimeout(() => {
|
|
237
|
+
document.getElementById('sidebarWrapper2')?.classList.add('-z-10');
|
|
238
|
+
document.getElementById('sidebarWrapper2')?.classList.remove('z-20');
|
|
239
|
+
}, 700);
|
|
240
|
+
}
|
|
241
|
+
this.sideOpen = open;
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
const project: any = await this.projectService.getProject(this.projectService.activeProject.getValue().projectKey);
|
|
245
|
+
if (project.settings.palettes && project.settings.palettes.length) {
|
|
246
|
+
this.colourPalettes = project.settings.palettes;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
public updateChart(newValue, index) {
|
|
251
|
+
this.dashboardItemType.backgroundColor[index] = newValue;
|
|
252
|
+
setTimeout(() => {
|
|
253
|
+
this.chart.chart.update();
|
|
254
|
+
}, 50);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public changeSource() {
|
|
258
|
+
const dialogRef = this.dialog.open(CreateDatasetComponent, {
|
|
259
|
+
width: '1200px',
|
|
260
|
+
height: '800px',
|
|
261
|
+
data: {
|
|
262
|
+
admin: this.admin
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
266
|
+
if (res) {
|
|
267
|
+
const dialogRef2 = this.dialog.open(ChangeSourceWarningComponent, {
|
|
268
|
+
width: '700px',
|
|
269
|
+
height: '275px'
|
|
270
|
+
});
|
|
271
|
+
dialogRef2.afterClosed().subscribe(proceed => {
|
|
272
|
+
if (proceed) {
|
|
273
|
+
this.dashboardDatasetInstance.datasetInstanceId = res.datasetInstanceId;
|
|
274
|
+
this.dashboardDatasetInstance.datasourceInstanceKey = res.datasourceInstanceKey;
|
|
275
|
+
this.dashboardDatasetInstance.source = {
|
|
276
|
+
title: res.title,
|
|
277
|
+
datasetInstanceId: res.datasetInstanceId,
|
|
278
|
+
datasourceInstanceKey: res.datasourceInstanceKey,
|
|
279
|
+
type: null
|
|
280
|
+
};
|
|
281
|
+
const transformation = this.dashboardDatasetInstance.transformationInstances[0];
|
|
282
|
+
if (transformation) {
|
|
283
|
+
this.datasetEditorComponent.excludeUpstreamTransformations(transformation, true);
|
|
284
|
+
} else {
|
|
285
|
+
this.datasetEditorComponent.evaluateDataset(true);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
public selectedDatasource() {
|
|
294
|
+
const dialogRef = this.dialog.open(SourceSelectorDialogComponent, {
|
|
295
|
+
width: '1200px',
|
|
296
|
+
height: '800px',
|
|
297
|
+
data: {
|
|
298
|
+
dashboard: this.dashboard,
|
|
299
|
+
dashboardItemInstanceKey: this.data.itemInstanceKey,
|
|
300
|
+
dashboardDatasetInstance: this.dashboardDatasetInstance || {
|
|
301
|
+
dashboardId: this.dashboard.id,
|
|
302
|
+
instanceKey: this.data.itemInstanceKey,
|
|
303
|
+
transformationInstances: [],
|
|
304
|
+
parameterValues: {},
|
|
305
|
+
parameters: []
|
|
306
|
+
},
|
|
307
|
+
admin: this.admin
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
dialogRef.afterClosed().subscribe(dashboardDatasetInstance => {
|
|
312
|
+
this.dashboardDatasetInstance = dashboardDatasetInstance;
|
|
313
|
+
this.loadDashboardItems();
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
public pickNetworkEdgeDataset() {
|
|
318
|
+
const dialogRef = this.dialog.open(SourceSelectorDialogComponent, {
|
|
319
|
+
width: '1200px',
|
|
320
|
+
height: '800px',
|
|
321
|
+
data: {
|
|
322
|
+
dashboard: this.dashboard,
|
|
323
|
+
dashboardItemInstanceKey: this.data.itemInstanceKey,
|
|
324
|
+
dashboardDatasetInstance: this.dashboardDatasetInstance || {
|
|
325
|
+
dashboardId: this.dashboard.id,
|
|
326
|
+
instanceKey: this.data.itemInstanceKey,
|
|
327
|
+
transformationInstances: [],
|
|
328
|
+
parameterValues: {},
|
|
329
|
+
parameters: []
|
|
330
|
+
},
|
|
331
|
+
admin: this.admin
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
dialogRef.afterClosed().subscribe(async dashboardDatasetInstance => {
|
|
336
|
+
this.networkData.edgeDatasetId = dashboardDatasetInstance.datasetInstanceId;
|
|
337
|
+
this.networkData.edgeDatasourceKey = dashboardDatasetInstance.datasourceInstanceKey;
|
|
338
|
+
|
|
339
|
+
await this.loadEdgeDataset();
|
|
340
|
+
|
|
341
|
+
this.networkData.edgeDatasetTitle = dashboardDatasetInstance.title || this.edgeDataset.instanceTitle;
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
public async loadEdgeDataset() {
|
|
346
|
+
const datasetInstanceSummary = {
|
|
347
|
+
datasetInstanceId: this.networkData.edgeDatasetId,
|
|
348
|
+
datasourceInstanceKey: this.networkData.edgeDatasourceKey,
|
|
349
|
+
transformationInstances: [],
|
|
350
|
+
parameterValues: {},
|
|
351
|
+
parameters: {}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
this.edgeDataset = await this.datasetService.evaluateDataset(
|
|
355
|
+
datasetInstanceSummary,
|
|
356
|
+
'0',
|
|
357
|
+
'1'
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
public clearEdgeDataset() {
|
|
362
|
+
delete this.networkData.edgeDatasetTitle;
|
|
363
|
+
delete this.networkData.edgeDatasetId;
|
|
364
|
+
delete this.networkData.edgeDatasourceKey;
|
|
365
|
+
|
|
366
|
+
this.edgeDataset = null;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
public addGroupOption(nodeGroup: string) {
|
|
370
|
+
if (!this.networkData.nodeGroupOptions) {
|
|
371
|
+
this.networkData.nodeGroupOptions = {};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (!this.networkData.nodeGroupOptions[nodeGroup]) {
|
|
375
|
+
this.networkData.nodeGroupOptions[nodeGroup] = {options: []};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
this.networkData.nodeGroupOptions[nodeGroup].options.unshift({});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
public addOption(typeOptions: string) {
|
|
382
|
+
if (!this.networkData[typeOptions] || !Array.isArray(this.networkData[typeOptions])) {
|
|
383
|
+
this.networkData[typeOptions] = [];
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
this.networkData[typeOptions].unshift({});
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
public updateOptions(nodeOption: any, datasetType: string) {
|
|
390
|
+
const option = nodeOption.key;
|
|
391
|
+
const column = nodeOption.column;
|
|
392
|
+
let value = nodeOption.value;
|
|
393
|
+
let allData = this.dataset.allData;
|
|
394
|
+
|
|
395
|
+
if (datasetType === 'datasetEdges') {
|
|
396
|
+
allData = this.fullEdgeDataset ? this.fullEdgeDataset.allData : this.dataset.allData;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
this[datasetType].forEach(item => {
|
|
400
|
+
if (column) {
|
|
401
|
+
const dataset = _.find(allData, {id: item.id});
|
|
402
|
+
if (dataset) {
|
|
403
|
+
value = dataset[column];
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const existing = _.find(item.options, {key: option});
|
|
408
|
+
if (existing) {
|
|
409
|
+
existing.value = value;
|
|
410
|
+
} else {
|
|
411
|
+
item.options.unshift({key: option, value});
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
public dataLoaded(dataset) {
|
|
417
|
+
this.dataset = dataset;
|
|
418
|
+
this.filterFields = _.map(dataset.columns, column => {
|
|
419
|
+
return {
|
|
420
|
+
title: column.title,
|
|
421
|
+
name: column.name
|
|
422
|
+
};
|
|
423
|
+
});
|
|
424
|
+
this.updateMetricDataValues();
|
|
425
|
+
this.setChartData();
|
|
426
|
+
this.setNetworkChartData();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
public async ctaUpdate(cta) {
|
|
430
|
+
this.dashboardParameters = [];
|
|
431
|
+
if (cta) {
|
|
432
|
+
if (cta.type && cta.type === 'dashboard') {
|
|
433
|
+
if (!cta.parameters) {
|
|
434
|
+
cta.parameters = {};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const dashboard: any = await this.dashboardService.getDashboard(cta.value);
|
|
438
|
+
if (dashboard.layoutSettings.parameters) {
|
|
439
|
+
this.dashboardParameters = _.values(dashboard.layoutSettings.parameters);
|
|
440
|
+
|
|
441
|
+
setTimeout(() => {
|
|
442
|
+
const el = document.getElementsByClassName('dashboard-param-pick').item(0);
|
|
443
|
+
if (el) {
|
|
444
|
+
el.scrollIntoView();
|
|
445
|
+
}
|
|
446
|
+
}, 0);
|
|
447
|
+
}
|
|
448
|
+
} else {
|
|
449
|
+
cta.parameters = {};
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
public setImageData(column) {
|
|
455
|
+
this.imageData.source = column ? this.dataset.allData[0][column] : null;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
public setColumn(column) {
|
|
459
|
+
if (!this.tableCells[column] || Array.isArray(this.tableCells[column])) {
|
|
460
|
+
this.tableCells[column] = {};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
public setColumnFormat(format) {
|
|
465
|
+
if (format === 'undefined') {
|
|
466
|
+
delete this.tableCells[this.tableCells.column].type;
|
|
467
|
+
} else {
|
|
468
|
+
if (!this.tableCells[this.tableCells.column].data || Array.isArray(this.tableCells[this.tableCells.column].data)) {
|
|
469
|
+
this.tableCells[this.tableCells.column].data = {};
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
public editAlert(alert, index?) {
|
|
475
|
+
const dialogRef = this.dialog.open(EditDashboardAlertComponent, {
|
|
476
|
+
width: '900px',
|
|
477
|
+
height: '750px',
|
|
478
|
+
data: {
|
|
479
|
+
alert,
|
|
480
|
+
filterFields: this.filterFields
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
dialogRef.afterClosed().subscribe(alertItem => {
|
|
485
|
+
if (alertItem) {
|
|
486
|
+
if (!this.dashboardDatasetInstance.alerts) {
|
|
487
|
+
this.dashboardDatasetInstance.alerts = [];
|
|
488
|
+
}
|
|
489
|
+
if (index >= 0) {
|
|
490
|
+
this.dashboardDatasetInstance.alerts[index] = alertItem;
|
|
491
|
+
} else {
|
|
492
|
+
this.dashboardDatasetInstance.alerts.push(alertItem);
|
|
493
|
+
this.showAlertWarning = !this.dashboard.alertsEnabled;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
public deleteAlert(index) {
|
|
500
|
+
const message = 'Are you sure you would like to delete this alert?';
|
|
501
|
+
if (window.confirm(message)) {
|
|
502
|
+
this.dashboardDatasetInstance.alerts.splice(index, 1);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
public getAlertDetails(alert) {
|
|
507
|
+
let details = '';
|
|
508
|
+
const filter = alert.filterTransformation.filters[0];
|
|
509
|
+
|
|
510
|
+
if (filter) {
|
|
511
|
+
const filterType = DatasetFilterComponent.getFilterType(filter.filterType);
|
|
512
|
+
details += `<span class="font-medium">Where</span> ${filter.lhsExpression} `;
|
|
513
|
+
details += filterType ? filterType.label : '';
|
|
514
|
+
details += ` ${filter.rhsExpression}`;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const matchRule = alert.matchRuleConfiguration;
|
|
518
|
+
if (matchRule && alert.matchRuleType === 'rowcount') {
|
|
519
|
+
if (matchRule.matchType === 'equals') {
|
|
520
|
+
details += ` <span class="font-medium">And</span> exactly ${matchRule.value} row${matchRule.value > 1 ? 's' : ''} returned`;
|
|
521
|
+
} else if (matchRule.matchType === 'greater') {
|
|
522
|
+
details += ` <span class="font-medium">And</span> more than ${matchRule.value} row${matchRule.value > 1 ? 's' : ''} returned`;
|
|
523
|
+
} else if (matchRule.matchType === 'less') {
|
|
524
|
+
details += ` <span class="font-medium">And</span> less than ${matchRule.value} row${matchRule.value > 1 ? 's' : ''} returned`;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return details;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
public setCallToActionItem(d1: any, d2: any) {
|
|
532
|
+
if (!d2) {
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
if (d2.type === 'custom') {
|
|
536
|
+
return d1.type === 'custom';
|
|
537
|
+
} else if (d2.type === 'dashboard' || d2.type === 'feed') {
|
|
538
|
+
return d1.value === d2.value;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
public ctaSelectOption(c1: any, c2: any) {
|
|
543
|
+
return c1 === c2;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public paletteSelectOption(c1: any, c2: any) {
|
|
547
|
+
if (!c2) {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
return c1.name === c2.name;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
public depSelection(c1: any, c2: any) {
|
|
554
|
+
if (!c2) {
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
return c1.type === c2.type;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
public backgroundColourUpdate() {
|
|
561
|
+
const colours = this.dashboardItemType.colourPalette ? this.dashboardItemType.colourPalette.colours : [
|
|
562
|
+
this.dashboardItemType.backgroundColorFrom || 'black',
|
|
563
|
+
this.dashboardItemType.backgroundColorTo || 'black'
|
|
564
|
+
];
|
|
565
|
+
|
|
566
|
+
if (this.dashboardItemType.colourMode !== 'repeat') {
|
|
567
|
+
const chromaScale = chroma.scale(colours);
|
|
568
|
+
chromaScale.mode(this.dashboardItemType.colourMode);
|
|
569
|
+
this.dashboardItemType.backgroundColor = chromaScale.colors(this.dashboardItemType.labels.length);
|
|
570
|
+
} else {
|
|
571
|
+
this.repeatColours(colours);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
setTimeout(() => {
|
|
575
|
+
this.setChartData();
|
|
576
|
+
}, 50);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
public async updateInstanceFilterFields(change, instanceKey) {
|
|
580
|
+
if (change.type === 'MATCH') {
|
|
581
|
+
const selectedDatasetInstance = _.find(this.dashboard.datasetInstances, {instanceKey});
|
|
582
|
+
if (selectedDatasetInstance) {
|
|
583
|
+
const mappedParams = {};
|
|
584
|
+
_.forEach(selectedDatasetInstance.parameterValues, (value, key) => {
|
|
585
|
+
if (_.isString(value) && value.includes('{{')) {
|
|
586
|
+
const globalKey = value.replace('{{', '').replace('}}', '');
|
|
587
|
+
if (this.dashboard.layoutSettings.parameters && this.dashboard.layoutSettings.parameters[globalKey]) {
|
|
588
|
+
mappedParams[key] = this.dashboard.layoutSettings.parameters[globalKey].value;
|
|
589
|
+
}
|
|
590
|
+
} else {
|
|
591
|
+
mappedParams[key] = value;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
const datasetInstanceSummary = {
|
|
596
|
+
datasetInstanceId: selectedDatasetInstance.datasetInstanceId,
|
|
597
|
+
datasourceInstanceKey: selectedDatasetInstance.datasourceInstanceKey,
|
|
598
|
+
transformationInstances: selectedDatasetInstance.transformationInstances,
|
|
599
|
+
parameterValues: mappedParams,
|
|
600
|
+
parameters: selectedDatasetInstance.parameters
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
this.dataset = await this.datasetService.evaluateDataset(datasetInstanceSummary, '0', '10');
|
|
604
|
+
|
|
605
|
+
this.dependencies[instanceKey].filterFields = _.map(this.dataset.columns, column => {
|
|
606
|
+
return {
|
|
607
|
+
title: column.title,
|
|
608
|
+
name: column.name
|
|
609
|
+
};
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
public async saveDashboard() {
|
|
617
|
+
const grid = this.grid.save(true);
|
|
618
|
+
if (!this.dashboard.layoutSettings) {
|
|
619
|
+
this.dashboard.layoutSettings = {};
|
|
620
|
+
}
|
|
621
|
+
this.dashboard.layoutSettings.grid = grid;
|
|
622
|
+
|
|
623
|
+
if (!this.dashboard.layoutSettings.charts) {
|
|
624
|
+
this.dashboard.layoutSettings.charts = {};
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
this.dashboard.layoutSettings.charts[this.dashboardDatasetInstance.instanceKey] = this.dashboardItemType;
|
|
628
|
+
|
|
629
|
+
this.mapComponentDataToDashboardInstance();
|
|
630
|
+
|
|
631
|
+
if (!this.networkData.nodeLevelOptions || Array.isArray(this.networkData.nodeLevelOptions)) {
|
|
632
|
+
this.networkData.nodeLevelOptions = {};
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
this.datasetNodes.forEach(node => {
|
|
636
|
+
if (node.options && node.options.length) {
|
|
637
|
+
this.networkData.nodeLevelOptions[node.id] = node.options;
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
if (!this.networkData.edgeLevelOptions || !Array.isArray(this.networkData.edgeLevelOptions)) {
|
|
642
|
+
this.networkData.edgeLevelOptions = [];
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
this.datasetEdges.forEach(edge => {
|
|
646
|
+
if (edge.options && edge.options.length) {
|
|
647
|
+
this.networkData.edgeLevelOptions.push(edge);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
// If there is an old instance remove it, and then add the new/updated one.
|
|
652
|
+
_.remove(this.dashboard.datasetInstances, {instanceKey: this.dashboardDatasetInstance.instanceKey});
|
|
653
|
+
_.remove(this.dashboardDatasetInstance.transformationInstances, {type: 'paging'});
|
|
654
|
+
this.dashboard.datasetInstances.push(this.dashboardDatasetInstance);
|
|
655
|
+
|
|
656
|
+
this.dialogRef.close(this.dashboardDatasetInstance);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
public resetDefaultColours() {
|
|
660
|
+
this.dashboardItemType.backgroundColorFrom = null;
|
|
661
|
+
this.dashboardItemType.backgroundColorTo = null;
|
|
662
|
+
this.setChartData();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
public updateColourPalette() {
|
|
666
|
+
if (this.dashboardItemType.colourPalette) {
|
|
667
|
+
this.dashboardItemType.colourMode = 'repeat';
|
|
668
|
+
this.repeatColours(this.dashboardItemType.colourPalette.colours);
|
|
669
|
+
this.setChartData();
|
|
670
|
+
} else {
|
|
671
|
+
this.backgroundColourUpdate();
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
public async setChartData() {
|
|
676
|
+
if (this.dashboardItemType.xAxis && this.dashboardItemType.yAxis) {
|
|
677
|
+
let data: any;
|
|
678
|
+
|
|
679
|
+
if (!this.dashboardItemType.seriesColumn) {
|
|
680
|
+
if (this.dashboardItemType.type !== 'pie' && this.dashboardItemType.type !== 'doughnut') {
|
|
681
|
+
data = _.map(this.dataset.allData, item => {
|
|
682
|
+
return {x: item[this.dashboardItemType.xAxis], y: item[this.dashboardItemType.yAxis]};
|
|
683
|
+
});
|
|
684
|
+
} else {
|
|
685
|
+
data = _.map(this.dataset.allData, item => {
|
|
686
|
+
return item[this.dashboardItemType.yAxis];
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
this.chartData = [
|
|
691
|
+
{
|
|
692
|
+
data,
|
|
693
|
+
label: _.find(this.filterFields, {name: this.dashboardItemType.xAxis}).title,
|
|
694
|
+
fill: !!this.dashboardItemType.fill,
|
|
695
|
+
borderColor: (this.dashboardItemType.type === 'pie' || this.dashboardItemType.type === 'doughnut') ? chroma('white').alpha(0.2).hex() : this.dashboardItemType.borderColor,
|
|
696
|
+
backgroundColor: (this.dashboardItemType.type === 'line' || this.dashboardItemType.type === 'scatter') ?
|
|
697
|
+
(Array.isArray(this.dashboardItemType.borderColor) ? _.map(this.dashboardItemType.borderColor, colour => {
|
|
698
|
+
return chroma(colour || 'black').alpha(0.5).hex();
|
|
699
|
+
}) : chroma(this.dashboardItemType.borderColor || 'black').alpha(0.5).hex()) : this.dashboardItemType.backgroundColor,
|
|
700
|
+
tension: 0.2,
|
|
701
|
+
pointBackgroundColor: this.dashboardItemType.borderColor ? this.dashboardItemType.borderColor[0] : null,
|
|
702
|
+
pointBorderColor: this.dashboardItemType.borderColor ? this.dashboardItemType.borderColor[0] : null
|
|
703
|
+
}
|
|
704
|
+
];
|
|
705
|
+
this.dashboardItemType.labels = _.map(this.dataset.allData, item => {
|
|
706
|
+
return item[this.dashboardItemType.xAxis];
|
|
707
|
+
});
|
|
708
|
+
} else {
|
|
709
|
+
const chartData = [];
|
|
710
|
+
const series = _.uniq(_.map(this.dataset.allData, this.dashboardItemType.seriesColumn));
|
|
711
|
+
series.forEach((value, index) => {
|
|
712
|
+
const seriesResults = _.filter(this.dataset.allData, allData => {
|
|
713
|
+
return allData[this.dashboardItemType.seriesColumn] === value;
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
chartData.push({
|
|
717
|
+
data: _.map(seriesResults, item => {
|
|
718
|
+
return {x: item[this.dashboardItemType.xAxis], y: item[this.dashboardItemType.yAxis]};
|
|
719
|
+
}),
|
|
720
|
+
label: value,
|
|
721
|
+
fill: !!this.dashboardItemType.fill,
|
|
722
|
+
borderColor: this.dashboardItemType.borderColor,
|
|
723
|
+
backgroundColor: (this.dashboardItemType.type === 'line' || this.dashboardItemType.type === 'scatter') ?
|
|
724
|
+
(Array.isArray(this.dashboardItemType.borderColor) ? _.map(this.dashboardItemType.borderColor, colour => {
|
|
725
|
+
return chroma(colour || 'black').alpha(0.5).hex();
|
|
726
|
+
}) : chroma(this.dashboardItemType.borderColor || 'black').alpha(0.5).hex()) : this.dashboardItemType.backgroundColor[index],
|
|
727
|
+
tension: 0.2,
|
|
728
|
+
pointBackgroundColor: this.dashboardItemType.borderColor[index],
|
|
729
|
+
pointBorderColor: this.dashboardItemType.borderColor[index]
|
|
730
|
+
});
|
|
731
|
+
});
|
|
732
|
+
this.chartData = chartData;
|
|
733
|
+
this.dashboardItemType.labels = _.uniq(_.map(this.dataset.allData, item => {
|
|
734
|
+
return item[this.dashboardItemType.xAxis];
|
|
735
|
+
}));
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (this.dashboardItemType.trendLine &&
|
|
739
|
+
this.dashboardItemType.type !== 'pie' &&
|
|
740
|
+
this.dashboardItemType.type !== 'doughnut') {
|
|
741
|
+
|
|
742
|
+
let trendLine = [];
|
|
743
|
+
let trendLabel = 'Trend';
|
|
744
|
+
if (this.dashboardItemType.trendLine === 'average') {
|
|
745
|
+
trendLabel = 'Average';
|
|
746
|
+
const trendData = [];
|
|
747
|
+
this.chartData.forEach(dataItem => {
|
|
748
|
+
trendData.push(_.map(dataItem.data, 'y'));
|
|
749
|
+
});
|
|
750
|
+
const average = _.flatMap(trendData).reduce((p, c) => p + c, 0) / _.flatMap(trendData).length;
|
|
751
|
+
trendLine = _.fill(_.range(0, _.flatMap(trendData).length), average, 0, _.flatMap(trendData).length);
|
|
752
|
+
} else if (this.dashboardItemType.trendLine === 'logarithmic' ||
|
|
753
|
+
this.dashboardItemType.trendLine === 'linear' ||
|
|
754
|
+
this.dashboardItemType.trendLine === 'power' ||
|
|
755
|
+
this.dashboardItemType.trendLine === 'exponential') {
|
|
756
|
+
|
|
757
|
+
const trendLineData = _.map(this.dataset.allData, (item, index) => {
|
|
758
|
+
return {x: index + 1, y: item[this.dashboardItemType.yAxis]};
|
|
759
|
+
}).filter(({x, y}) => {
|
|
760
|
+
return (
|
|
761
|
+
typeof x === typeof y &&
|
|
762
|
+
!isNaN(x) &&
|
|
763
|
+
!isNaN(y) &&
|
|
764
|
+
Math.abs(x) !== Infinity &&
|
|
765
|
+
Math.abs(y) !== Infinity
|
|
766
|
+
);
|
|
767
|
+
}).map(({x, y}) => {
|
|
768
|
+
return [x, y];
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
const trendLineResults = regression[this.dashboardItemType.trendLine](trendLineData);
|
|
772
|
+
trendLine = trendLineResults.points.map(([x, y]) => {
|
|
773
|
+
return y;
|
|
774
|
+
});
|
|
775
|
+
} else {
|
|
776
|
+
trendLine = _.map(this.dataset.allData, item => {
|
|
777
|
+
return item[this.dashboardItemType.trendLine];
|
|
778
|
+
});
|
|
779
|
+
trendLabel = _.find(this.filterFields, {name: this.dashboardItemType.trendLine}).title;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
this.chartData.push({
|
|
783
|
+
type: 'line',
|
|
784
|
+
data: trendLine,
|
|
785
|
+
label: trendLabel,
|
|
786
|
+
borderColor: this.dashboardItemType.trendLineColour,
|
|
787
|
+
fill: false,
|
|
788
|
+
order: -1,
|
|
789
|
+
tension: 0.15,
|
|
790
|
+
pointBackgroundColor: this.dashboardItemType.trendLineColour,
|
|
791
|
+
pointBorderColor: this.dashboardItemType.trendLineColour
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
public updateMetricDataValues() {
|
|
798
|
+
if (this.metric.main) {
|
|
799
|
+
this.metric.mainValue = _.isNaN(Number(this.dataset.allData[0][this.metric.main])) ? this.dataset.allData[0][this.metric.main] : Number(this.dataset.allData[0][this.metric.main]);
|
|
800
|
+
this.metric.title = _.startCase(this.metric.main);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
if (this.metric.subMetric) {
|
|
804
|
+
this.metric.subValue = Number(this.dataset.allData[0][this.metric.subMetric]);
|
|
805
|
+
this.metric.subTitle = _.startCase(this.metric.subMetric);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
if (this.metric.showSubChange) {
|
|
809
|
+
this.metric.difference = Math.abs(this.metric.mainValue - this.metric.subValue);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
private mapLayoutSettingsToComponentData() {
|
|
814
|
+
_.forEach(this.dashboard.layoutSettings, (data, key) => {
|
|
815
|
+
if (key !== 'grid') {
|
|
816
|
+
const defaultValue = _.isPlainObject(this[key]) ? {} : [];
|
|
817
|
+
this[key] = Object.keys(data).length ?
|
|
818
|
+
(data[this.dashboardDatasetInstance.instanceKey] && Object.keys(data[this.dashboardDatasetInstance.instanceKey]).length ?
|
|
819
|
+
data[this.dashboardDatasetInstance.instanceKey] : defaultValue) : defaultValue;
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
private mapComponentDataToDashboardInstance() {
|
|
825
|
+
const layoutSettings = ['metric', 'dependencies', 'tabular', 'tableCells', 'general', 'imageData', 'textData', 'callToAction', 'wordCloud', 'actionItem', 'networkData'];
|
|
826
|
+
layoutSettings.forEach(setting => {
|
|
827
|
+
if (!this.dashboard.layoutSettings[setting]) {
|
|
828
|
+
this.dashboard.layoutSettings[setting] = {};
|
|
829
|
+
}
|
|
830
|
+
const defaultData = _.isPlainObject(this[setting]) ? {} : [];
|
|
831
|
+
this.dashboard.layoutSettings[setting][this.dashboardDatasetInstance.instanceKey] = this[setting] || defaultData;
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
private repeatColours(colours: string[]) {
|
|
836
|
+
this.dashboardItemType.backgroundColor = [];
|
|
837
|
+
this.dashboardItemType.borderColor = [];
|
|
838
|
+
while (this.dashboardItemType.backgroundColor.length < this.dataset.allData.length) {
|
|
839
|
+
for (const colour of colours) {
|
|
840
|
+
this.dashboardItemType.backgroundColor.push(colour);
|
|
841
|
+
if (this.dashboardItemType.backgroundColor.length === this.dataset.allData.length) {
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const dataLength = (this.dashboardItemType.type === 'line' || this.dashboardItemType.type === 'scatter') ? this.chartData.length : this.dataset.allData;
|
|
847
|
+
while (this.dashboardItemType.borderColor.length < dataLength) {
|
|
848
|
+
for (const colour of colours) {
|
|
849
|
+
this.dashboardItemType.borderColor.push(colour);
|
|
850
|
+
if (this.dashboardItemType.borderColor.length === dataLength) {
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
private loadDashboardItems() {
|
|
858
|
+
if (this.dashboard.layoutSettings) {
|
|
859
|
+
this.mapLayoutSettingsToComponentData();
|
|
860
|
+
|
|
861
|
+
if (!this.general.parameterBar) {
|
|
862
|
+
this.general.parameterBar = {};
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
if (this.dashboard.layoutSettings.parameters) {
|
|
866
|
+
this.dashboardParamValues = _(this.dashboard.layoutSettings.parameters)
|
|
867
|
+
.filter('value')
|
|
868
|
+
.map('value')
|
|
869
|
+
.valueOf();
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
this.widgetParameters = _.cloneDeep(this.dashboard.layoutSettings.parameters);
|
|
873
|
+
if (this.general.widgetParameters && Object.keys(this.general.widgetParameters).length) {
|
|
874
|
+
_.forEach(this.general.widgetParameters, widgetParam => {
|
|
875
|
+
if (widgetParam.value) {
|
|
876
|
+
this.widgetParameters[widgetParam.name].value = widgetParam.value;
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
const matchDependencies = _.filter(this.dependencies, (dep, key) => {
|
|
882
|
+
if (dep.type === 'MATCH') {
|
|
883
|
+
dep.key = key;
|
|
884
|
+
return true;
|
|
885
|
+
}
|
|
886
|
+
return false;
|
|
887
|
+
});
|
|
888
|
+
matchDependencies.forEach(dep => {
|
|
889
|
+
this.updateInstanceFilterFields(dep, dep.key);
|
|
890
|
+
});
|
|
891
|
+
|
|
892
|
+
if (this.tabular.cta) {
|
|
893
|
+
this.ctaUpdate(this.tabular.cta);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
public async setNetworkChartData(reload = false) {
|
|
899
|
+
if (!reload && this.networkData.edgeDatasetTitle) {
|
|
900
|
+
await this.loadEdgeDataset();
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
const nodeData = this.dataset.allData;
|
|
904
|
+
|
|
905
|
+
this.datasetNodes = [];
|
|
906
|
+
this.datasetEdges = [];
|
|
907
|
+
|
|
908
|
+
nodeData.forEach(item => {
|
|
909
|
+
let nodeOptions: any = [];
|
|
910
|
+
if (this.networkData.nodeLevelOptions && Object.keys(this.networkData.nodeLevelOptions).length &&
|
|
911
|
+
this.networkData.nodeLevelOptions[item[this.networkData.nodeIds]]) {
|
|
912
|
+
nodeOptions = this.networkData.nodeLevelOptions[item[this.networkData.nodeIds]];
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
this.datasetNodes.push({
|
|
916
|
+
id: item[this.networkData.nodeIds],
|
|
917
|
+
label: item[this.networkData.nodeLabels],
|
|
918
|
+
group: item[this.networkData.nodeGroups],
|
|
919
|
+
options: nodeOptions
|
|
920
|
+
});
|
|
921
|
+
if (!this.networkData.edgeDatasetTitle) {
|
|
922
|
+
this.datasetEdges.push({
|
|
923
|
+
from: item[this.networkData.fromIds],
|
|
924
|
+
to: item[this.networkData.toIds],
|
|
925
|
+
options: []
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
if (this.networkData.edgeDatasetTitle) {
|
|
931
|
+
const datasetInstanceSummary = {
|
|
932
|
+
datasetInstanceId: this.networkData.edgeDatasetId,
|
|
933
|
+
datasourceInstanceKey: this.networkData.edgeDatasourceKey,
|
|
934
|
+
transformationInstances: [],
|
|
935
|
+
parameterValues: {},
|
|
936
|
+
parameters: {}
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
this.fullEdgeDataset = await this.datasetService.evaluateDataset(
|
|
940
|
+
datasetInstanceSummary,
|
|
941
|
+
'0',
|
|
942
|
+
'10000000'
|
|
943
|
+
);
|
|
944
|
+
|
|
945
|
+
this.fullEdgeDataset.allData.forEach(item => {
|
|
946
|
+
this.datasetEdges.push({
|
|
947
|
+
from: item[this.networkData.fromIds],
|
|
948
|
+
to: item[this.networkData.toIds],
|
|
949
|
+
options: []
|
|
950
|
+
});
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
this.nodeGroups = _(this.datasetNodes)
|
|
955
|
+
.filter('group')
|
|
956
|
+
.map('group')
|
|
957
|
+
.uniq()
|
|
958
|
+
.valueOf();
|
|
959
|
+
|
|
960
|
+
this.datasetEdges.forEach(edge => {
|
|
961
|
+
const edgeOptions = _.find(this.networkData.edgeLevelOptions, {from: edge.from, to: edge.to});
|
|
962
|
+
if (edgeOptions) {
|
|
963
|
+
edge.options = edgeOptions.options;
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}
|