@openmrs/esm-report-builder 0.1.1-pre.87
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/.eslintignore +5 -0
- package/.eslintrc.js +19 -0
- package/.prettierrc +8 -0
- package/.tx/config +12 -0
- package/LICENSE +401 -0
- package/README.md +336 -0
- package/__mocks__/react-i18next.js +12 -0
- package/dist/162.js +1 -0
- package/dist/162.js.map +1 -0
- package/dist/184.js +2 -0
- package/dist/184.js.LICENSE.txt +14 -0
- package/dist/184.js.map +1 -0
- package/dist/242.js +2 -0
- package/dist/242.js.LICENSE.txt +21 -0
- package/dist/242.js.map +1 -0
- package/dist/253.js +1 -0
- package/dist/253.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/311.js +1 -0
- package/dist/311.js.map +1 -0
- package/dist/469.js +2 -0
- package/dist/469.js.LICENSE.txt +45 -0
- package/dist/469.js.map +1 -0
- package/dist/478.js +2 -0
- package/dist/478.js.LICENSE.txt +9 -0
- package/dist/478.js.map +1 -0
- package/dist/539.js +1 -0
- package/dist/539.js.map +1 -0
- package/dist/540.js +2 -0
- package/dist/540.js.LICENSE.txt +9 -0
- package/dist/540.js.map +1 -0
- package/dist/669.js +1 -0
- package/dist/669.js.map +1 -0
- package/dist/710.js +1 -0
- package/dist/710.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/838.js +2 -0
- package/dist/838.js.LICENSE.txt +9 -0
- package/dist/838.js.map +1 -0
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-report-builder.js +1 -0
- package/dist/openmrs-esm-report-builder.js.buildmanifest.json +530 -0
- package/dist/openmrs-esm-report-builder.js.map +1 -0
- package/dist/routes.json +1 -0
- package/e2e/core/env.ts +5 -0
- package/e2e/core/global-setup.ts +34 -0
- package/e2e/core/test.ts +21 -0
- package/e2e/pages/app-shell.page.ts +34 -0
- package/e2e/pages/etl-sources.page.ts +35 -0
- package/e2e/pages/report-sections.page.ts +20 -0
- package/e2e/pages/section-preview.modal.ts +29 -0
- package/e2e/specs/etl-sources.spec.ts +51 -0
- package/e2e/specs/navigation.spec.ts +13 -0
- package/e2e/specs/section-preview-validation.spec.ts +38 -0
- package/e2e/specs/section-preview.spec.ts +94 -0
- package/e2e/support/github/Dockerfile +22 -0
- package/e2e/support/github/Dockerfile.dockerignore +13 -0
- package/e2e/support/github/docker-compose.yml +31 -0
- package/e2e/support/github/run-e2e-docker-env.sh +131 -0
- package/e2e/support/github/spa-assemble-config.json +9 -0
- package/e2e/tsconfig.json +11 -0
- package/example.env +5 -0
- package/jest.config.js +28 -0
- package/linelist_report_builder_design_spec.md +816 -0
- package/package.json +111 -0
- package/playwright.config.ts +28 -0
- package/routes.json +22 -0
- package/src/__debug__/all-designs.test.tsx +30 -0
- package/src/admin-card-link.extension.module.scss +55 -0
- package/src/admin-card-link.extension.tsx +24 -0
- package/src/components/admin/admin-page.component.tsx +75 -0
- package/src/components/admin/age-categories-page.component.tsx +109 -0
- package/src/components/admin/age-groups-page.component.tsx +146 -0
- package/src/components/admin/etl-browser/columns-tab.component.tsx +80 -0
- package/src/components/admin/etl-browser/etl-browser-page.component.tsx +309 -0
- package/src/components/admin/etl-browser/etl-browser.component.scss +424 -0
- package/src/components/admin/etl-browser/metadata-tab.component.tsx +65 -0
- package/src/components/admin/etl-browser/preview-grid.component.tsx +189 -0
- package/src/components/admin/etl-browser/relationships-tab.component.tsx +21 -0
- package/src/components/admin/etl-browser/sources-tree.component.tsx +118 -0
- package/src/components/admin/etl-browser/table-detail.component.tsx +124 -0
- package/src/components/admin/etl-browser/table-info-strip.component.tsx +51 -0
- package/src/components/admin/etl-browser/table-list.component.tsx +136 -0
- package/src/components/admin/etl-browser/use-table-preview.ts +47 -0
- package/src/components/admin/etl-sources-page.component.tsx +355 -0
- package/src/components/admin/etl-tasks-page.component.scss +370 -0
- package/src/components/admin/etl-tasks-page.component.tsx +768 -0
- package/src/components/admin/report-categories-page.component.tsx +267 -0
- package/src/components/admin/report-library-page.component.tsx +551 -0
- package/src/components/ai-support/ai-assist-button.component.tsx +30 -0
- package/src/components/ai-support/ai-assist-modal.component.tsx +81 -0
- package/src/components/ai-support/ai.service.ts +21 -0
- package/src/components/ai-support/ai.types.ts +12 -0
- package/src/components/app-shell/report-builder-shell.component.tsx +242 -0
- package/src/components/app-shell/report-builder-shell.scss +18 -0
- package/src/components/dashboards/dashboard-config.schema.ts +97 -0
- package/src/components/dashboards/dashboard-form-modal.component.tsx +150 -0
- package/src/components/dashboards/dashboards-admin.scss +62 -0
- package/src/components/dashboards/dashboards-page.component.tsx +153 -0
- package/src/components/dashboards/dashboards-table.component.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-autoinclude.section.tsx +75 -0
- package/src/components/dashboards/sections/dashboard-basics.section.tsx +80 -0
- package/src/components/dashboards/sections/dashboard-json.section.tsx +79 -0
- package/src/components/dashboards/sections/dashboard-sections-editor.section.tsx +130 -0
- package/src/components/dashboards/sections/dashboard-widgets-editor.section.tsx +184 -0
- package/src/components/data-themes/data-theme-form.component.tsx +59 -0
- package/src/components/data-themes/data-theme-modal.component.tsx +349 -0
- package/src/components/data-themes/data-themes-page.component.tsx +139 -0
- package/src/components/data-themes/data-themes-table.component.tsx +98 -0
- package/src/components/data-themes/icon-registry.ts +35 -0
- package/src/components/data-themes/sections/data-theme-basics.section.tsx +63 -0
- package/src/components/data-themes/sections/data-theme-condition-columns.section.tsx +397 -0
- package/src/components/data-themes/sections/data-theme-fields-editor.section.tsx +125 -0
- package/src/components/data-themes/sections/data-theme-metadata.section.tsx +245 -0
- package/src/components/data-themes/sections/data-theme-preview.section.tsx +115 -0
- package/src/components/data-themes/sections/data-theme-source.section.tsx +184 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-data-table.component.tsx +214 -0
- package/src/components/data-visualizer/components/cqi-components/cqi-elements.ts +203 -0
- package/src/components/data-visualizer/components/cqi-components/detail.component.tsx +110 -0
- package/src/components/data-visualizer/components/cqi-components/detail.scss +22 -0
- package/src/components/data-visualizer/components/data-table/data-table.component.tsx +208 -0
- package/src/components/data-visualizer/components/data-table/data-tables.scss +206 -0
- package/src/components/data-visualizer/components/empty-state/empty-state-illustration.component.tsx +53 -0
- package/src/components/data-visualizer/components/header/header.component.tsx +43 -0
- package/src/components/data-visualizer/components/header/header.scss +71 -0
- package/src/components/data-visualizer/components/model/confirm.component.tsx +40 -0
- package/src/components/data-visualizer/components/panel/panel.component.tsx +20 -0
- package/src/components/data-visualizer/components/panel/panel.scss +25 -0
- package/src/components/data-visualizer/components/popover/modifier-panel.tsx +53 -0
- package/src/components/data-visualizer/constants.ts +445 -0
- package/src/components/data-visualizer/data-visualizer-illustration.component.tsx +31 -0
- package/src/components/data-visualizer/data-visualizer.component.tsx +1935 -0
- package/src/components/data-visualizer/data-visualizer.resource.ts +462 -0
- package/src/components/data-visualizer/data-visualizer.scss +449 -0
- package/src/components/data-visualizer/declarations.d.ts +131 -0
- package/src/components/data-visualizer/parameter-inputs/boolean-parameter-input.component.tsx +34 -0
- package/src/components/data-visualizer/parameter-inputs/concept-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/date-parameter-input.component.tsx +110 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.scss +47 -0
- package/src/components/data-visualizer/parameter-inputs/date-range-input.component.tsx +228 -0
- package/src/components/data-visualizer/parameter-inputs/identifier-type-parameter-input.component.tsx +69 -0
- package/src/components/data-visualizer/parameter-inputs/list-parameter-input.component.tsx +73 -0
- package/src/components/data-visualizer/parameter-inputs/location-parameter-input.component.tsx +81 -0
- package/src/components/data-visualizer/parameter-inputs/number-parameter-input.component.tsx +40 -0
- package/src/components/data-visualizer/parameter-inputs/person-attribute-parameter-input.component.tsx +71 -0
- package/src/components/data-visualizer/parameter-inputs/text-parameter-input.component.tsx +52 -0
- package/src/components/data-visualizer/report-parameter-modal.component.tsx +383 -0
- package/src/components/data-visualizer/types.ts +206 -0
- package/src/components/etl-monitor/builder/builder-state-machine.ts +381 -0
- package/src/components/etl-monitor/builder/design-registry.tsx +139 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-context.tsx +702 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.component.tsx +461 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-modal.scss +256 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.component.tsx +387 -0
- package/src/components/etl-monitor/builder/etl-monitor-builder-page.scss +976 -0
- package/src/components/etl-monitor/builder/generated-config-panel.component.tsx +168 -0
- package/src/components/etl-monitor/builder/generated-config-panel.scss +198 -0
- package/src/components/etl-monitor/builder/index.ts +5 -0
- package/src/components/etl-monitor/builder/monitor-preview.tsx +124 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.component.tsx +667 -0
- package/src/components/etl-monitor/builder/steps/data-source-step.scss +284 -0
- package/src/components/etl-monitor/builder/steps/design-samples.ts +278 -0
- package/src/components/etl-monitor/builder/steps/design-step.component.tsx +299 -0
- package/src/components/etl-monitor/builder/steps/design-step.scss +479 -0
- package/src/components/etl-monitor/builder/steps/fields-step.component.tsx +859 -0
- package/src/components/etl-monitor/builder/steps/fields-step.scss +459 -0
- package/src/components/etl-monitor/builder/steps/general-step.component.tsx +288 -0
- package/src/components/etl-monitor/builder/steps/general-step.scss +103 -0
- package/src/components/etl-monitor/builder/steps/index.ts +5 -0
- package/src/components/etl-monitor/builder/steps/preview-step.component.tsx +245 -0
- package/src/components/etl-monitor/builder/steps/preview-step.scss +236 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.component.tsx +154 -0
- package/src/components/etl-monitor/etl-monitor-card-shell.scss +103 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.component.tsx +227 -0
- package/src/components/etl-monitor/etl-monitor-dashboard.scss +148 -0
- package/src/components/etl-monitor/etl-monitor-status-card.component.tsx +192 -0
- package/src/components/etl-monitor/etl-monitors-page.component.tsx +621 -0
- package/src/components/etl-monitor/renderers/DetailsRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/ErrorLogRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/EtlMonitorWidget.tsx +97 -0
- package/src/components/etl-monitor/renderers/MetricsGridRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/MonitorRenderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/ProgressRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/StatusCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/SummaryCardRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/TableRenderer.tsx +2 -0
- package/src/components/etl-monitor/renderers/component-icons.tsx +33 -0
- package/src/components/etl-monitor/renderers/components/details-renderer.tsx +195 -0
- package/src/components/etl-monitor/renderers/components/error-log-renderer.tsx +104 -0
- package/src/components/etl-monitor/renderers/components/index.ts +6 -0
- package/src/components/etl-monitor/renderers/components/log-renderer.tsx +86 -0
- package/src/components/etl-monitor/renderers/components/metrics-grid-renderer.tsx +133 -0
- package/src/components/etl-monitor/renderers/components/progress-renderer.tsx +188 -0
- package/src/components/etl-monitor/renderers/components/status-card-renderer.tsx +247 -0
- package/src/components/etl-monitor/renderers/components/summary-card-renderer.tsx +160 -0
- package/src/components/etl-monitor/renderers/components/table-renderer.tsx +175 -0
- package/src/components/etl-monitor/renderers/components/time-series-renderer.tsx +310 -0
- package/src/components/etl-monitor/renderers/data-transformer.ts +361 -0
- package/src/components/etl-monitor/renderers/index.ts +11 -0
- package/src/components/etl-monitor/renderers/legacy-monitor-renderer.tsx +69 -0
- package/src/components/etl-monitor/renderers/monitor-renderer.tsx +6 -0
- package/src/components/etl-monitor/renderers/monitor-renderers.scss +1621 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.component.tsx +54 -0
- package/src/components/etl-monitor/renderers/monitor-widget-card.scss +16 -0
- package/src/components/etl-monitor/renderers/v2-monitor-renderer.tsx +227 -0
- package/src/components/import-export/artifact-groups.ts +153 -0
- package/src/components/import-export/export-report-modal.component.tsx +265 -0
- package/src/components/import-export/import-export-page.component.tsx +610 -0
- package/src/components/import-export/import-export.styles.scss +825 -0
- package/src/components/import-export/import-package-modal.component.tsx +401 -0
- package/src/components/import-export/index.ts +3 -0
- package/src/components/indicators/README.md +24 -0
- package/src/components/indicators/base-indicator-basic-fields.component.tsx +18 -0
- package/src/components/indicators/base-indicator-basics.section.tsx +54 -0
- package/src/components/indicators/base-indicator-countby.section.tsx +25 -0
- package/src/components/indicators/base-indicator-criteria.section.tsx +83 -0
- package/src/components/indicators/base-indicator-details-form.component.tsx +80 -0
- package/src/components/indicators/base-indicator-theme-unit-fields.component.tsx +39 -0
- package/src/components/indicators/create-base-indicator-modal.component.tsx +623 -0
- package/src/components/indicators/create-composite-base-indicator-modal.component.tsx +295 -0
- package/src/components/indicators/create-custom-indicator-modal.component.tsx +548 -0
- package/src/components/indicators/create-final-indicator-modal.component.tsx +285 -0
- package/src/components/indicators/custom-condition-input.component.tsx +310 -0
- package/src/components/indicators/diagnosis-filters-form.component.tsx +101 -0
- package/src/components/indicators/disaggregation-panel.component.tsx +93 -0
- package/src/components/indicators/handler/concept-search-multiselect.component.tsx +153 -0
- package/src/components/indicators/handler/question-answer-concept-search.component.tsx +336 -0
- package/src/components/indicators/indicator-run-preview-modal.component.tsx +391 -0
- package/src/components/indicators/indicator-search-select.component.tsx +297 -0
- package/src/components/indicators/indicator-status-tag.component.tsx +9 -0
- package/src/components/indicators/indicators-page.component.tsx +673 -0
- package/src/components/indicators/indicators-page.scss +121 -0
- package/src/components/indicators/indicators-table.component.tsx +188 -0
- package/src/components/indicators/preview-table.component.tsx +31 -0
- package/src/components/indicators/sections/composite-indicator-basics.section.tsx +36 -0
- package/src/components/indicators/sections/composite-indicator-picker.section.tsx +116 -0
- package/src/components/indicators/sections/composite-indicator-sql-preview.section.tsx +31 -0
- package/src/components/indicators/sections/custom-indicator-basics.section.tsx +65 -0
- package/src/components/indicators/sections/custom-indicator-disaggregation.section.tsx +93 -0
- package/src/components/indicators/sections/custom-indicator-filters.section.tsx +203 -0
- package/src/components/indicators/sections/custom-indicator-population.section.tsx +107 -0
- package/src/components/indicators/sections/custom-indicator-sql-preview.section.tsx +108 -0
- package/src/components/indicators/sections/final-indicator-basics.section.tsx +46 -0
- package/src/components/indicators/sections/final-indicator-disaggregation.section.tsx +47 -0
- package/src/components/indicators/sections/final-indicator-picker.section.tsx +60 -0
- package/src/components/indicators/sections/final-indicator-preview.section.tsx +20 -0
- package/src/components/indicators/sections/final-indicator-results-preview.section.tsx +65 -0
- package/src/components/indicators/sections/indicator-basics.section.tsx +40 -0
- package/src/components/indicators/sections/indicator-conditions.section.tsx +279 -0
- package/src/components/indicators/sections/indicator-sql-preview.section.tsx +63 -0
- package/src/components/indicators/sections/indicator-theme.section.tsx +48 -0
- package/src/components/indicators/sql-preview.component.tsx +19 -0
- package/src/components/indicators/tag-input.component.tsx +177 -0
- package/src/components/indicators/types/base-indicator-form.types.ts +17 -0
- package/src/components/indicators/types/base-indicator-theme.constants.ts +8 -0
- package/src/components/indicators/types/composite-indicator.types.ts +27 -0
- package/src/components/indicators/types/condition-ui.types.ts +11 -0
- package/src/components/indicators/types/custom-indicator.types.ts +161 -0
- package/src/components/indicators/types/data-theme-config.types.ts +88 -0
- package/src/components/indicators/types/indicator-types.ts +57 -0
- package/src/components/indicators/types/sql-builders.ts +43 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.test.ts +143 -0
- package/src/components/indicators/utils/composite-indicator-sql.utils.ts +426 -0
- package/src/components/indicators/utils/concept-preload.utils.ts +21 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.test.ts +493 -0
- package/src/components/indicators/utils/custom-indicator-interpreter.ts +702 -0
- package/src/components/indicators/utils/final-indicator-sql.utils.ts +190 -0
- package/src/components/indicators/utils/indicator-conditions-hydration.utils.ts +254 -0
- package/src/components/indicators/utils/indicator-sql-resolution.utils.ts +204 -0
- package/src/components/indicators/utils/indicator-sql.utils.ts +721 -0
- package/src/components/indicators/utils/population-sql.compiler.test.ts +999 -0
- package/src/components/indicators/utils/population-sql.compiler.ts +858 -0
- package/src/components/landing/landing-action-item.component.tsx +50 -0
- package/src/components/landing/landing-action-list.component.tsx +12 -0
- package/src/components/landing/landing-activity-list.component.tsx +47 -0
- package/src/components/landing/landing-footer-grid.component.tsx +45 -0
- package/src/components/landing/landing-hero.component.tsx +18 -0
- package/src/components/landing/landing-section-card.component.tsx +33 -0
- package/src/components/landing/report-builder-landing-page.component.tsx +186 -0
- package/src/components/landing/report-builder-landing-page.scss +131 -0
- package/src/components/legacy-reports/legacy-report-detail-page.component.tsx +300 -0
- package/src/components/legacy-reports/legacy-report-editor-page.component.tsx +324 -0
- package/src/components/legacy-reports/legacy-report-upload-modal.component.tsx +307 -0
- package/src/components/legacy-reports/legacy-reports-page.component.tsx +206 -0
- package/src/components/legacy-reports/legacy-reports-table.component.tsx +154 -0
- package/src/components/legacy-reports/tabs/legacy-report-datasets-tab.component.tsx +344 -0
- package/src/components/legacy-reports/tabs/legacy-report-dimensions-tab.component.tsx +590 -0
- package/src/components/legacy-reports/tabs/legacy-report-indicators-tab.component.tsx +490 -0
- package/src/components/legacy-reports/tabs/legacy-report-json-preview-tab.component.tsx +272 -0
- package/src/components/legacy-reports/tabs/legacy-report-overview-tab.component.tsx +218 -0
- package/src/components/legacy-reports/tabs/legacy-report-parameters-tab.component.tsx +279 -0
- package/src/components/linelist/definition/indicator-to-sql.utils.ts +281 -0
- package/src/components/linelist/definition/linelist-definition-editor.component.tsx +1676 -0
- package/src/components/linelist/definition/linelist-definition-editor.scss +461 -0
- package/src/components/linelist/definition/linelist-definition.types.ts +108 -0
- package/src/components/linelist/definition/panels/column-properties-panel.component.tsx +328 -0
- package/src/components/linelist/definition/panels/column-selector-panel.component.tsx +1082 -0
- package/src/components/linelist/definition/panels/column-selector-panel.scss +100 -0
- package/src/components/linelist/definition/panels/custom-sql-column-modal.component.tsx +248 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.component.tsx +300 -0
- package/src/components/linelist/definition/panels/encounter-diagnosis-column-modal.scss +21 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.component.tsx +332 -0
- package/src/components/linelist/definition/panels/multi-datasource-selector.scss +161 -0
- package/src/components/linelist/definition/panels/observation-column-modal.component.tsx +450 -0
- package/src/components/linelist/definition/panels/observation-column-modal.scss +29 -0
- package/src/components/linelist/definition/panels/parameter-panel.component.tsx +659 -0
- package/src/components/linelist/definition/panels/parameter-panel.scss +64 -0
- package/src/components/linelist/definition/panels/population-source-selector.component.tsx +407 -0
- package/src/components/linelist/definition/panels/population-source-selector.scss +187 -0
- package/src/components/linelist/design/panels/column-category-selector.component.tsx +433 -0
- package/src/components/linelist/design/panels/column-category-selector.scss +329 -0
- package/src/components/linelist/design/panels/column-debug-panel.component.tsx +197 -0
- package/src/components/linelist/design/panels/column-debug-panel.scss +141 -0
- package/src/components/linelist/design/panels/data-catalogue.component.tsx +1062 -0
- package/src/components/linelist/design/panels/data-catalogue.scss +263 -0
- package/src/components/linelist/design/panels/display-settings-panel.component.tsx +405 -0
- package/src/components/linelist/design/panels/display-settings-panel.scss +78 -0
- package/src/components/linelist/design/panels/filtermap-editor.component.tsx +434 -0
- package/src/components/linelist/design/panels/filtermap-editor.scss +176 -0
- package/src/components/linelist/design/panels/json-preview.component.tsx +114 -0
- package/src/components/linelist/design/panels/json-preview.scss +85 -0
- package/src/components/linelist/design/panels/query-config-panel.component.tsx +1137 -0
- package/src/components/linelist/design/panels/query-config-panel.scss +342 -0
- package/src/components/linelist/design/panels/sort-config-panel.component.tsx +330 -0
- package/src/components/linelist/design/panels/sort-config-panel.scss +77 -0
- package/src/components/linelist/design/panels/sql-builder-panel.component.tsx +475 -0
- package/src/components/linelist/design/panels/sql-builder-panel.scss +226 -0
- package/src/components/linelist/design/panels/transformation-panel.component.tsx +687 -0
- package/src/components/linelist/design/panels/transformation-panel.scss +81 -0
- package/src/components/linelist/design/panels/visual-filter-panel.component.tsx +595 -0
- package/src/components/linelist/design/panels/visual-filter-panel.scss +76 -0
- package/src/components/linelist/linelist-dashboard.page.component.tsx +756 -0
- package/src/components/linelist/linelist-dashboard.page.scss +240 -0
- package/src/components/linelist/linelist-editor.page.component.tsx +134 -0
- package/src/components/linelist/linelist-editor.page.scss +28 -0
- package/src/components/linelist/linelist-run-report.page.component.tsx +715 -0
- package/src/components/linelist/linelist-run-report.page.scss +136 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.component.tsx +1454 -0
- package/src/components/linelist/modals/linelist-report-builder-modal.scss +164 -0
- package/src/components/linelist/modals/preview-parameter-modal.component.tsx +361 -0
- package/src/components/report/dashboard/reports-table.component.tsx +186 -0
- package/src/components/report/definition/panels/properties-panel.component.tsx +38 -0
- package/src/components/report/definition/panels/report-structure-panel.component.tsx +61 -0
- package/src/components/report/definition/panels/selection-panel.component.tsx +58 -0
- package/src/components/report/definition/report-definition-editor.component.tsx +99 -0
- package/src/components/report/definition/report-definition.types.ts +66 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/report/design/panels/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/report/design/panels/JsonPreviewPanel.scss +32 -0
- package/src/components/report/design/panels/JsonPreviewPanel.tsx +104 -0
- package/src/components/report/design/panels/mapping-preview-panel.component.tsx +82 -0
- package/src/components/report/design/panels/mapping-preview-panel.scss +55 -0
- package/src/components/report/design/panels/template-structure-panel.component.tsx +296 -0
- package/src/components/report/design/panels/template-structure-panel.scss +81 -0
- package/src/components/report/design/report-design-editor.component.tsx +1170 -0
- package/src/components/report/design/report-design.types.ts +48 -0
- package/src/components/report/design/report-design.utils.ts +86 -0
- package/src/components/report/panels/report-detail.component.tsx +71 -0
- package/src/components/report/panels/report-panel-shell.component.tsx +60 -0
- package/src/components/report/report-dashboard.page.component.tsx +554 -0
- package/src/components/report/report-editor.page.component.tsx +590 -0
- package/src/components/report/report.routes.tsx +32 -0
- package/src/components/report-sections/create-report-section-modal.component.tsx +388 -0
- package/src/components/report-sections/hooks/useAgeCategories.ts +25 -0
- package/src/components/report-sections/hooks/useSectionEditorState.ts +449 -0
- package/src/components/report-sections/panels/Dhis2MappingPanel.tsx +157 -0
- package/src/components/report-sections/panels/DisaggregationPanel.tsx +97 -0
- package/src/components/report-sections/panels/IndicatorPickerPanel.tsx +201 -0
- package/src/components/report-sections/panels/SectionBasicsPanel.tsx +27 -0
- package/src/components/report-sections/report-section-preview-modal.component.tsx +548 -0
- package/src/components/report-sections/report-sections-page.component.tsx +325 -0
- package/src/components/report-sections/section-disaggregation.utils.ts +637 -0
- package/src/components/report-sections/section-types.ts +55 -0
- package/src/components/report-sections/section-utils.ts +50 -0
- package/src/components/report-sections/sections-page.scss +79 -0
- package/src/components/run-reports/run-reports-page.component.tsx +8 -0
- package/src/components/security/access-denied-page.component.tsx +69 -0
- package/src/components/security/access-denied-page.scss +39 -0
- package/src/components/security/privilege-route.component.test.tsx +79 -0
- package/src/components/security/privilege-route.component.tsx +39 -0
- package/src/components/shared/compile-setup-modal.component.tsx +182 -0
- package/src/components/shared/concept-selector.component.tsx +245 -0
- package/src/components/shared/concept-selector.scss +121 -0
- package/src/components/shared/header/builder-header-actions.component.tsx +38 -0
- package/src/components/shared/header/header.component.tsx +85 -0
- package/src/components/shared/header/header.scss +150 -0
- package/src/components/shared/header/illustration.component.tsx +34 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.scss +33 -0
- package/src/components/shared/indicator-properties-panel/IndicatorPropertiesPanel.tsx +389 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.scss +32 -0
- package/src/components/shared/json-preview-panel/JsonPreviewPanel.tsx +104 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.component.tsx +82 -0
- package/src/components/shared/mapping-preview-panel/mapping-preview-panel.scss +55 -0
- package/src/components/shared/preview/query-results-preview.component.tsx +204 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.component.tsx +296 -0
- package/src/components/shared/template-structure-panel/template-structure-panel.scss +81 -0
- package/src/config-schema.ts +43 -0
- package/src/constants/privileges.test.ts +53 -0
- package/src/constants/privileges.ts +118 -0
- package/src/features/dashboards/DashboardRendererPage.tsx +174 -0
- package/src/features/dashboards/DashboardsPage.tsx +164 -0
- package/src/features/dashboards/EtlDashboardPage.tsx +32 -0
- package/src/features/dashboards/components/DashboardEmptyState.tsx +41 -0
- package/src/features/dashboards/components/DashboardGrid.tsx +48 -0
- package/src/features/dashboards/components/DashboardHeader.tsx +58 -0
- package/src/features/dashboards/components/DashboardSection.tsx +46 -0
- package/src/features/dashboards/components/ReportLaunchCard.tsx +51 -0
- package/src/features/dashboards/components/WidgetSlotDispatcher.tsx +61 -0
- package/src/features/dashboards/components/WidgetUnavailableCard.tsx +36 -0
- package/src/features/dashboards/dashboards.scss +196 -0
- package/src/features/dashboards/hooks/useDashboard.ts +61 -0
- package/src/features/dashboards/hooks/useDashboardWidgets.ts +74 -0
- package/src/features/dashboards/hooks/useDashboards.ts +56 -0
- package/src/features/dashboards/hooks/useMonitorDataMap.ts +84 -0
- package/src/features/dashboards/index.ts +11 -0
- package/src/features/dashboards/utils/dashboard-config.util.test.ts +255 -0
- package/src/features/dashboards/utils/dashboard-config.util.ts +382 -0
- package/src/features/report-visualizer/ReportVisualizerPage.tsx +448 -0
- package/src/features/report-visualizer/components/Export/ExportMenu.tsx +141 -0
- package/src/features/report-visualizer/components/Export/index.ts +2 -0
- package/src/features/report-visualizer/components/ReportExplorer/QuickFilters.tsx +152 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportCategoryFilter.tsx +54 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerPanel.tsx +201 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportExplorerRail.tsx +202 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportList.tsx +287 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportSearch.tsx +151 -0
- package/src/features/report-visualizer/components/ReportExplorer/ReportTagFilter.tsx +100 -0
- package/src/features/report-visualizer/components/ReportExplorer/RunReportButton.tsx +42 -0
- package/src/features/report-visualizer/components/ReportExplorer/RuntimeParameterForm.tsx +259 -0
- package/src/features/report-visualizer/components/ReportExplorer/index.ts +8 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportLayer.tsx +33 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportSummary.tsx +88 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportViewTabs.tsx +72 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspaceHeader.tsx +92 -0
- package/src/features/report-visualizer/components/ReportWorkspace/ReportWorkspacePanel.tsx +242 -0
- package/src/features/report-visualizer/components/ReportWorkspace/index.ts +5 -0
- package/src/features/report-visualizer/components/TableView/ColumnVisibilityMenu.tsx +206 -0
- package/src/features/report-visualizer/components/TableView/ReportTable.tsx +253 -0
- package/src/features/report-visualizer/components/TableView/index.ts +2 -0
- package/src/features/report-visualizer/hooks/index.ts +4 -0
- package/src/features/report-visualizer/hooks/useExplorerPreferences.ts +103 -0
- package/src/features/report-visualizer/hooks/useReportCapabilities.ts +112 -0
- package/src/features/report-visualizer/hooks/useReportParameters.ts +152 -0
- package/src/features/report-visualizer/hooks/useReports.ts +135 -0
- package/src/features/report-visualizer/index.ts +6 -0
- package/src/features/report-visualizer/report-visualizer.scss +593 -0
- package/src/features/report-visualizer/types/index.ts +1 -0
- package/src/features/report-visualizer/types/report-visualizer.types.ts +104 -0
- package/src/features/report-visualizer/utils/status-colors.ts +117 -0
- package/src/globals.d.ts +14 -0
- package/src/hooks/address-template.ts +86 -0
- package/src/hooks/concept.ts +112 -0
- package/src/hooks/indicator/index.ts +1 -0
- package/src/hooks/indicator/useIndicatorsByTheme.ts +41 -0
- package/src/hooks/openmrs-reference-data.ts +432 -0
- package/src/hooks/theme/index.ts +4 -0
- package/src/hooks/theme/useDataTheme.ts +61 -0
- package/src/hooks/theme/useDataThemes.ts +28 -0
- package/src/hooks/theme/useMambaTableMeta.ts +34 -0
- package/src/hooks/theme/useMambaTables.ts +95 -0
- package/src/hooks/use-report-builder-privileges.test.tsx +98 -0
- package/src/hooks/use-report-builder-privileges.ts +58 -0
- package/src/index.ts +29 -0
- package/src/resources/address-template/address-template.api.ts +180 -0
- package/src/resources/agegroup/agegroups.api.ts +58 -0
- package/src/resources/concept/concept.api.ts +116 -0
- package/src/resources/concepts/concept-mapper.ts +21 -0
- package/src/resources/concepts/concept-types.ts +31 -0
- package/src/resources/concepts/concepts.resource.ts +44 -0
- package/src/resources/concepts/useConceptSearch.ts +41 -0
- package/src/resources/dashboard/dashboard.api.ts +107 -0
- package/src/resources/etl-monitor/etl-monitor-test.api.ts +409 -0
- package/src/resources/etl-monitor/etl-monitor.api.ts +381 -0
- package/src/resources/etl-source/etl-source.api.ts +65 -0
- package/src/resources/etl-task/etl-task.api.ts +96 -0
- package/src/resources/etl-task/etl-task.types.ts +31 -0
- package/src/resources/indicator/indicators.api.ts +125 -0
- package/src/resources/legacy-reports/legacy-reports.api.ts +144 -0
- package/src/resources/linelist/linelist-reports.api.ts +616 -0
- package/src/resources/location/location.api.ts +135 -0
- package/src/resources/openmrs-api.ts +40 -0
- package/src/resources/patient-identifier-type/patient-identifier-type.api.ts +65 -0
- package/src/resources/person-attribute-type/person-attribute-type.api.ts +71 -0
- package/src/resources/preview/sql-preview.api.ts +54 -0
- package/src/resources/report/reports.api.ts +140 -0
- package/src/resources/report-category/report-category.api.ts +41 -0
- package/src/resources/report-import-export/import-export-api.ts +164 -0
- package/src/resources/report-library/report-library.api.ts +63 -0
- package/src/resources/report-section/report-sections.api.ts +73 -0
- package/src/resources/report-section/section-preview.api.ts +25 -0
- package/src/resources/theme/data-theme.api.ts +88 -0
- package/src/resources/theme/etl-schema.api.ts +101 -0
- package/src/resources/theme/etl-table-meta.api.ts +45 -0
- package/src/root.component.tsx +20 -0
- package/src/routes/report-builder.routes.tsx +160 -0
- package/src/routes/report-builder.scss +56 -0
- package/src/routes.json +28 -0
- package/src/sample-template.ts +121 -0
- package/src/template-utils.ts +110 -0
- package/src/types/carbon-react-inert.d.ts +13 -0
- package/src/types/condition-operators.ts +63 -0
- package/src/types/dashboard/dashboard.types.ts +137 -0
- package/src/types/dashboard/index.ts +4 -0
- package/src/types/etl/etl-types.ts +238 -0
- package/src/types/etl-monitor/etl-monitor-builder.types.ts +555 -0
- package/src/types/etl-monitor/etl-monitor-v2.types.ts +397 -0
- package/src/types/etl-monitor/etl-monitor.types.ts +188 -0
- package/src/types/etl-monitor/index.ts +6 -0
- package/src/types/linelist/compile-config.ts +455 -0
- package/src/types/linelist-types.ts +2059 -0
- package/src/types/theme/data-theme.types.ts +88 -0
- package/src/utils/api-error.utils.test.ts +151 -0
- package/src/utils/api-error.utils.ts +131 -0
- package/src/utils/config-enhancer.ts +62 -0
- package/src/utils/etl-browser/etl-browser.util.test.ts +145 -0
- package/src/utils/etl-browser/export-csv.util.ts +43 -0
- package/src/utils/etl-browser/group-tables.util.ts +84 -0
- package/src/utils/etl-browser/index.ts +4 -0
- package/src/utils/etl-browser/summarize-columns.util.ts +27 -0
- package/src/utils/etl-browser/table-sql.util.ts +20 -0
- package/src/utils/etl-monitor/config-v2-adapter.util.ts +460 -0
- package/src/utils/etl-monitor/endpoint-config-normalizer.util.ts +383 -0
- package/src/utils/etl-monitor/index.ts +10 -0
- package/src/utils/etl-monitor/jsonpath-resolver.util.ts +118 -0
- package/src/utils/etl-monitor/normalization-examples.ts +0 -0
- package/src/utils/etl-monitor/schema-inspector.util.ts +76 -0
- package/src/utils/etl-monitor/semantic-type-detector.util.ts +76 -0
- package/src/utils/etl-monitor/status-mapper.util.ts +105 -0
- package/src/utils/etl-monitor/value-formatters.util.ts +167 -0
- package/src/utils/etl-task/etl-task-card.util.test.ts +239 -0
- package/src/utils/etl-task/etl-task-card.util.ts +276 -0
- package/src/utils/etl-task/index.ts +1 -0
- package/src/utils/html-entities.utils.ts +34 -0
- package/src/utils/parameter-resolution.ts +218 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.scss +0 -0
- package/src/views/etl-monitor-builder/add-monitor-modal.component.tsx +210 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.scss +157 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.component.tsx +252 -0
- package/src/views/etl-monitor-builder/etl-monitor-builder.store.ts +126 -0
- package/tools/scss-stub.js +12 -0
- package/tools/setup-tests.ts +1 -0
- package/translations/en.json +65 -0
- package/tsconfig.json +43 -0
- package/webpack.config.js +30 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Summary Card Renderer
|
|
3
|
+
* Renders SUMMARY_CARD component type
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styles from '../monitor-renderers.scss';
|
|
8
|
+
import type { DisplayConfigV2 } from '../../../../types/etl-monitor/etl-monitor-v2.types';
|
|
9
|
+
|
|
10
|
+
interface SummaryCardRendererProps {
|
|
11
|
+
config: DisplayConfigV2;
|
|
12
|
+
fields?: Array<{
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
value: any;
|
|
16
|
+
formattedValue: any;
|
|
17
|
+
type: string;
|
|
18
|
+
primary: boolean;
|
|
19
|
+
hidden: boolean;
|
|
20
|
+
order?: number;
|
|
21
|
+
}>;
|
|
22
|
+
arrayData?: any;
|
|
23
|
+
rawData?: any;
|
|
24
|
+
data?: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function SummaryCardRenderer({ config, fields, data }: SummaryCardRendererProps) {
|
|
28
|
+
// If fields are not provided but data is, transform data into fields
|
|
29
|
+
const derivedFields = fields || (data ? transformDataToFields(data, config) : []);
|
|
30
|
+
const visibleFields = derivedFields.filter((f) => !f.hidden);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={styles['monitor-summary-card']}>
|
|
34
|
+
<div className={styles['monitor-summary-card__header']}>
|
|
35
|
+
{config.presentation?.title && (
|
|
36
|
+
<h4 className={styles['monitor-summary-card__title']}>{config.presentation.title}</h4>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div className={styles['monitor-summary-card__body']}>
|
|
41
|
+
<div className={styles['monitor-summary-card__metrics']}>
|
|
42
|
+
{visibleFields.map((field) => (
|
|
43
|
+
<div key={field.key} className={styles['monitor-summary-card__metric']}>
|
|
44
|
+
<div className={styles['monitor-summary-card__metric-label']}>{field.label}</div>
|
|
45
|
+
<div className={styles['monitor-summary-card__metric-value']}>{field.formattedValue}</div>
|
|
46
|
+
</div>
|
|
47
|
+
))}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Transform raw data into formatted fields for summary card
|
|
56
|
+
*/
|
|
57
|
+
function transformDataToFields(data: any, config: DisplayConfigV2) {
|
|
58
|
+
if (!data || typeof data !== 'object') return [];
|
|
59
|
+
|
|
60
|
+
const fields: Array<{
|
|
61
|
+
key: string;
|
|
62
|
+
label: string;
|
|
63
|
+
value: any;
|
|
64
|
+
formattedValue: any;
|
|
65
|
+
type: string;
|
|
66
|
+
primary: boolean;
|
|
67
|
+
hidden: boolean;
|
|
68
|
+
order?: number;
|
|
69
|
+
statusTone?: string;
|
|
70
|
+
}> = [];
|
|
71
|
+
|
|
72
|
+
// If config defines field mappings, apply them
|
|
73
|
+
if (config.fields && Array.isArray(config.fields)) {
|
|
74
|
+
for (const fieldConfig of config.fields) {
|
|
75
|
+
const value = resolveFieldValue(data, fieldConfig.key);
|
|
76
|
+
|
|
77
|
+
fields.push({
|
|
78
|
+
key: fieldConfig.key,
|
|
79
|
+
label: fieldConfig.label || fieldConfig.key,
|
|
80
|
+
value,
|
|
81
|
+
formattedValue: formatFieldValue(value, fieldConfig),
|
|
82
|
+
type: fieldConfig.type || 'string',
|
|
83
|
+
primary: fieldConfig.primary || false,
|
|
84
|
+
hidden: fieldConfig.hidden || false,
|
|
85
|
+
order: fieldConfig.order,
|
|
86
|
+
statusTone:
|
|
87
|
+
fieldConfig.type === 'STATUS' && value != null
|
|
88
|
+
? mappingTone(value, fieldConfig)
|
|
89
|
+
: undefined,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
// Otherwise, use all data properties
|
|
94
|
+
Object.keys(data).forEach((key, index) => {
|
|
95
|
+
const value = data[key];
|
|
96
|
+
fields.push({
|
|
97
|
+
key,
|
|
98
|
+
label: key,
|
|
99
|
+
value,
|
|
100
|
+
formattedValue: value,
|
|
101
|
+
type: typeof value,
|
|
102
|
+
primary: index === 0,
|
|
103
|
+
hidden: false,
|
|
104
|
+
order: index,
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return fields;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function mappingTone(value: any, fieldConfig: any): string | undefined {
|
|
113
|
+
const stringValue = String(value);
|
|
114
|
+
const mapping =
|
|
115
|
+
fieldConfig.statusMap?.[stringValue] ?? fieldConfig.statusMap?.[stringValue.toLowerCase()];
|
|
116
|
+
return mapping?.tone;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Resolve field value from data object using key path
|
|
121
|
+
*/
|
|
122
|
+
function resolveFieldValue(data: any, key: string): any {
|
|
123
|
+
if (!data || !key) return undefined;
|
|
124
|
+
|
|
125
|
+
const keys = key.split('.');
|
|
126
|
+
let value = data;
|
|
127
|
+
|
|
128
|
+
for (const k of keys) {
|
|
129
|
+
if (value && typeof value === 'object' && k in value) {
|
|
130
|
+
value = value[k];
|
|
131
|
+
} else {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Format field value based on field configuration
|
|
141
|
+
*/
|
|
142
|
+
function formatFieldValue(value: any, fieldConfig: any): any {
|
|
143
|
+
if (value === null || value === undefined) return '-';
|
|
144
|
+
|
|
145
|
+
if (fieldConfig.type === 'date' && value) {
|
|
146
|
+
try {
|
|
147
|
+
return new Date(value).toLocaleDateString();
|
|
148
|
+
} catch {
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (fieldConfig.type === 'boolean') {
|
|
154
|
+
return value ? 'Yes' : 'No';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return value;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default SummaryCardRenderer;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table Renderer
|
|
3
|
+
* Renders TABLE/DATA_TABLE component type
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import {
|
|
8
|
+
Table,
|
|
9
|
+
TableHead,
|
|
10
|
+
TableRow,
|
|
11
|
+
TableHeader,
|
|
12
|
+
TableBody,
|
|
13
|
+
TableCell,
|
|
14
|
+
Tag,
|
|
15
|
+
} from '@carbon/react';
|
|
16
|
+
import { ArrowRight } from '@carbon/icons-react';
|
|
17
|
+
import styles from '../monitor-renderers.scss';
|
|
18
|
+
import type { DisplayConfigV2 } from '../../../../types/etl-monitor/etl-monitor-v2.types';
|
|
19
|
+
import { formatSemanticValue, resolveRowFieldValue } from '../data-transformer';
|
|
20
|
+
|
|
21
|
+
interface TableRendererProps {
|
|
22
|
+
config: DisplayConfigV2;
|
|
23
|
+
fields: Array<{
|
|
24
|
+
key: string;
|
|
25
|
+
label: string;
|
|
26
|
+
value: any;
|
|
27
|
+
formattedValue: any;
|
|
28
|
+
type: string;
|
|
29
|
+
primary: boolean;
|
|
30
|
+
hidden: boolean;
|
|
31
|
+
order?: number;
|
|
32
|
+
path?: string;
|
|
33
|
+
}>;
|
|
34
|
+
arrayData?: Array<Record<string, any>>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function TableRenderer({ config, fields, arrayData }: TableRendererProps) {
|
|
38
|
+
// Use arrayData provided by MonitorRenderer
|
|
39
|
+
const tableData = arrayData || [];
|
|
40
|
+
|
|
41
|
+
const visibleFields = (fields || []).filter((f) => !f.hidden);
|
|
42
|
+
const maxRows = config.componentConfig?.maxRows || 50;
|
|
43
|
+
const displayData = tableData.slice(0, maxRows);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Extract value from row data using field path.
|
|
47
|
+
* Delegates to the shared resolver so root-relative paths
|
|
48
|
+
* (e.g. $.data.startTime from a { data: [...] } envelope) and
|
|
49
|
+
* indexed paths resolve the same way as everywhere else.
|
|
50
|
+
*/
|
|
51
|
+
const getRowValue = (row: any, field: any) => {
|
|
52
|
+
const value = resolveRowFieldValue(row, field, config.data?.arrayPath);
|
|
53
|
+
return value === undefined ? '-' : value;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Format a cell value for display
|
|
58
|
+
*/
|
|
59
|
+
const formatCellValue = (value: any, field: any) => {
|
|
60
|
+
if (value === null || value === undefined) return '-';
|
|
61
|
+
|
|
62
|
+
// For status fields, apply status mapping
|
|
63
|
+
if (field.type === 'STATUS') {
|
|
64
|
+
const mapping = field.statusMap?.[String(value)];
|
|
65
|
+
if (mapping) {
|
|
66
|
+
const toneToTagType: Record<string, 'green' | 'red' | 'blue' | 'gray' | 'cyan' | 'purple' | 'magenta' | 'teal' | 'warm-gray' | 'cool-gray' | 'high-contrast' | 'outline'> = {
|
|
67
|
+
success: 'green',
|
|
68
|
+
critical: 'red',
|
|
69
|
+
warning: 'purple', // Use orange or other supported color for warnings
|
|
70
|
+
info: 'blue',
|
|
71
|
+
neutral: 'gray',
|
|
72
|
+
};
|
|
73
|
+
// Map warning to a supported color if needed
|
|
74
|
+
const tagType = toneToTagType[mapping.tone] || 'gray';
|
|
75
|
+
return (
|
|
76
|
+
<Tag type={tagType as any}>
|
|
77
|
+
{mapping.label || value}
|
|
78
|
+
</Tag>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
// Fallback tone detection
|
|
82
|
+
const str = String(value).toLowerCase();
|
|
83
|
+
if (str.includes('up') || str.includes('success') || str.includes('ok')) {
|
|
84
|
+
return <Tag type="green">{value}</Tag>;
|
|
85
|
+
}
|
|
86
|
+
if (str.includes('down') || str.includes('error') || str.includes('fail')) {
|
|
87
|
+
return <Tag type="red">{value}</Tag>;
|
|
88
|
+
}
|
|
89
|
+
return <Tag type="gray">{value}</Tag>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Percentage cells render as value + inline progress bar (widget #5)
|
|
93
|
+
if (field.type === 'PERCENTAGE') {
|
|
94
|
+
const numeric =
|
|
95
|
+
typeof value === 'number'
|
|
96
|
+
? Math.max(0, Math.min(100, value))
|
|
97
|
+
: parseFloat(String(value).replace('%', '')) || 0;
|
|
98
|
+
return (
|
|
99
|
+
<span className={styles['table-renderer__progress']}>
|
|
100
|
+
<span className={styles['table-renderer__progress-label']}>
|
|
101
|
+
{formatSemanticValue(value, field)}
|
|
102
|
+
</span>
|
|
103
|
+
<span className={styles['table-renderer__progress-track']}>
|
|
104
|
+
<span
|
|
105
|
+
className={styles['table-renderer__progress-fill']}
|
|
106
|
+
style={{ width: `${numeric}%` }}
|
|
107
|
+
/>
|
|
108
|
+
</span>
|
|
109
|
+
</span>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return formatSemanticValue(value, field);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div className={styles['table-renderer']}>
|
|
118
|
+
<div className={styles['table-renderer__header']}>
|
|
119
|
+
{config.presentation?.title && (
|
|
120
|
+
<h4 className={styles['table-renderer__title']}>{config.presentation.title}</h4>
|
|
121
|
+
)}
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
{displayData.length === 0 ? (
|
|
125
|
+
<div className={styles['table-renderer__empty']}>No data to display</div>
|
|
126
|
+
) : (
|
|
127
|
+
<div className={styles['table-renderer__table-wrapper']}>
|
|
128
|
+
<Table size="sm">
|
|
129
|
+
<TableHead>
|
|
130
|
+
<TableRow>
|
|
131
|
+
{visibleFields.map((field) => (
|
|
132
|
+
<TableHeader key={field.key}>
|
|
133
|
+
{field.label}
|
|
134
|
+
</TableHeader>
|
|
135
|
+
))}
|
|
136
|
+
</TableRow>
|
|
137
|
+
</TableHead>
|
|
138
|
+
<TableBody>
|
|
139
|
+
{displayData.map((row, rowIndex) => (
|
|
140
|
+
<TableRow key={row._id || rowIndex}>
|
|
141
|
+
{visibleFields.map((field) => {
|
|
142
|
+
const value = getRowValue(row, field);
|
|
143
|
+
return (
|
|
144
|
+
<TableCell key={field.key}>
|
|
145
|
+
{formatCellValue(value, field)}
|
|
146
|
+
</TableCell>
|
|
147
|
+
);
|
|
148
|
+
})}
|
|
149
|
+
</TableRow>
|
|
150
|
+
))}
|
|
151
|
+
</TableBody>
|
|
152
|
+
</Table>
|
|
153
|
+
</div>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
{tableData.length > maxRows && (
|
|
157
|
+
<div className={styles['table-renderer__footer']}>
|
|
158
|
+
<span className={styles['table-renderer__footer-count']}>
|
|
159
|
+
Showing {maxRows} of {tableData.length} rows
|
|
160
|
+
</span>
|
|
161
|
+
{config.componentConfig?.viewAllUrl && (
|
|
162
|
+
<a
|
|
163
|
+
href={config.componentConfig.viewAllUrl}
|
|
164
|
+
className={styles['table-renderer__footer-link']}
|
|
165
|
+
>
|
|
166
|
+
{config.componentConfig.viewAllLabel || 'View all'} <ArrowRight size={12} />
|
|
167
|
+
</a>
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
170
|
+
)}
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export default TableRenderer;
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Series Renderer
|
|
3
|
+
* Renders the TIME_SERIES component type (reference: widgets/timeseries.png):
|
|
4
|
+
* current value + delta vs the period start, and a compact area/line chart
|
|
5
|
+
* with a time axis, hairline gridlines, and a crosshair tooltip.
|
|
6
|
+
*
|
|
7
|
+
* Chart specs follow the dataviz method: 2px line (round cap/join), area wash
|
|
8
|
+
* ~10% opacity, >=8px end dot with a 2px surface ring, hairline solid
|
|
9
|
+
* gridlines, axis text in muted ink (never the series color), single series
|
|
10
|
+
* -> no legend, crosshair + tooltip on hover and keyboard.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
14
|
+
import type { DisplayConfigV2 } from '../../../../types/etl-monitor/etl-monitor-v2.types';
|
|
15
|
+
import { formatSemanticValue, resolveRowFieldValue } from '../data-transformer';
|
|
16
|
+
import { getTileIcon } from '../component-icons';
|
|
17
|
+
import styles from '../monitor-renderers.scss';
|
|
18
|
+
|
|
19
|
+
interface TimeSeriesRendererProps {
|
|
20
|
+
config: DisplayConfigV2;
|
|
21
|
+
fields?: Array<{ key: string; label: string; path?: string; type: string; [k: string]: any }>;
|
|
22
|
+
arrayData?: any[];
|
|
23
|
+
rawData?: any;
|
|
24
|
+
data?: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const W_PAD_LEFT = 38;
|
|
28
|
+
const W_PAD_RIGHT = 12;
|
|
29
|
+
const H_PAD_TOP = 8;
|
|
30
|
+
const H_PAD_BOTTOM = 18;
|
|
31
|
+
|
|
32
|
+
/** Compact axis label: durations human, numbers compact */
|
|
33
|
+
function compactAxis(value: number, type?: string): string {
|
|
34
|
+
if (type === 'DURATION') {
|
|
35
|
+
const totalSeconds = Math.floor(value / 1000);
|
|
36
|
+
if (totalSeconds < 60) return `${totalSeconds}s`;
|
|
37
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
38
|
+
if (minutes < 60) return `${minutes}m`;
|
|
39
|
+
return `${Math.floor(minutes / 60)}h`;
|
|
40
|
+
}
|
|
41
|
+
if (Math.abs(value) >= 1000) {
|
|
42
|
+
return new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(value);
|
|
43
|
+
}
|
|
44
|
+
return String(Math.round(value));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function formatTime(ts: number, type?: string): string {
|
|
48
|
+
const d = new Date(ts);
|
|
49
|
+
if (isNaN(d.getTime())) return String(ts);
|
|
50
|
+
if (type === 'DATE') return d.toLocaleDateString();
|
|
51
|
+
return d.toLocaleTimeString(undefined, { hour: 'numeric', minute: '2-digit' });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function TimeSeriesRenderer({ config, fields, arrayData, rawData }: TimeSeriesRendererProps) {
|
|
55
|
+
const svgRef = useRef<SVGSVGElement | null>(null);
|
|
56
|
+
const wrapRef = useRef<HTMLDivElement | null>(null);
|
|
57
|
+
const [width, setWidth] = useState(280);
|
|
58
|
+
const [active, setActive] = useState<number | null>(null);
|
|
59
|
+
|
|
60
|
+
const safeFields = fields || [];
|
|
61
|
+
const timeField = safeFields.find((f) => f.type === 'TIMESTAMP');
|
|
62
|
+
const valueField =
|
|
63
|
+
safeFields.find((f) => f.primary) ||
|
|
64
|
+
safeFields.find((f) => ['PERCENTAGE', 'NUMBER', 'INTEGER', 'DECIMAL', 'DURATION'].includes(f.type)) ||
|
|
65
|
+
safeFields.find((f) => f.type !== 'TIMESTAMP');
|
|
66
|
+
const headerIcon = getTileIcon(Object.values(config.componentConfig?.icons || {})[0]);
|
|
67
|
+
|
|
68
|
+
// Resolve the point series
|
|
69
|
+
const points = useMemo(() => {
|
|
70
|
+
const rows = arrayData && arrayData.length > 0
|
|
71
|
+
? arrayData
|
|
72
|
+
: Array.isArray(rawData)
|
|
73
|
+
? rawData
|
|
74
|
+
: [];
|
|
75
|
+
|
|
76
|
+
const get = (row: any, f: any): any =>
|
|
77
|
+
resolveRowFieldValue(row, f, config.data?.arrayPath);
|
|
78
|
+
|
|
79
|
+
if (!timeField || !valueField) return [];
|
|
80
|
+
return rows
|
|
81
|
+
.map((row: any) => ({
|
|
82
|
+
x: get(row, timeField),
|
|
83
|
+
y: get(row, valueField),
|
|
84
|
+
}))
|
|
85
|
+
.filter((p: any) => p.x != null && p.y != null && typeof p.y === 'number')
|
|
86
|
+
.sort((a: any, b: any) => a.x - b.x);
|
|
87
|
+
}, [arrayData, rawData, timeField, valueField, config]);
|
|
88
|
+
|
|
89
|
+
// Responsive width
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
const el = wrapRef.current;
|
|
92
|
+
if (!el || typeof ResizeObserver === 'undefined') return;
|
|
93
|
+
const observer = new ResizeObserver((entries) => {
|
|
94
|
+
const w = entries[0]?.contentRect?.width;
|
|
95
|
+
if (w && w > 40) setWidth(Math.floor(w));
|
|
96
|
+
});
|
|
97
|
+
observer.observe(el);
|
|
98
|
+
return () => observer.disconnect();
|
|
99
|
+
}, []);
|
|
100
|
+
|
|
101
|
+
const H = 120;
|
|
102
|
+
const plotW = Math.max(40, width - W_PAD_LEFT - W_PAD_RIGHT);
|
|
103
|
+
const plotH = H - H_PAD_TOP - H_PAD_BOTTOM;
|
|
104
|
+
|
|
105
|
+
const xMin = points.length ? points[0].x : 0;
|
|
106
|
+
const xMax = points.length ? points[points.length - 1].x : 1;
|
|
107
|
+
const yValues = points.map((p) => p.y);
|
|
108
|
+
const yMin = Math.min(0, ...yValues);
|
|
109
|
+
const yMax = points.length ? Math.max(...yValues) : 1;
|
|
110
|
+
|
|
111
|
+
const sx = (x: number) => W_PAD_LEFT + ((x - xMin) / (xMax - xMin || 1)) * plotW;
|
|
112
|
+
const sy = (y: number) => H_PAD_TOP + (1 - (y - yMin) / (yMax - yMin || 1)) * plotH;
|
|
113
|
+
|
|
114
|
+
const linePath = points.map((p, i) => `${i === 0 ? 'M' : 'L'}${sx(p.x).toFixed(1)},${sy(p.y).toFixed(1)}`).join(' ');
|
|
115
|
+
const baseY = sy(yMin);
|
|
116
|
+
const areaPath = points.length
|
|
117
|
+
? `${linePath} L${sx(points[points.length - 1].x).toFixed(1)},${baseY.toFixed(1)} L${sx(points[0].x).toFixed(1)},${baseY.toFixed(1)} Z`
|
|
118
|
+
: '';
|
|
119
|
+
|
|
120
|
+
// Delta: change from period start to current value
|
|
121
|
+
const delta = useMemo(() => {
|
|
122
|
+
if (points.length < 2) return null;
|
|
123
|
+
const first = points[0].y;
|
|
124
|
+
const last = points[points.length - 1].y;
|
|
125
|
+
if (!first) return null;
|
|
126
|
+
const pct = ((last - first) / Math.abs(first)) * 100;
|
|
127
|
+
if (!isFinite(pct)) return null;
|
|
128
|
+
return pct;
|
|
129
|
+
}, [points]);
|
|
130
|
+
|
|
131
|
+
const currentValue = points.length ? points[points.length - 1].y : null;
|
|
132
|
+
const currentLabel = currentValue != null ? formatSemanticValue(currentValue, valueField || {}) : '—';
|
|
133
|
+
const deltaLabel = config.componentConfig?.deltaLabel || 'vs previous period';
|
|
134
|
+
const gridTicks = [yMin, yMin + (yMax - yMin) / 2, yMax];
|
|
135
|
+
|
|
136
|
+
const handleMove = (e: React.MouseEvent<SVGSVGElement>) => {
|
|
137
|
+
if (!points.length || !svgRef.current) return;
|
|
138
|
+
const rect = svgRef.current.getBoundingClientRect();
|
|
139
|
+
const px = ((e.clientX - rect.left) / rect.width) * width;
|
|
140
|
+
let nearest = 0;
|
|
141
|
+
let best = Infinity;
|
|
142
|
+
points.forEach((p, i) => {
|
|
143
|
+
const d = Math.abs(sx(p.x) - px);
|
|
144
|
+
if (d < best) {
|
|
145
|
+
best = d;
|
|
146
|
+
nearest = i;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
setActive(nearest);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const handleKey = (e: React.KeyboardEvent) => {
|
|
153
|
+
if (!points.length) return;
|
|
154
|
+
if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
const step = e.key === 'ArrowLeft' ? -1 : 1;
|
|
157
|
+
setActive((prev) => {
|
|
158
|
+
const base = prev ?? points.length - 1;
|
|
159
|
+
return Math.max(0, Math.min(points.length - 1, base + step));
|
|
160
|
+
});
|
|
161
|
+
} else if (e.key === 'Escape') {
|
|
162
|
+
setActive(null);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const activePoint = active != null ? points[active] : null;
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<div className={styles['time-series-renderer']}>
|
|
170
|
+
{/* Header: icon tile + metric label + current value + delta */}
|
|
171
|
+
<div className={styles['time-series-renderer__head']}>
|
|
172
|
+
{(() => {
|
|
173
|
+
const Icon = headerIcon;
|
|
174
|
+
return Icon ? (
|
|
175
|
+
<span className={styles['time-series-renderer__icon']}>
|
|
176
|
+
<Icon size={20} />
|
|
177
|
+
</span>
|
|
178
|
+
) : null;
|
|
179
|
+
})()}
|
|
180
|
+
<div className={styles['time-series-renderer__head-text']}>
|
|
181
|
+
<span className={styles['time-series-renderer__label']}>
|
|
182
|
+
{valueField?.label || config.presentation?.title || 'Trend'}
|
|
183
|
+
</span>
|
|
184
|
+
<span className={styles['time-series-renderer__value']}>{currentLabel}</span>
|
|
185
|
+
</div>
|
|
186
|
+
{delta != null && (
|
|
187
|
+
<span className={styles['time-series-renderer__head-delta']}>
|
|
188
|
+
<span className={`${styles['time-series-renderer__delta']} ${delta >= 0 ? styles['time-series-renderer__delta--up'] : styles['time-series-renderer__delta--down']}`}>
|
|
189
|
+
{delta >= 0 ? '↑' : '↓'} {Math.abs(delta).toFixed(1)}%
|
|
190
|
+
</span>
|
|
191
|
+
<span className={styles['time-series-renderer__delta-note']}>{deltaLabel}</span>
|
|
192
|
+
</span>
|
|
193
|
+
)}
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
{/* Chart */}
|
|
197
|
+
{points.length === 0 ? (
|
|
198
|
+
<div className={styles['time-series-renderer__empty']}>No time series data</div>
|
|
199
|
+
) : (
|
|
200
|
+
<div className={styles['time-series-renderer__chart']} ref={wrapRef}>
|
|
201
|
+
<svg
|
|
202
|
+
ref={svgRef}
|
|
203
|
+
width={width}
|
|
204
|
+
height={H}
|
|
205
|
+
role="img"
|
|
206
|
+
aria-label={`${valueField?.label || 'Trend'} over time`}
|
|
207
|
+
tabIndex={0}
|
|
208
|
+
onMouseMove={handleMove}
|
|
209
|
+
onMouseLeave={() => setActive(null)}
|
|
210
|
+
onKeyDown={handleKey}
|
|
211
|
+
onBlur={() => setActive(null)}
|
|
212
|
+
>
|
|
213
|
+
{/* hairline gridlines + y ticks (muted ink) */}
|
|
214
|
+
{gridTicks.map((tick, i) => (
|
|
215
|
+
<g key={i}>
|
|
216
|
+
<line
|
|
217
|
+
x1={W_PAD_LEFT}
|
|
218
|
+
x2={width - W_PAD_RIGHT}
|
|
219
|
+
y1={sy(tick)}
|
|
220
|
+
y2={sy(tick)}
|
|
221
|
+
className={styles['time-series-renderer__grid']}
|
|
222
|
+
/>
|
|
223
|
+
<text
|
|
224
|
+
x={W_PAD_LEFT - 6}
|
|
225
|
+
y={sy(tick)}
|
|
226
|
+
textAnchor="end"
|
|
227
|
+
dominantBaseline="middle"
|
|
228
|
+
className={styles['time-series-renderer__tick']}
|
|
229
|
+
>
|
|
230
|
+
{compactAxis(tick, valueField?.type)}
|
|
231
|
+
</text>
|
|
232
|
+
</g>
|
|
233
|
+
))}
|
|
234
|
+
|
|
235
|
+
{/* crosshair */}
|
|
236
|
+
{activePoint && (
|
|
237
|
+
<line
|
|
238
|
+
x1={sx(activePoint.x)}
|
|
239
|
+
x2={sx(activePoint.x)}
|
|
240
|
+
y1={H_PAD_TOP}
|
|
241
|
+
y2={H_PAD_TOP + plotH}
|
|
242
|
+
className={styles['time-series-renderer__crosshair']}
|
|
243
|
+
/>
|
|
244
|
+
)}
|
|
245
|
+
|
|
246
|
+
{/* area wash + 2px line */}
|
|
247
|
+
<path d={areaPath} className={styles['time-series-renderer__area']} />
|
|
248
|
+
<path d={linePath} className={styles['time-series-renderer__line']} />
|
|
249
|
+
|
|
250
|
+
{/* hovered marker (surface ring) */}
|
|
251
|
+
{activePoint && (
|
|
252
|
+
<circle
|
|
253
|
+
cx={sx(activePoint.x)}
|
|
254
|
+
cy={sy(activePoint.y)}
|
|
255
|
+
r={4.5}
|
|
256
|
+
className={styles['time-series-renderer__dot']}
|
|
257
|
+
/>
|
|
258
|
+
)}
|
|
259
|
+
|
|
260
|
+
{/* current-value end dot (surface ring) */}
|
|
261
|
+
{points.length > 0 && (
|
|
262
|
+
<circle
|
|
263
|
+
cx={sx(points[points.length - 1].x)}
|
|
264
|
+
cy={sy(points[points.length - 1].y)}
|
|
265
|
+
r={4.5}
|
|
266
|
+
className={styles['time-series-renderer__dot']}
|
|
267
|
+
/>
|
|
268
|
+
)}
|
|
269
|
+
|
|
270
|
+
{/* x labels: first / middle / last (muted ink) */}
|
|
271
|
+
{[0, Math.floor((points.length - 1) / 2), points.length - 1].map((idx, i) => {
|
|
272
|
+
if (idx < 0 || !points[idx]) return null;
|
|
273
|
+
return (
|
|
274
|
+
<text
|
|
275
|
+
key={i}
|
|
276
|
+
x={sx(points[idx].x)}
|
|
277
|
+
y={H - 4}
|
|
278
|
+
textAnchor={i === 0 ? 'start' : i === 2 ? 'end' : 'middle'}
|
|
279
|
+
className={styles['time-series-renderer__tick']}
|
|
280
|
+
>
|
|
281
|
+
{formatTime(points[idx].x, timeField?.format?.timestamp?.display === 'date' ? 'DATE' : undefined)}
|
|
282
|
+
</text>
|
|
283
|
+
);
|
|
284
|
+
})}
|
|
285
|
+
</svg>
|
|
286
|
+
|
|
287
|
+
{/* tooltip (value leads, time follows) */}
|
|
288
|
+
{activePoint && (
|
|
289
|
+
<div
|
|
290
|
+
className={styles['time-series-renderer__tooltip']}
|
|
291
|
+
style={{
|
|
292
|
+
left: `${(sx(activePoint.x) / width) * 100}%`,
|
|
293
|
+
top: 0,
|
|
294
|
+
}}
|
|
295
|
+
>
|
|
296
|
+
<span className={styles['time-series-renderer__tooltip-value']}>
|
|
297
|
+
{formatSemanticValue(activePoint.y, valueField || {})}
|
|
298
|
+
</span>
|
|
299
|
+
<span className={styles['time-series-renderer__tooltip-time']}>
|
|
300
|
+
{formatTime(activePoint.x)}
|
|
301
|
+
</span>
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
304
|
+
</div>
|
|
305
|
+
)}
|
|
306
|
+
</div>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export default TimeSeriesRenderer;
|