@mwater/visualization 5.0.0
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/.prettierrc +11 -0
- package/.storybook/config.js +7 -0
- package/.storybook/head.html +4 -0
- package/.storybook/webpack.config.js +15 -0
- package/.vscode/launch.json +40 -0
- package/LICENSE +21 -0
- package/README.md +19 -0
- package/build-demo.ts +54 -0
- package/lib/CheckboxComponent.d.ts +15 -0
- package/lib/CheckboxComponent.js +25 -0
- package/lib/ColorComponent.d.ts +24 -0
- package/lib/ColorComponent.js +77 -0
- package/lib/ColorSchemeFactory.d.ts +8 -0
- package/lib/ColorSchemeFactory.js +164 -0
- package/lib/CsvBuilder.d.ts +5 -0
- package/lib/CsvBuilder.js +63 -0
- package/lib/DateRangeComponent.d.ts +81 -0
- package/lib/DateRangeComponent.js +190 -0
- package/lib/FiltersDesignerComponent.d.ts +25 -0
- package/lib/FiltersDesignerComponent.js +38 -0
- package/lib/ImplicitFilterBuilder.d.ts +8 -0
- package/lib/ImplicitFilterBuilder.js +114 -0
- package/lib/JsonQLFilter.d.ts +7 -0
- package/lib/JsonQLFilter.js +2 -0
- package/lib/LocaleContextInjector.d.ts +14 -0
- package/lib/LocaleContextInjector.js +20 -0
- package/lib/MWaterAddRelatedFormComponent.d.ts +25 -0
- package/lib/MWaterAddRelatedFormComponent.js +155 -0
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +31 -0
- package/lib/MWaterAddRelatedIndicatorComponent.js +129 -0
- package/lib/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/MWaterAssetSystemsListComponent.js +78 -0
- package/lib/MWaterCompleteTableSelectComponent.d.ts +224 -0
- package/lib/MWaterCompleteTableSelectComponent.js +680 -0
- package/lib/MWaterContextComponent.d.ts +31 -0
- package/lib/MWaterContextComponent.js +111 -0
- package/lib/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/MWaterCustomTablesetListComponent.js +87 -0
- package/lib/MWaterGlobalFiltersComponent.d.ts +16 -0
- package/lib/MWaterGlobalFiltersComponent.js +103 -0
- package/lib/MWaterLoaderComponent.d.ts +42 -0
- package/lib/MWaterLoaderComponent.js +77 -0
- package/lib/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/MWaterMetricsTableListComponent.js +79 -0
- package/lib/MWaterResponsesFilterComponent.d.ts +42 -0
- package/lib/MWaterResponsesFilterComponent.js +145 -0
- package/lib/MWaterTableSelectComponent.d.ts +36 -0
- package/lib/MWaterTableSelectComponent.js +206 -0
- package/lib/MenuItemComponent.d.ts +0 -0
- package/lib/MenuItemComponent.js +3 -0
- package/lib/PopoverComponent.d.ts +15 -0
- package/lib/PopoverComponent.js +49 -0
- package/lib/RadioButtonComponent.d.ts +16 -0
- package/lib/RadioButtonComponent.js +25 -0
- package/lib/TableSelectComponent.d.ts +21 -0
- package/lib/TableSelectComponent.js +68 -0
- package/lib/UIComponents.d.ts +85 -0
- package/lib/UIComponents.js +195 -0
- package/lib/UndoStack.d.ts +11 -0
- package/lib/UndoStack.js +51 -0
- package/lib/VerticalLayoutComponent.d.ts +21 -0
- package/lib/VerticalLayoutComponent.js +76 -0
- package/lib/WidgetScope.d.ts +13 -0
- package/lib/WidgetScope.js +2 -0
- package/lib/axes/Axis.d.ts +81 -0
- package/lib/axes/Axis.js +2 -0
- package/lib/axes/AxisBuilder.d.ts +66 -0
- package/lib/axes/AxisBuilder.js +1202 -0
- package/lib/axes/AxisColorEditorComponent.d.ts +39 -0
- package/lib/axes/AxisColorEditorComponent.js +133 -0
- package/lib/axes/AxisComponent.d.ts +65 -0
- package/lib/axes/AxisComponent.js +359 -0
- package/lib/axes/BinsComponent.d.ts +21 -0
- package/lib/axes/BinsComponent.js +96 -0
- package/lib/axes/CategoryMapComponent.d.ts +41 -0
- package/lib/axes/CategoryMapComponent.js +175 -0
- package/lib/axes/ColorPaletteCollectionComponent.d.ts +17 -0
- package/lib/axes/ColorPaletteCollectionComponent.js +130 -0
- package/lib/axes/RangesComponent.d.ts +35 -0
- package/lib/axes/RangesComponent.js +119 -0
- package/lib/componenttest.d.ts +1 -0
- package/lib/componenttest.js +47 -0
- package/lib/compressJson.d.ts +4 -0
- package/lib/compressJson.js +19 -0
- package/lib/dashboards/DashboardComponent.d.ts +115 -0
- package/lib/dashboards/DashboardComponent.js +297 -0
- package/lib/dashboards/DashboardDataSource.d.ts +9 -0
- package/lib/dashboards/DashboardDataSource.js +14 -0
- package/lib/dashboards/DashboardDesign.d.ts +45 -0
- package/lib/dashboards/DashboardDesign.js +2 -0
- package/lib/dashboards/DashboardUpgrader.d.ts +4 -0
- package/lib/dashboards/DashboardUpgrader.js +95 -0
- package/lib/dashboards/DashboardUtils.d.ts +7 -0
- package/lib/dashboards/DashboardUtils.js +69 -0
- package/lib/dashboards/DashboardViewComponent.d.ts +71 -0
- package/lib/dashboards/DashboardViewComponent.js +235 -0
- package/lib/dashboards/DirectDashboardDataSource.d.ts +31 -0
- package/lib/dashboards/DirectDashboardDataSource.js +62 -0
- package/lib/dashboards/LayoutOptionsComponent.d.ts +11 -0
- package/lib/dashboards/LayoutOptionsComponent.js +119 -0
- package/lib/dashboards/README.md +13 -0
- package/lib/dashboards/ServerDashboardDataSource.d.ts +96 -0
- package/lib/dashboards/ServerDashboardDataSource.js +383 -0
- package/lib/dashboards/SettingsModalComponent.d.ts +33 -0
- package/lib/dashboards/SettingsModalComponent.js +122 -0
- package/lib/dashboards/WidgetComponent.d.ts +53 -0
- package/lib/dashboards/WidgetComponent.js +66 -0
- package/lib/dashboards/layoutOptions.d.ts +19 -0
- package/lib/dashboards/layoutOptions.js +19 -0
- package/lib/datagrids/DatagridComponent.d.ts +122 -0
- package/lib/datagrids/DatagridComponent.js +285 -0
- package/lib/datagrids/DatagridDataSource.d.ts +9 -0
- package/lib/datagrids/DatagridDataSource.js +13 -0
- package/lib/datagrids/DatagridDesign.d.ts +75 -0
- package/lib/datagrids/DatagridDesign.js +2 -0
- package/lib/datagrids/DatagridDesignerComponent.d.ts +114 -0
- package/lib/datagrids/DatagridDesignerComponent.js +389 -0
- package/lib/datagrids/DatagridQueryBuilder.d.ts +68 -0
- package/lib/datagrids/DatagridQueryBuilder.js +540 -0
- package/lib/datagrids/DatagridUtils.d.ts +8 -0
- package/lib/datagrids/DatagridUtils.js +91 -0
- package/lib/datagrids/DatagridViewComponent.d.ts +86 -0
- package/lib/datagrids/DatagridViewComponent.js +321 -0
- package/lib/datagrids/DirectDatagridDataSource.d.ts +20 -0
- package/lib/datagrids/DirectDatagridDataSource.js +62 -0
- package/lib/datagrids/EditExprCellComponent.d.ts +77 -0
- package/lib/datagrids/EditExprCellComponent.js +212 -0
- package/lib/datagrids/ExprCellComponent.d.ts +34 -0
- package/lib/datagrids/ExprCellComponent.js +81 -0
- package/lib/datagrids/FindReplaceModalComponent.d.ts +52 -0
- package/lib/datagrids/FindReplaceModalComponent.js +248 -0
- package/lib/datagrids/LabeledExprGenerator.d.ts +40 -0
- package/lib/datagrids/LabeledExprGenerator.js +252 -0
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +22 -0
- package/lib/datagrids/OrderBysDesignerComponent.js +67 -0
- package/lib/datagrids/README.md +3 -0
- package/lib/datagrids/ServerDatagridDataSource.d.ts +40 -0
- package/lib/datagrids/ServerDatagridDataSource.js +79 -0
- package/lib/demo.d.ts +1 -0
- package/lib/demo.js +4006 -0
- package/lib/demoBlocks.d.ts +1 -0
- package/lib/demoBlocks.js +112 -0
- package/lib/index.css +550 -0
- package/lib/index.d.ts +69 -0
- package/lib/index.js +156 -0
- package/lib/injectTableAlias.d.ts +2 -0
- package/lib/injectTableAlias.js +30 -0
- package/lib/languages.d.ts +9 -0
- package/lib/languages.js +926 -0
- package/lib/layout-styles.css +263 -0
- package/lib/layouts/DecoratedBlockComponent.d.ts +44 -0
- package/lib/layouts/DecoratedBlockComponent.js +96 -0
- package/lib/layouts/DragSourceComponent.d.ts +2 -0
- package/lib/layouts/DragSourceComponent.js +26 -0
- package/lib/layouts/LayoutManager.d.ts +50 -0
- package/lib/layouts/LayoutManager.js +41 -0
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +75 -0
- package/lib/layouts/blocks/BlocksDisplayComponent.js +336 -0
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +36 -0
- package/lib/layouts/blocks/BlocksLayoutManager.js +74 -0
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.d.ts +9 -0
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +59 -0
- package/lib/layouts/blocks/DraggableBlockComponent.d.ts +2 -0
- package/lib/layouts/blocks/DraggableBlockComponent.js +163 -0
- package/lib/layouts/blocks/HorizontalBlockComponent.d.ts +31 -0
- package/lib/layouts/blocks/HorizontalBlockComponent.js +191 -0
- package/lib/layouts/blocks/PaletteItemComponent.d.ts +14 -0
- package/lib/layouts/blocks/PaletteItemComponent.js +15 -0
- package/lib/layouts/blocks/README.md +11 -0
- package/lib/layouts/blocks/blockUtils.d.ts +22 -0
- package/lib/layouts/blocks/blockUtils.js +155 -0
- package/lib/layouts/decorated-block.css +100 -0
- package/lib/layouts/grid/GridLayoutComponent.d.ts +23 -0
- package/lib/layouts/grid/GridLayoutComponent.js +49 -0
- package/lib/layouts/grid/GridLayoutManager.d.ts +29 -0
- package/lib/layouts/grid/GridLayoutManager.js +141 -0
- package/lib/layouts/grid/LegoLayoutEngine.d.ts +33 -0
- package/lib/layouts/grid/LegoLayoutEngine.js +129 -0
- package/lib/layouts/grid/PaletteItemComponent.d.ts +14 -0
- package/lib/layouts/grid/PaletteItemComponent.js +15 -0
- package/lib/layouts/grid/README.md +14 -0
- package/lib/layouts/grid/WidgetContainerComponent.d.ts +9 -0
- package/lib/layouts/grid/WidgetContainerComponent.js +333 -0
- package/lib/mWaterLoader.d.ts +26 -0
- package/lib/mWaterLoader.js +55 -0
- package/lib/mapdemo.d.ts +0 -0
- package/lib/mapdemo.js +115 -0
- package/lib/maps/AddLayerComponent.d.ts +22 -0
- package/lib/maps/AddLayerComponent.js +85 -0
- package/lib/maps/AdminScopeAndDetailLevelComponent.d.ts +19 -0
- package/lib/maps/AdminScopeAndDetailLevelComponent.js +59 -0
- package/lib/maps/BaseLayerDesignerComponent.d.ts +28 -0
- package/lib/maps/BaseLayerDesignerComponent.js +57 -0
- package/lib/maps/BingLayer.d.ts +1 -0
- package/lib/maps/BingLayer.js +151 -0
- package/lib/maps/BufferLayer.d.ts +51 -0
- package/lib/maps/BufferLayer.js +816 -0
- package/lib/maps/BufferLayerDesign.d.ts +37 -0
- package/lib/maps/BufferLayerDesign.js +2 -0
- package/lib/maps/BufferLayerDesignerComponent.d.ts +49 -0
- package/lib/maps/BufferLayerDesignerComponent.js +217 -0
- package/lib/maps/ChoroplethLayer.d.ts +74 -0
- package/lib/maps/ChoroplethLayer.js +1515 -0
- package/lib/maps/ChoroplethLayerDesign.d.ts +56 -0
- package/lib/maps/ChoroplethLayerDesign.js +2 -0
- package/lib/maps/ChoroplethLayerDesigner.d.ts +53 -0
- package/lib/maps/ChoroplethLayerDesigner.js +382 -0
- package/lib/maps/ClusterLayer.d.ts +38 -0
- package/lib/maps/ClusterLayer.js +746 -0
- package/lib/maps/ClusterLayerDesign.d.ts +22 -0
- package/lib/maps/ClusterLayerDesign.js +2 -0
- package/lib/maps/ClusterLayerDesignerComponent.d.ts +37 -0
- package/lib/maps/ClusterLayerDesignerComponent.js +110 -0
- package/lib/maps/DetailLevelSelectComponent.d.ts +122 -0
- package/lib/maps/DetailLevelSelectComponent.js +91 -0
- package/lib/maps/DirectMapDataSource.d.ts +68 -0
- package/lib/maps/DirectMapDataSource.js +265 -0
- package/lib/maps/EditHoverOver.d.ts +18 -0
- package/lib/maps/EditHoverOver.js +88 -0
- package/lib/maps/EditPopupComponent.d.ts +26 -0
- package/lib/maps/EditPopupComponent.js +75 -0
- package/lib/maps/Grid Functions.sql +167 -0
- package/lib/maps/GridLayer.d.ts +48 -0
- package/lib/maps/GridLayer.js +684 -0
- package/lib/maps/GridLayerDesign.d.ts +35 -0
- package/lib/maps/GridLayerDesign.js +2 -0
- package/lib/maps/GridLayerDesigner.d.ts +38 -0
- package/lib/maps/GridLayerDesigner.js +229 -0
- package/lib/maps/HoverContent.d.ts +13 -0
- package/lib/maps/HoverContent.js +92 -0
- package/lib/maps/HtmlUrlLegend.d.ts +16 -0
- package/lib/maps/HtmlUrlLegend.js +38 -0
- package/lib/maps/Layer.d.ts +164 -0
- package/lib/maps/Layer.js +193 -0
- package/lib/maps/LayerFactory.d.ts +5 -0
- package/lib/maps/LayerFactory.js +47 -0
- package/lib/maps/LayerLegendComponent.d.ts +23 -0
- package/lib/maps/LayerLegendComponent.js +68 -0
- package/lib/maps/LayerSwitcherComponent.d.ts +7 -0
- package/lib/maps/LayerSwitcherComponent.js +97 -0
- package/lib/maps/LeafletLoading.css +24 -0
- package/lib/maps/LeafletLoading.d.ts +42 -0
- package/lib/maps/LeafletLoading.js +318 -0
- package/lib/maps/LeafletMapComponent.d.ts +141 -0
- package/lib/maps/LeafletMapComponent.js +438 -0
- package/lib/maps/LegendComponent.d.ts +14 -0
- package/lib/maps/LegendComponent.js +74 -0
- package/lib/maps/LegendGroup.d.ts +24 -0
- package/lib/maps/LegendGroup.js +86 -0
- package/lib/maps/MWaterServerLayer.d.ts +40 -0
- package/lib/maps/MWaterServerLayer.js +101 -0
- package/lib/maps/MapBoundsCalculator.d.ts +16 -0
- package/lib/maps/MapBoundsCalculator.js +85 -0
- package/lib/maps/MapComponent.d.ts +98 -0
- package/lib/maps/MapComponent.js +186 -0
- package/lib/maps/MapControlComponent.d.ts +17 -0
- package/lib/maps/MapControlComponent.js +25 -0
- package/lib/maps/MapDataSource.d.ts +18 -0
- package/lib/maps/MapDataSource.js +2 -0
- package/lib/maps/MapDesign.d.ts +77 -0
- package/lib/maps/MapDesign.js +2 -0
- package/lib/maps/MapDesignerComponent.d.ts +39 -0
- package/lib/maps/MapDesignerComponent.js +215 -0
- package/lib/maps/MapFiltersDesignerComponent.d.ts +21 -0
- package/lib/maps/MapFiltersDesignerComponent.js +70 -0
- package/lib/maps/MapLayerDataSource.d.ts +22 -0
- package/lib/maps/MapLayerDataSource.js +2 -0
- package/lib/maps/MapLayerViewDesignerComponent.d.ts +87 -0
- package/lib/maps/MapLayerViewDesignerComponent.js +151 -0
- package/lib/maps/MapLayersDesignerComponent.d.ts +32 -0
- package/lib/maps/MapLayersDesignerComponent.js +98 -0
- package/lib/maps/MapUtils.d.ts +21 -0
- package/lib/maps/MapUtils.js +119 -0
- package/lib/maps/MapViewComponent.d.ts +38 -0
- package/lib/maps/MapViewComponent.js +20 -0
- package/lib/maps/Maptiler-logo.png +0 -0
- package/lib/maps/MarkerSymbolSelectComponent.d.ts +10 -0
- package/lib/maps/MarkerSymbolSelectComponent.js +28 -0
- package/lib/maps/MarkersLayer.d.ts +66 -0
- package/lib/maps/MarkersLayer.js +838 -0
- package/lib/maps/MarkersLayerDesign.d.ts +44 -0
- package/lib/maps/MarkersLayerDesign.js +2 -0
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +56 -0
- package/lib/maps/MarkersLayerDesignerComponent.js +269 -0
- package/lib/maps/PopupFilterJoinsEditComponent.d.ts +30 -0
- package/lib/maps/PopupFilterJoinsEditComponent.js +75 -0
- package/lib/maps/PopupFilterJoinsUtils.d.ts +15 -0
- package/lib/maps/PopupFilterJoinsUtils.js +91 -0
- package/lib/maps/RasterMapViewComponent.d.ts +108 -0
- package/lib/maps/RasterMapViewComponent.js +283 -0
- package/lib/maps/RegionSelectComponent.d.ts +55 -0
- package/lib/maps/RegionSelectComponent.js +61 -0
- package/lib/maps/ScopeAndDetailLevelComponent.d.ts +21 -0
- package/lib/maps/ScopeAndDetailLevelComponent.js +76 -0
- package/lib/maps/ServerMapDataSource.d.ts +86 -0
- package/lib/maps/ServerMapDataSource.js +273 -0
- package/lib/maps/SwitchableTileUrlLayer.d.ts +53 -0
- package/lib/maps/SwitchableTileUrlLayer.js +69 -0
- package/lib/maps/SwitchableTileUrlLayerDesigner.d.ts +14 -0
- package/lib/maps/SwitchableTileUrlLayerDesigner.js +26 -0
- package/lib/maps/TileUrlLayer.d.ts +40 -0
- package/lib/maps/TileUrlLayer.js +96 -0
- package/lib/maps/UtfGridLayer.d.ts +1 -0
- package/lib/maps/UtfGridLayer.js +216 -0
- package/lib/maps/VectorMapViewComponent.css +21 -0
- package/lib/maps/VectorMapViewComponent.d.ts +44 -0
- package/lib/maps/VectorMapViewComponent.js +565 -0
- package/lib/maps/ZoomLevelsComponent.d.ts +15 -0
- package/lib/maps/ZoomLevelsComponent.js +37 -0
- package/lib/maps/mapSymbols.d.ts +6 -0
- package/lib/maps/mapSymbols.js +167 -0
- package/lib/maps/mapboxUtils.d.ts +6 -0
- package/lib/maps/mapboxUtils.js +60 -0
- package/lib/maps/maps.d.ts +36 -0
- package/lib/maps/maps.js +2 -0
- package/lib/maps/marker-icon-2x.png +0 -0
- package/lib/maps/marker-icon.png +0 -0
- package/lib/maps/marker-shadow.png +0 -0
- package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
- package/lib/maps/symbols/font-awesome/ban.png +0 -0
- package/lib/maps/symbols/font-awesome/beer.png +0 -0
- package/lib/maps/symbols/font-awesome/bell.png +0 -0
- package/lib/maps/symbols/font-awesome/bolt.png +0 -0
- package/lib/maps/symbols/font-awesome/building.png +0 -0
- package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
- package/lib/maps/symbols/font-awesome/bus.png +0 -0
- package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
- package/lib/maps/symbols/font-awesome/certificate.png +0 -0
- package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/check.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/lib/maps/symbols/font-awesome/cloud.png +0 -0
- package/lib/maps/symbols/font-awesome/comment.png +0 -0
- package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/lib/maps/symbols/font-awesome/female.png +0 -0
- package/lib/maps/symbols/font-awesome/file.png +0 -0
- package/lib/maps/symbols/font-awesome/flag.png +0 -0
- package/lib/maps/symbols/font-awesome/flask.png +0 -0
- package/lib/maps/symbols/font-awesome/h-square.png +0 -0
- package/lib/maps/symbols/font-awesome/home.png +0 -0
- package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/male.png +0 -0
- package/lib/maps/symbols/font-awesome/medkit.png +0 -0
- package/lib/maps/symbols/font-awesome/mobile.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
- package/lib/maps/symbols/font-awesome/plus.png +0 -0
- package/lib/maps/symbols/font-awesome/square.png +0 -0
- package/lib/maps/symbols/font-awesome/star.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/lib/maps/symbols/font-awesome/ticket.png +0 -0
- package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
- package/lib/maps/symbols/font-awesome/times.png +0 -0
- package/lib/maps/symbols/font-awesome/tint.png +0 -0
- package/lib/maps/symbols/font-awesome/tree.png +0 -0
- package/lib/maps/symbols/font-awesome/university.png +0 -0
- package/lib/maps/symbols/font-awesome/usd.png +0 -0
- package/lib/maps/symbols/font-awesome/user.png +0 -0
- package/lib/maps/symbols/font-awesome/users.png +0 -0
- package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/lib/maps/vectorMaps.d.ts +42 -0
- package/lib/maps/vectorMaps.js +331 -0
- package/lib/memoizedDebounce.d.ts +6 -0
- package/lib/memoizedDebounce.js +21 -0
- package/lib/quickfilter/DateExprComponent.d.ts +81 -0
- package/lib/quickfilter/DateExprComponent.js +197 -0
- package/lib/quickfilter/IdArrayQuickfilterComponent.d.ts +24 -0
- package/lib/quickfilter/IdArrayQuickfilterComponent.js +30 -0
- package/lib/quickfilter/Quickfilter.d.ts +21 -0
- package/lib/quickfilter/Quickfilter.js +2 -0
- package/lib/quickfilter/QuickfilterCompiler.d.ts +16 -0
- package/lib/quickfilter/QuickfilterCompiler.js +167 -0
- package/lib/quickfilter/QuickfilterUtils.d.ts +7 -0
- package/lib/quickfilter/QuickfilterUtils.js +106 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +293 -0
- package/lib/quickfilter/QuickfiltersComponent.js +257 -0
- package/lib/quickfilter/QuickfiltersDataSource.d.ts +7 -0
- package/lib/quickfilter/QuickfiltersDataSource.js +2 -0
- package/lib/quickfilter/QuickfiltersDesignComponent.d.ts +46 -0
- package/lib/quickfilter/QuickfiltersDesignComponent.js +176 -0
- package/lib/quickfilter/README.md +8 -0
- package/lib/quickfilter/TextLiteralComponent.d.ts +216 -0
- package/lib/quickfilter/TextLiteralComponent.js +128 -0
- package/lib/richtext/ExprItemsHtmlConverter.d.ts +39 -0
- package/lib/richtext/ExprItemsHtmlConverter.js +118 -0
- package/lib/richtext/FontColorPaletteItem.d.ts +23 -0
- package/lib/richtext/FontColorPaletteItem.js +84 -0
- package/lib/richtext/FontSizePaletteItem.d.ts +29 -0
- package/lib/richtext/FontSizePaletteItem.js +70 -0
- package/lib/richtext/ItemsHtmlConverter.d.ts +31 -0
- package/lib/richtext/ItemsHtmlConverter.js +209 -0
- package/lib/richtext/README.md +3 -0
- package/lib/richtext/RichTextComponent.d.ts +84 -0
- package/lib/richtext/RichTextComponent.js +255 -0
- package/lib/valueFormatter.d.ts +16 -0
- package/lib/valueFormatter.js +93 -0
- package/lib/widgets/DirectWidgetDataSource.d.ts +43 -0
- package/lib/widgets/DirectWidgetDataSource.js +39 -0
- package/lib/widgets/DropdownWidgetComponent.d.ts +31 -0
- package/lib/widgets/DropdownWidgetComponent.js +41 -0
- package/lib/widgets/IFrameWidget.d.ts +16 -0
- package/lib/widgets/IFrameWidget.js +38 -0
- package/lib/widgets/IFrameWidgetComponent.d.ts +33 -0
- package/lib/widgets/IFrameWidgetComponent.js +101 -0
- package/lib/widgets/ImageUploaderComponent.d.ts +29 -0
- package/lib/widgets/ImageUploaderComponent.js +91 -0
- package/lib/widgets/ImageWidget.d.ts +49 -0
- package/lib/widgets/ImageWidget.js +112 -0
- package/lib/widgets/ImageWidgetComponent.d.ts +125 -0
- package/lib/widgets/ImageWidgetComponent.js +368 -0
- package/lib/widgets/ImagelistCarouselComponent.d.ts +29 -0
- package/lib/widgets/ImagelistCarouselComponent.js +64 -0
- package/lib/widgets/MapWidget.d.ts +55 -0
- package/lib/widgets/MapWidget.js +167 -0
- package/lib/widgets/MarkdownWidget.d.ts +53 -0
- package/lib/widgets/MarkdownWidget.js +134 -0
- package/lib/widgets/TOCWidget.d.ts +39 -0
- package/lib/widgets/TOCWidget.js +254 -0
- package/lib/widgets/Widget.d.ts +61 -0
- package/lib/widgets/Widget.js +33 -0
- package/lib/widgets/WidgetDataSource.d.ts +20 -0
- package/lib/widgets/WidgetDataSource.js +2 -0
- package/lib/widgets/WidgetFactory.d.ts +4 -0
- package/lib/widgets/WidgetFactory.js +40 -0
- package/lib/widgets/WidgetScoper.d.ts +9 -0
- package/lib/widgets/WidgetScoper.js +49 -0
- package/lib/widgets/WidgetScopesViewComponent.d.ts +26 -0
- package/lib/widgets/WidgetScopesViewComponent.js +36 -0
- package/lib/widgets/charts/Chart.d.ts +57 -0
- package/lib/widgets/charts/Chart.js +83 -0
- package/lib/widgets/charts/ChartViewComponent.d.ts +72 -0
- package/lib/widgets/charts/ChartViewComponent.js +120 -0
- package/lib/widgets/charts/ChartWidget.d.ts +87 -0
- package/lib/widgets/charts/ChartWidget.js +248 -0
- package/lib/widgets/charts/calendar/CalendarChart.d.ts +39 -0
- package/lib/widgets/charts/calendar/CalendarChart.js +175 -0
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.d.ts +35 -0
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +142 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.d.ts +56 -0
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +263 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +21 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +183 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.d.ts +28 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +105 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +31 -0
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +87 -0
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.d.ts +20 -0
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +38 -0
- package/lib/widgets/charts/layered/LayeredChart.d.ts +28 -0
- package/lib/widgets/charts/layered/LayeredChart.js +324 -0
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +113 -0
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +1092 -0
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +76 -0
- package/lib/widgets/charts/layered/LayeredChartDesign.js +2 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +80 -0
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +317 -0
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +72 -0
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +329 -0
- package/lib/widgets/charts/layered/LayeredChartSvgFileSaver.d.ts +5 -0
- package/lib/widgets/charts/layered/LayeredChartSvgFileSaver.js +138 -0
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +1 -0
- package/lib/widgets/charts/layered/LayeredChartUtils.js +25 -0
- package/lib/widgets/charts/layered/LayeredChartViewComponent.d.ts +44 -0
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +406 -0
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.d.ts +115 -0
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +235 -0
- package/lib/widgets/charts/pivot/PivotChart.d.ts +36 -0
- package/lib/widgets/charts/pivot/PivotChart.js +343 -0
- package/lib/widgets/charts/pivot/PivotChartDesign.d.ts +88 -0
- package/lib/widgets/charts/pivot/PivotChartDesign.js +2 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +37 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +159 -0
- package/lib/widgets/charts/pivot/PivotChartLayout.d.ts +73 -0
- package/lib/widgets/charts/pivot/PivotChartLayout.js +2 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +37 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +676 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +74 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +333 -0
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +31 -0
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +263 -0
- package/lib/widgets/charts/pivot/PivotChartUtils.d.ts +12 -0
- package/lib/widgets/charts/pivot/PivotChartUtils.js +195 -0
- package/lib/widgets/charts/pivot/PivotChartViewComponent.d.ts +84 -0
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +205 -0
- package/lib/widgets/charts/pivot/README.md +30 -0
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +96 -0
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +216 -0
- package/lib/widgets/charts/table/OrderingsComponent.d.ts +15 -0
- package/lib/widgets/charts/table/OrderingsComponent.js +66 -0
- package/lib/widgets/charts/table/TableChart.d.ts +57 -0
- package/lib/widgets/charts/table/TableChart.js +310 -0
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +48 -0
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +291 -0
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +28 -0
- package/lib/widgets/charts/table/TableChartViewComponent.js +206 -0
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +35 -0
- package/lib/widgets/text/ExprInsertModalComponent.js +51 -0
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +34 -0
- package/lib/widgets/text/ExprItemEditorComponent.js +92 -0
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +33 -0
- package/lib/widgets/text/ExprUpdateModalComponent.js +47 -0
- package/lib/widgets/text/README.md +2 -0
- package/lib/widgets/text/TextComponent.d.ts +48 -0
- package/lib/widgets/text/TextComponent.js +109 -0
- package/lib/widgets/text/TextWidget.d.ts +29 -0
- package/lib/widgets/text/TextWidget.js +243 -0
- package/lib/widgets/text/TextWidgetComponent.d.ts +33 -0
- package/lib/widgets/text/TextWidgetComponent.js +88 -0
- package/lib/widgets/text/TextWidgetDesign.d.ts +6 -0
- package/lib/widgets/text/TextWidgetDesign.js +2 -0
- package/mocha.html +10 -0
- package/package.json +113 -0
- package/server.js +10 -0
- package/src/CheckboxComponent.ts +33 -0
- package/src/ColorComponent.ts +117 -0
- package/src/ColorSchemeFactory.ts +144 -0
- package/src/CsvBuilder.ts +65 -0
- package/src/DateRangeComponent.ts +279 -0
- package/src/FiltersDesignerComponent.ts +55 -0
- package/src/ImplicitFilterBuilder.ts +135 -0
- package/src/JsonQLFilter.ts +8 -0
- package/src/LocaleContextInjector.tsx +17 -0
- package/src/MWaterAddRelatedFormComponent.ts +213 -0
- package/src/MWaterAddRelatedIndicatorComponent.ts +205 -0
- package/src/MWaterAssetSystemsListComponent.tsx +114 -0
- package/src/MWaterCompleteTableSelectComponent.tsx +984 -0
- package/src/MWaterContextComponent.ts +144 -0
- package/src/MWaterCustomTablesetListComponent.tsx +141 -0
- package/src/MWaterGlobalFiltersComponent.ts +117 -0
- package/src/MWaterLoaderComponent.ts +118 -0
- package/src/MWaterMetricsTableListComponent.tsx +120 -0
- package/src/MWaterResponsesFilterComponent.ts +194 -0
- package/src/MWaterTableSelectComponent.ts +316 -0
- package/src/MenuItemComponent.ts +2 -0
- package/src/PopoverComponent.ts +59 -0
- package/src/RadioButtonComponent.ts +34 -0
- package/src/TableSelectComponent.ts +60 -0
- package/src/UIComponents.ts +289 -0
- package/src/UndoStack.ts +59 -0
- package/src/VerticalLayoutComponent.ts +108 -0
- package/src/WidgetScope.ts +17 -0
- package/src/axes/Axis.ts +89 -0
- package/src/axes/AxisBuilder.ts +1325 -0
- package/src/axes/AxisColorEditorComponent.ts +210 -0
- package/src/axes/AxisComponent.ts +449 -0
- package/src/axes/BinsComponent.tsx +169 -0
- package/src/axes/CategoryMapComponent.ts +278 -0
- package/src/axes/ColorPaletteCollectionComponent.ts +163 -0
- package/src/axes/RangesComponent.ts +234 -0
- package/src/color-mixer.d.ts +1 -0
- package/src/componenttest.ts +64 -0
- package/src/compressJson.ts +13 -0
- package/src/dashboards/DashboardComponent.ts +468 -0
- package/src/dashboards/DashboardDataSource.ts +15 -0
- package/src/dashboards/DashboardDesign.ts +57 -0
- package/src/dashboards/DashboardUpgrader.ts +103 -0
- package/src/dashboards/DashboardUtils.ts +82 -0
- package/src/dashboards/DashboardViewComponent.ts +304 -0
- package/src/dashboards/DirectDashboardDataSource.ts +69 -0
- package/src/dashboards/LayoutOptionsComponent.tsx +227 -0
- package/src/dashboards/README.md +13 -0
- package/src/dashboards/ServerDashboardDataSource.ts +520 -0
- package/src/dashboards/SettingsModalComponent.ts +169 -0
- package/src/dashboards/WidgetComponent.tsx +131 -0
- package/src/dashboards/layoutOptions.ts +40 -0
- package/src/datagrids/DatagridComponent.ts +430 -0
- package/src/datagrids/DatagridDataSource.ts +21 -0
- package/src/datagrids/DatagridDesign.ts +94 -0
- package/src/datagrids/DatagridDesignerComponent.tsx +585 -0
- package/src/datagrids/DatagridQueryBuilder.ts +722 -0
- package/src/datagrids/DatagridUtils.ts +74 -0
- package/src/datagrids/DatagridViewComponent.ts +460 -0
- package/src/datagrids/DirectDatagridDataSource.ts +57 -0
- package/src/datagrids/EditExprCellComponent.tsx +305 -0
- package/src/datagrids/ExprCellComponent.ts +104 -0
- package/src/datagrids/FindReplaceModalComponent.ts +354 -0
- package/src/datagrids/LabeledExprGenerator.ts +302 -0
- package/src/datagrids/OrderBysDesignerComponent.tsx +128 -0
- package/src/datagrids/README.md +3 -0
- package/src/datagrids/ServerDatagridDataSource.ts +119 -0
- package/src/datagrids/react-linkify.d.ts +1 -0
- package/src/demo.ts +4148 -0
- package/src/demoBlocks.ts +130 -0
- package/src/globals.d.ts +2 -0
- package/src/index.css +550 -0
- package/src/index.ts +112 -0
- package/src/injectTableAlias.ts +31 -0
- package/src/languages.ts +931 -0
- package/src/layout-styles.css +263 -0
- package/src/layouts/DecoratedBlockComponent.ts +167 -0
- package/src/layouts/DragSourceComponent.ts +35 -0
- package/src/layouts/LayoutManager.ts +86 -0
- package/src/layouts/blocks/BlocksDisplayComponent.ts +461 -0
- package/src/layouts/blocks/BlocksLayoutManager.ts +78 -0
- package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +89 -0
- package/src/layouts/blocks/DraggableBlockComponent.ts +219 -0
- package/src/layouts/blocks/HorizontalBlockComponent.ts +288 -0
- package/src/layouts/blocks/PaletteItemComponent.ts +27 -0
- package/src/layouts/blocks/README.md +11 -0
- package/src/layouts/blocks/blockUtils.ts +207 -0
- package/src/layouts/decorated-block.css +100 -0
- package/src/layouts/grid/GridLayoutComponent.ts +67 -0
- package/src/layouts/grid/GridLayoutManager.ts +185 -0
- package/src/layouts/grid/LegoLayoutEngine.ts +142 -0
- package/src/layouts/grid/PaletteItemComponent.ts +28 -0
- package/src/layouts/grid/README.md +14 -0
- package/src/layouts/grid/WidgetContainerComponent.ts +420 -0
- package/src/mWaterLoader.ts +82 -0
- package/src/mapdemo.ts +127 -0
- package/src/maps/AddLayerComponent.ts +125 -0
- package/src/maps/AdminScopeAndDetailLevelComponent.ts +90 -0
- package/src/maps/BaseLayerDesignerComponent.ts +104 -0
- package/src/maps/BingLayer.ts +156 -0
- package/src/maps/BufferLayer.ts +927 -0
- package/src/maps/BufferLayerDesign.ts +48 -0
- package/src/maps/BufferLayerDesignerComponent.ts +311 -0
- package/src/maps/ChoroplethLayer.ts +1712 -0
- package/src/maps/ChoroplethLayerDesign.ts +73 -0
- package/src/maps/ChoroplethLayerDesigner.tsx +558 -0
- package/src/maps/ClusterLayer.ts +836 -0
- package/src/maps/ClusterLayerDesign.ts +29 -0
- package/src/maps/ClusterLayerDesignerComponent.ts +190 -0
- package/src/maps/DetailLevelSelectComponent.ts +119 -0
- package/src/maps/DirectMapDataSource.ts +386 -0
- package/src/maps/EditHoverOver.tsx +151 -0
- package/src/maps/EditPopupComponent.ts +121 -0
- package/src/maps/Grid Functions.sql +167 -0
- package/src/maps/GridLayer.ts +776 -0
- package/src/maps/GridLayerDesign.ts +53 -0
- package/src/maps/GridLayerDesigner.tsx +332 -0
- package/src/maps/HoverContent.tsx +96 -0
- package/src/maps/HtmlUrlLegend.tsx +44 -0
- package/src/maps/Layer.ts +338 -0
- package/src/maps/LayerFactory.ts +51 -0
- package/src/maps/LayerLegendComponent.ts +88 -0
- package/src/maps/LayerSwitcherComponent.tsx +91 -0
- package/src/maps/LeafletLoading.css +24 -0
- package/src/maps/LeafletLoading.ts +355 -0
- package/src/maps/LeafletMapComponent.tsx +587 -0
- package/src/maps/LegendComponent.tsx +101 -0
- package/src/maps/LegendGroup.ts +120 -0
- package/src/maps/MWaterServerLayer.ts +116 -0
- package/src/maps/MapBoundsCalculator.ts +88 -0
- package/src/maps/MapComponent.ts +312 -0
- package/src/maps/MapControlComponent.ts +46 -0
- package/src/maps/MapDataSource.ts +20 -0
- package/src/maps/MapDesign.ts +103 -0
- package/src/maps/MapDesignerComponent.ts +356 -0
- package/src/maps/MapFiltersDesignerComponent.ts +95 -0
- package/src/maps/MapLayerDataSource.ts +27 -0
- package/src/maps/MapLayerViewDesignerComponent.ts +243 -0
- package/src/maps/MapLayersDesignerComponent.ts +144 -0
- package/src/maps/MapUtils.ts +148 -0
- package/src/maps/MapViewComponent.tsx +62 -0
- package/src/maps/Maptiler-logo.png +0 -0
- package/src/maps/MarkerSymbolSelectComponent.ts +41 -0
- package/src/maps/MarkersLayer.ts +941 -0
- package/src/maps/MarkersLayerDesign.ts +56 -0
- package/src/maps/MarkersLayerDesignerComponent.ts +374 -0
- package/src/maps/PopupFilterJoinsEditComponent.ts +114 -0
- package/src/maps/PopupFilterJoinsUtils.ts +99 -0
- package/src/maps/RasterMapViewComponent.ts +382 -0
- package/src/maps/RegionSelectComponent.ts +80 -0
- package/src/maps/ScopeAndDetailLevelComponent.ts +82 -0
- package/src/maps/ServerMapDataSource.ts +399 -0
- package/src/maps/SwitchableTileUrlLayer.tsx +130 -0
- package/src/maps/SwitchableTileUrlLayerDesigner.tsx +60 -0
- package/src/maps/TileUrlLayer.tsx +142 -0
- package/src/maps/UtfGridLayer.ts +286 -0
- package/src/maps/VectorMapViewComponent.css +21 -0
- package/src/maps/VectorMapViewComponent.tsx +743 -0
- package/src/maps/ZoomLevelsComponent.ts +72 -0
- package/src/maps/mapSymbols.ts +162 -0
- package/src/maps/mapboxUtils.ts +61 -0
- package/src/maps/maps.ts +38 -0
- package/src/maps/marker-icon-2x.png +0 -0
- package/src/maps/marker-icon.png +0 -0
- package/src/maps/marker-shadow.png +0 -0
- package/src/maps/png.d.ts +1 -0
- package/src/maps/symbols/font-awesome/asterisk.png +0 -0
- package/src/maps/symbols/font-awesome/ban.png +0 -0
- package/src/maps/symbols/font-awesome/beer.png +0 -0
- package/src/maps/symbols/font-awesome/bell.png +0 -0
- package/src/maps/symbols/font-awesome/bolt.png +0 -0
- package/src/maps/symbols/font-awesome/building.png +0 -0
- package/src/maps/symbols/font-awesome/bullseye.png +0 -0
- package/src/maps/symbols/font-awesome/bus.png +0 -0
- package/src/maps/symbols/font-awesome/caret-up.png +0 -0
- package/src/maps/symbols/font-awesome/certificate.png +0 -0
- package/src/maps/symbols/font-awesome/check-circle.png +0 -0
- package/src/maps/symbols/font-awesome/check.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
- package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
- package/src/maps/symbols/font-awesome/cloud.png +0 -0
- package/src/maps/symbols/font-awesome/comment.png +0 -0
- package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
- package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
- package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
- package/src/maps/symbols/font-awesome/female.png +0 -0
- package/src/maps/symbols/font-awesome/file.png +0 -0
- package/src/maps/symbols/font-awesome/flag.png +0 -0
- package/src/maps/symbols/font-awesome/flask.png +0 -0
- package/src/maps/symbols/font-awesome/h-square.png +0 -0
- package/src/maps/symbols/font-awesome/home.png +0 -0
- package/src/maps/symbols/font-awesome/info-circle.png +0 -0
- package/src/maps/symbols/font-awesome/male.png +0 -0
- package/src/maps/symbols/font-awesome/medkit.png +0 -0
- package/src/maps/symbols/font-awesome/mobile.png +0 -0
- package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
- package/src/maps/symbols/font-awesome/plus-square.png +0 -0
- package/src/maps/symbols/font-awesome/plus.png +0 -0
- package/src/maps/symbols/font-awesome/square.png +0 -0
- package/src/maps/symbols/font-awesome/star.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
- package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
- package/src/maps/symbols/font-awesome/ticket.png +0 -0
- package/src/maps/symbols/font-awesome/times-circle.png +0 -0
- package/src/maps/symbols/font-awesome/times.png +0 -0
- package/src/maps/symbols/font-awesome/tint.png +0 -0
- package/src/maps/symbols/font-awesome/tree.png +0 -0
- package/src/maps/symbols/font-awesome/university.png +0 -0
- package/src/maps/symbols/font-awesome/usd.png +0 -0
- package/src/maps/symbols/font-awesome/user.png +0 -0
- package/src/maps/symbols/font-awesome/users.png +0 -0
- package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
- package/src/maps/vectorMaps.tsx +410 -0
- package/src/memoizedDebounce.tsx +32 -0
- package/src/quickfilter/DateExprComponent.ts +284 -0
- package/src/quickfilter/IdArrayQuickfilterComponent.ts +58 -0
- package/src/quickfilter/Quickfilter.ts +29 -0
- package/src/quickfilter/QuickfilterCompiler.ts +167 -0
- package/src/quickfilter/QuickfilterUtils.ts +123 -0
- package/src/quickfilter/QuickfiltersComponent.ts +416 -0
- package/src/quickfilter/QuickfiltersDataSource.ts +15 -0
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +257 -0
- package/src/quickfilter/README.md +8 -0
- package/src/quickfilter/TextLiteralComponent.ts +161 -0
- package/src/quickfilter/react-onclickout.d.ts +1 -0
- package/src/richtext/ExprItemsHtmlConverter.ts +144 -0
- package/src/richtext/FontColorPaletteItem.ts +172 -0
- package/src/richtext/FontSizePaletteItem.ts +110 -0
- package/src/richtext/ItemsHtmlConverter.ts +246 -0
- package/src/richtext/README.md +3 -0
- package/src/richtext/RichTextComponent.tsx +390 -0
- package/src/richtext/react-float-affixed.d.ts +1 -0
- package/src/update-object.d.ts +1 -0
- package/src/valueFormatter.ts +110 -0
- package/src/widgets/DirectWidgetDataSource.ts +67 -0
- package/src/widgets/DropdownWidgetComponent.ts +78 -0
- package/src/widgets/IFrameWidget.ts +36 -0
- package/src/widgets/IFrameWidgetComponent.ts +116 -0
- package/src/widgets/ImageUploaderComponent.tsx +143 -0
- package/src/widgets/ImageWidget.ts +147 -0
- package/src/widgets/ImageWidgetComponent.ts +546 -0
- package/src/widgets/ImagelistCarouselComponent.ts +109 -0
- package/src/widgets/MapWidget.ts +219 -0
- package/src/widgets/MarkdownWidget.ts +201 -0
- package/src/widgets/TOCWidget.ts +326 -0
- package/src/widgets/Widget.ts +83 -0
- package/src/widgets/WidgetDataSource.ts +23 -0
- package/src/widgets/WidgetFactory.ts +37 -0
- package/src/widgets/WidgetScoper.ts +51 -0
- package/src/widgets/WidgetScopesViewComponent.ts +54 -0
- package/src/widgets/charts/Chart.ts +140 -0
- package/src/widgets/charts/ChartViewComponent.ts +209 -0
- package/src/widgets/charts/ChartWidget.ts +345 -0
- package/src/widgets/charts/calendar/CalendarChart.ts +227 -0
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +187 -0
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +320 -0
- package/src/widgets/charts/calendar/d3-tip.d.ts +1 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +213 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +121 -0
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +117 -0
- package/src/widgets/charts/imagemosaic/ImagePopupComponent.ts +51 -0
- package/src/widgets/charts/imagemosaic/react-lazy-load-image-component.d.ts +1 -0
- package/src/widgets/charts/layered/LayeredChart.ts +361 -0
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +1299 -0
- package/src/widgets/charts/layered/LayeredChartDesign.ts +106 -0
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +523 -0
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +448 -0
- package/src/widgets/charts/layered/LayeredChartSvgFileSaver.ts +146 -0
- package/src/widgets/charts/layered/LayeredChartUtils.ts +24 -0
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +486 -0
- package/src/widgets/charts/layered/save-svg-as-png.d.ts +1 -0
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +338 -0
- package/src/widgets/charts/pivot/PivotChart.ts +377 -0
- package/src/widgets/charts/pivot/PivotChartDesign.ts +115 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +240 -0
- package/src/widgets/charts/pivot/PivotChartLayout.ts +99 -0
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +779 -0
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +504 -0
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +273 -0
- package/src/widgets/charts/pivot/PivotChartUtils.ts +219 -0
- package/src/widgets/charts/pivot/PivotChartViewComponent.ts +276 -0
- package/src/widgets/charts/pivot/README.md +30 -0
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +353 -0
- package/src/widgets/charts/table/OrderingsComponent.tsx +119 -0
- package/src/widgets/charts/table/TableChart.ts +420 -0
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +441 -0
- package/src/widgets/charts/table/TableChartViewComponent.ts +327 -0
- package/src/widgets/text/ExprInsertModalComponent.ts +77 -0
- package/src/widgets/text/ExprItemEditorComponent.tsx +164 -0
- package/src/widgets/text/ExprUpdateModalComponent.ts +70 -0
- package/src/widgets/text/README.md +2 -0
- package/src/widgets/text/TextComponent.tsx +151 -0
- package/src/widgets/text/TextWidget.ts +265 -0
- package/src/widgets/text/TextWidgetComponent.ts +120 -0
- package/src/widgets/text/TextWidgetDesign.ts +7 -0
- package/stories/UpdateableComponent.js +29 -0
- package/stories/consoles.js +202 -0
- package/stories/dashboards.js +217 -0
- package/stories/datagridDesign.js +114 -0
- package/stories/datagrids.js +69 -0
- package/stories/dates.js +80 -0
- package/stories/exprcomponent.js +43 -0
- package/stories/index.js +18 -0
- package/stories/leaflet.js +59 -0
- package/stories/maps.js +24 -0
- package/stories/pivotChart.js +235 -0
- package/test/AxisBuilderTests.ts +931 -0
- package/test/ChartWidgetTests.ts +85 -0
- package/test/ColorSchemeFactoryTests.ts +29 -0
- package/test/CsvBuilderTests.ts +22 -0
- package/test/DashboardUpgraderTests.ts +170 -0
- package/test/ImplicitFilterBuilderTests.ts +161 -0
- package/test/LayeredChartCompilerTests.ts +1067 -0
- package/test/LayeredChartTests.ts +88 -0
- package/test/LegoLayoutEngineTests.ts +69 -0
- package/test/MWaterGlobalFiltersComponentTests.ts +130 -0
- package/test/MWaterResponsesFilterComponentTests.ts +164 -0
- package/test/QuickfilterCompilerTests.ts +167 -0
- package/test/TestComponent.ts +49 -0
- package/test/UndoStackTests.ts +73 -0
- package/test/WidgetScoperTests.ts +35 -0
- package/test/blockUtilsTests.ts +290 -0
- package/test/canonical-json.d.ts +1 -0
- package/test/dashboards/DashboardUtilsTests.ts +131 -0
- package/test/datagrids/DatagridQueryBuilderTests.ts +445 -0
- package/test/datagrids/DatagridUtilsTests.ts +54 -0
- package/test/datagrids/LabeledExprGeneratorTests.ts +121 -0
- package/test/fixtures.ts +263 -0
- package/test/index.ts +2 -0
- package/test/maps/MapUtilsTests.ts +168 -0
- package/test/maps/PopupFilterJoinsUtilsTests.ts +105 -0
- package/test/richtext/ItemsHtmlConverterTests.ts +41 -0
- package/test/test_index.ts +4 -0
- package/test/widgets/TextWidgetTests.ts +42 -0
- package/test/widgets/charts/pivot/PivotChartLayoutBuilderTests.ts +817 -0
- package/test/widgets/charts/pivot/PivotChartQueryBuilderTests.ts +359 -0
- package/test/widgets/charts/pivot/PivotChartTests.ts +64 -0
- package/test/widgets/charts/pivot/PivotChartUtilsTests.ts +184 -0
- package/test/widgets/charts/table/TableChartTests.ts +253 -0
- package/tsconfig.build.json +26 -0
- package/types/utm.d.ts +10 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/// <reference types="jquery" />
|
|
2
|
+
import { DataSource, Expr } from "@mwater/expressions";
|
|
3
|
+
import { JsonQLFilter } from "../JsonQLFilter";
|
|
4
|
+
import { QuickfiltersDataSource } from "../quickfilter/QuickfiltersDataSource";
|
|
5
|
+
import { MapDesign, MapLayerView } from "../maps/MapDesign";
|
|
6
|
+
import { MapDataSource } from "../maps/MapDataSource";
|
|
7
|
+
import { MapLayerDataSource } from "../maps/MapLayerDataSource";
|
|
8
|
+
import { WidgetDataSource } from "../widgets/WidgetDataSource";
|
|
9
|
+
interface ServerDashboardDataSourceOptions {
|
|
10
|
+
/** API url to use for talking to mWater server */
|
|
11
|
+
apiUrl: string;
|
|
12
|
+
/** client id to use for talking to mWater server */
|
|
13
|
+
client?: string;
|
|
14
|
+
/** share id to use for talking to mWater server */
|
|
15
|
+
share?: string;
|
|
16
|
+
/** dashboard id to use on server */
|
|
17
|
+
dashboardId: string;
|
|
18
|
+
/** data source that is used for determining cache expiry */
|
|
19
|
+
dataSource: DataSource;
|
|
20
|
+
/** revision to use to allow caching */
|
|
21
|
+
rev: string;
|
|
22
|
+
}
|
|
23
|
+
interface ServerWidgetDataSourceOptions extends ServerDashboardDataSourceOptions {
|
|
24
|
+
widgetId: string;
|
|
25
|
+
}
|
|
26
|
+
interface ServerWidgetMapDataSourceOptions extends ServerDashboardDataSourceOptions {
|
|
27
|
+
widgetId: string;
|
|
28
|
+
design: MapDesign;
|
|
29
|
+
}
|
|
30
|
+
/** Uses mWater server to get widget data to allow sharing with unprivileged users */
|
|
31
|
+
export default class ServerDashboardDataSource {
|
|
32
|
+
options: ServerDashboardDataSourceOptions;
|
|
33
|
+
constructor(options: ServerDashboardDataSourceOptions);
|
|
34
|
+
getWidgetDataSource(widgetType: string, widgetId: string): ServerWidgetDataSource;
|
|
35
|
+
getQuickfiltersDataSource(): ServerQuickfilterDataSource;
|
|
36
|
+
}
|
|
37
|
+
declare class ServerQuickfilterDataSource implements QuickfiltersDataSource {
|
|
38
|
+
options: ServerDashboardDataSourceOptions;
|
|
39
|
+
constructor(options: ServerDashboardDataSourceOptions);
|
|
40
|
+
getValues(index: number, expr: Expr, filters: JsonQLFilter[], offset: number, limit: number, callback: (error: any, values?: any[]) => void): void;
|
|
41
|
+
}
|
|
42
|
+
declare class ServerWidgetDataSource {
|
|
43
|
+
options: ServerWidgetDataSourceOptions;
|
|
44
|
+
constructor(options: ServerWidgetDataSourceOptions);
|
|
45
|
+
getData(design: any, filters: JsonQLFilter[], callback: (error: any, data?: any) => void): JQuery.jqXHR<any>;
|
|
46
|
+
getMapDataSource(design: any): ServerWidgetMapDataSource;
|
|
47
|
+
getImageUrl(imageId: string, height?: number): string;
|
|
48
|
+
}
|
|
49
|
+
declare class ServerWidgetMapDataSource implements MapDataSource {
|
|
50
|
+
options: ServerWidgetMapDataSourceOptions;
|
|
51
|
+
constructor(options: ServerWidgetMapDataSourceOptions);
|
|
52
|
+
getLayerDataSource(layerId: string): ServerWidgetLayerDataSource;
|
|
53
|
+
getBounds(design: MapDesign, filters: JsonQLFilter[], callback: (error: any, bounds?: {
|
|
54
|
+
w: number;
|
|
55
|
+
n: number;
|
|
56
|
+
e: number;
|
|
57
|
+
s: number;
|
|
58
|
+
} | null) => void): void;
|
|
59
|
+
}
|
|
60
|
+
interface ServerWidgetLayerDataSourceOptions extends ServerDashboardDataSourceOptions {
|
|
61
|
+
widgetId: string;
|
|
62
|
+
/** Layer view to use */
|
|
63
|
+
layerView: MapLayerView;
|
|
64
|
+
}
|
|
65
|
+
declare class ServerWidgetLayerDataSource implements MapLayerDataSource {
|
|
66
|
+
options: ServerWidgetLayerDataSourceOptions;
|
|
67
|
+
constructor(options: ServerWidgetLayerDataSourceOptions);
|
|
68
|
+
getTileUrl(design: any, filters: JsonQLFilter[]): any;
|
|
69
|
+
getUtfGridUrl(design: any, filters: JsonQLFilter[]): string | null;
|
|
70
|
+
/** Get the url for vector tile source with an expiry time. Only for layers of type "VectorTile"
|
|
71
|
+
* @param createdAfter ISO 8601 timestamp requiring that tile source on server is created after specified datetime
|
|
72
|
+
*/
|
|
73
|
+
getVectorTileUrl(layerDesign: any, filters: JsonQLFilter[], createdAfter: string): Promise<{
|
|
74
|
+
url: string;
|
|
75
|
+
expires: string;
|
|
76
|
+
}>;
|
|
77
|
+
getPopupWidgetDataSource(design: any, widgetId: string): ServerWidgetLayerPopupWidgetDataSource;
|
|
78
|
+
createUrl(filters: JsonQLFilter[], extension: string): string;
|
|
79
|
+
createLegacyUrl(design: any, extension: string, filters: JsonQLFilter[]): string;
|
|
80
|
+
}
|
|
81
|
+
interface ServerWidgetLayerPopupDataSourceOptions extends ServerDashboardDataSourceOptions {
|
|
82
|
+
widgetId: string;
|
|
83
|
+
/** layer view of map inside widget */
|
|
84
|
+
layerView: MapLayerView;
|
|
85
|
+
/** id of popup widget */
|
|
86
|
+
popupWidgetId: string;
|
|
87
|
+
}
|
|
88
|
+
declare class ServerWidgetLayerPopupWidgetDataSource implements WidgetDataSource {
|
|
89
|
+
options: ServerWidgetLayerPopupDataSourceOptions;
|
|
90
|
+
constructor(options: ServerWidgetLayerPopupDataSourceOptions);
|
|
91
|
+
getData(design: any, filters: JsonQLFilter[], callback: (error: any, data?: any) => void): void;
|
|
92
|
+
/** For map widgets, the following is required */
|
|
93
|
+
getMapDataSource(design: MapDesign): MapDataSource;
|
|
94
|
+
getImageUrl(imageId: string, height?: number): string;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
+
const jquery_1 = __importDefault(require("jquery"));
|
|
8
|
+
const expressions_1 = require("@mwater/expressions");
|
|
9
|
+
const querystring_1 = __importDefault(require("querystring"));
|
|
10
|
+
const LayerFactory_1 = __importDefault(require("../maps/LayerFactory"));
|
|
11
|
+
const compressJson_1 = __importDefault(require("../compressJson"));
|
|
12
|
+
/** Uses mWater server to get widget data to allow sharing with unprivileged users */
|
|
13
|
+
class ServerDashboardDataSource {
|
|
14
|
+
options;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.options = options;
|
|
17
|
+
}
|
|
18
|
+
// Gets the widget data source for a specific widget
|
|
19
|
+
getWidgetDataSource(widgetType, widgetId) {
|
|
20
|
+
return new ServerWidgetDataSource({ ...this.options, widgetId });
|
|
21
|
+
}
|
|
22
|
+
getQuickfiltersDataSource() {
|
|
23
|
+
return new ServerQuickfilterDataSource(this.options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = ServerDashboardDataSource;
|
|
27
|
+
class ServerQuickfilterDataSource {
|
|
28
|
+
options;
|
|
29
|
+
// options:
|
|
30
|
+
// apiUrl: API url to use for talking to mWater server
|
|
31
|
+
// client: client id to use for talking to mWater server
|
|
32
|
+
// share: share id to use for talking to mWater server
|
|
33
|
+
// dashboardId: dashboard id to use on server
|
|
34
|
+
// dataSource: data source that is used for determining cache expiry
|
|
35
|
+
// rev: revision to use to allow caching
|
|
36
|
+
constructor(options) {
|
|
37
|
+
this.options = options;
|
|
38
|
+
}
|
|
39
|
+
// Gets the values of the quickfilter at index
|
|
40
|
+
getValues(index, expr, filters, offset, limit, callback) {
|
|
41
|
+
const query = {
|
|
42
|
+
client: this.options.client,
|
|
43
|
+
share: this.options.share,
|
|
44
|
+
filters: (0, compressJson_1.default)(filters),
|
|
45
|
+
offset,
|
|
46
|
+
limit,
|
|
47
|
+
rev: this.options.rev
|
|
48
|
+
};
|
|
49
|
+
const url = this.options.apiUrl +
|
|
50
|
+
`dashboards/${this.options.dashboardId}/quickfilters/${index}/values?` +
|
|
51
|
+
querystring_1.default.stringify(query);
|
|
52
|
+
const headers = {};
|
|
53
|
+
const cacheExpiry = this.options.dataSource.getCacheExpiry();
|
|
54
|
+
if (cacheExpiry) {
|
|
55
|
+
const seconds = Math.floor((new Date().getTime() - cacheExpiry) / 1000);
|
|
56
|
+
headers["Cache-Control"] = `max-age=${seconds}`;
|
|
57
|
+
}
|
|
58
|
+
jquery_1.default.ajax({
|
|
59
|
+
dataType: "json",
|
|
60
|
+
method: "GET",
|
|
61
|
+
url,
|
|
62
|
+
headers
|
|
63
|
+
})
|
|
64
|
+
.done((data) => {
|
|
65
|
+
return callback(null, data);
|
|
66
|
+
})
|
|
67
|
+
.fail((xhr) => {
|
|
68
|
+
console.log(xhr.responseText);
|
|
69
|
+
return callback(new Error(xhr.responseText));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
class ServerWidgetDataSource {
|
|
74
|
+
options;
|
|
75
|
+
// options:
|
|
76
|
+
// apiUrl: API url to use for talking to mWater server
|
|
77
|
+
// client: client id to use for talking to mWater server
|
|
78
|
+
// share: share id to use for talking to mWater server
|
|
79
|
+
// dashboardId: dashboard id to use on server
|
|
80
|
+
// dataSource: data source that is used for determining cache expiry
|
|
81
|
+
// rev: revision to use to allow caching
|
|
82
|
+
// widgetId: widget id to use
|
|
83
|
+
constructor(options) {
|
|
84
|
+
this.options = options;
|
|
85
|
+
}
|
|
86
|
+
// Get the data that the widget needs. The widget should implement getData method (see above) to get the data from the server
|
|
87
|
+
// design: design of the widget. Ignored in the case of server-side rendering
|
|
88
|
+
// filters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. Use injectAlias to correct
|
|
89
|
+
getData(design, filters, callback) {
|
|
90
|
+
const query = {
|
|
91
|
+
client: this.options.client,
|
|
92
|
+
share: this.options.share,
|
|
93
|
+
filters: (0, compressJson_1.default)(filters),
|
|
94
|
+
rev: this.options.rev
|
|
95
|
+
};
|
|
96
|
+
const url = this.options.apiUrl +
|
|
97
|
+
`dashboards/${this.options.dashboardId}/widgets/${this.options.widgetId}/data?` +
|
|
98
|
+
querystring_1.default.stringify(query);
|
|
99
|
+
const headers = {};
|
|
100
|
+
const cacheExpiry = this.options.dataSource.getCacheExpiry();
|
|
101
|
+
if (cacheExpiry) {
|
|
102
|
+
const seconds = Math.floor((new Date().getTime() - cacheExpiry) / 1000);
|
|
103
|
+
headers["Cache-Control"] = `max-age=${seconds}`;
|
|
104
|
+
}
|
|
105
|
+
return jquery_1.default.ajax({
|
|
106
|
+
dataType: "json",
|
|
107
|
+
method: "GET",
|
|
108
|
+
url,
|
|
109
|
+
headers
|
|
110
|
+
})
|
|
111
|
+
.done((data) => {
|
|
112
|
+
return callback(null, data);
|
|
113
|
+
})
|
|
114
|
+
.fail((xhr) => {
|
|
115
|
+
console.log(xhr.responseText);
|
|
116
|
+
return callback(new Error(xhr.responseText));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// For map widgets, the following is required
|
|
120
|
+
getMapDataSource(design) {
|
|
121
|
+
return new ServerWidgetMapDataSource({ ...this.options, design });
|
|
122
|
+
}
|
|
123
|
+
// Get the url to download an image (by id from an image or imagelist column)
|
|
124
|
+
// Height, if specified, is minimum height needed. May return larger image
|
|
125
|
+
getImageUrl(imageId, height) {
|
|
126
|
+
let url = this.options.apiUrl + `images/${imageId}`;
|
|
127
|
+
if (height) {
|
|
128
|
+
url += `?h=${height}`;
|
|
129
|
+
}
|
|
130
|
+
return url;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
class ServerWidgetMapDataSource {
|
|
134
|
+
options;
|
|
135
|
+
// options:
|
|
136
|
+
// apiUrl: API url to use for talking to mWater server
|
|
137
|
+
// design: design of the map widget
|
|
138
|
+
// client: client id to use for talking to mWater server
|
|
139
|
+
// share: share id to use for talking to mWater server
|
|
140
|
+
// dashboardId: dashboard id to use on server
|
|
141
|
+
// dataSource: data source that is used for determining cache expiry
|
|
142
|
+
// rev: revision to use to allow caching
|
|
143
|
+
// widgetId: widget id to use
|
|
144
|
+
constructor(options) {
|
|
145
|
+
this.options = options;
|
|
146
|
+
}
|
|
147
|
+
// Gets the data source for a layer
|
|
148
|
+
getLayerDataSource(layerId) {
|
|
149
|
+
// Get layerView
|
|
150
|
+
const layerView = lodash_1.default.findWhere(this.options.design.layerViews, { id: layerId });
|
|
151
|
+
if (!layerView) {
|
|
152
|
+
throw new Error("No such layer");
|
|
153
|
+
}
|
|
154
|
+
return new ServerWidgetLayerDataSource({ ...this.options, layerView });
|
|
155
|
+
}
|
|
156
|
+
// Gets the bounds for the map. Null for no opinion. Callback as { n:, s:, w:, e: }
|
|
157
|
+
getBounds(design, filters, callback) {
|
|
158
|
+
const query = {
|
|
159
|
+
client: this.options.client,
|
|
160
|
+
share: this.options.share,
|
|
161
|
+
filters: (0, compressJson_1.default)(filters),
|
|
162
|
+
rev: this.options.rev
|
|
163
|
+
};
|
|
164
|
+
const url = this.options.apiUrl +
|
|
165
|
+
`dashboards/${this.options.dashboardId}/widgets/${this.options.widgetId}/bounds?` +
|
|
166
|
+
querystring_1.default.stringify(query);
|
|
167
|
+
const headers = {};
|
|
168
|
+
const cacheExpiry = this.options.dataSource.getCacheExpiry();
|
|
169
|
+
if (cacheExpiry) {
|
|
170
|
+
const seconds = Math.floor((new Date().getTime() - cacheExpiry) / 1000);
|
|
171
|
+
headers["Cache-Control"] = `max-age=${seconds}`;
|
|
172
|
+
}
|
|
173
|
+
jquery_1.default.ajax({
|
|
174
|
+
dataType: "json",
|
|
175
|
+
method: "GET",
|
|
176
|
+
url,
|
|
177
|
+
headers
|
|
178
|
+
})
|
|
179
|
+
.done((data) => {
|
|
180
|
+
return callback(null, data);
|
|
181
|
+
})
|
|
182
|
+
.fail((xhr) => {
|
|
183
|
+
console.log(xhr.responseText);
|
|
184
|
+
return callback(new Error(xhr.responseText));
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
class ServerWidgetLayerDataSource {
|
|
189
|
+
options;
|
|
190
|
+
// options:
|
|
191
|
+
// apiUrl: API url to use for talking to mWater server
|
|
192
|
+
// client: client id to use for talking to mWater server
|
|
193
|
+
// share: share id to use for talking to mWater server
|
|
194
|
+
// dashboardId: dashboard id to use on server
|
|
195
|
+
// dataSource: data source that is used for determining cache expiry
|
|
196
|
+
// rev: revision to use to allow caching
|
|
197
|
+
// widgetId: widget id to use
|
|
198
|
+
// layerView: layer view of map inside widget
|
|
199
|
+
constructor(options) {
|
|
200
|
+
this.options = options;
|
|
201
|
+
}
|
|
202
|
+
// Get the url for the image tiles with the specified filters applied
|
|
203
|
+
// Called with (design, filters) where design is the layer design and filters are filters to apply. Returns URL
|
|
204
|
+
getTileUrl(design, filters) {
|
|
205
|
+
// Handle special cases
|
|
206
|
+
if (this.options.layerView.type === "MWaterServer") {
|
|
207
|
+
return this.createLegacyUrl(this.options.layerView.design, "png", filters);
|
|
208
|
+
}
|
|
209
|
+
// Create layer
|
|
210
|
+
const layer = LayerFactory_1.default.createLayer(this.options.layerView.type);
|
|
211
|
+
// If layer has tiles url directly available
|
|
212
|
+
if (layer.getLayerDefinitionType() === "TileUrl") {
|
|
213
|
+
return layer.getTileUrl(this.options.layerView.design, filters);
|
|
214
|
+
}
|
|
215
|
+
return this.createUrl(filters, "png");
|
|
216
|
+
}
|
|
217
|
+
// Get the url for the interactivity tiles with the specified filters applied
|
|
218
|
+
// Called with (design, filters) where design is the layer design and filters are filters to apply. Returns URL
|
|
219
|
+
getUtfGridUrl(design, filters) {
|
|
220
|
+
// Handle special cases
|
|
221
|
+
if (this.options.layerView.type === "MWaterServer") {
|
|
222
|
+
return this.createLegacyUrl(this.options.layerView.design, "grid.json", filters);
|
|
223
|
+
}
|
|
224
|
+
// Create layer
|
|
225
|
+
const layer = LayerFactory_1.default.createLayer(this.options.layerView.type);
|
|
226
|
+
// If layer has tiles url directly available
|
|
227
|
+
if (layer.getLayerDefinitionType() === "TileUrl") {
|
|
228
|
+
return layer.getUtfGridUrl(this.options.layerView.design, filters);
|
|
229
|
+
}
|
|
230
|
+
return this.createUrl(filters, "grid.json");
|
|
231
|
+
}
|
|
232
|
+
/** Get the url for vector tile source with an expiry time. Only for layers of type "VectorTile"
|
|
233
|
+
* @param createdAfter ISO 8601 timestamp requiring that tile source on server is created after specified datetime
|
|
234
|
+
*/
|
|
235
|
+
async getVectorTileUrl(layerDesign, filters, createdAfter) {
|
|
236
|
+
const qs = querystring_1.default.stringify({
|
|
237
|
+
client: this.options.client,
|
|
238
|
+
share: this.options.share
|
|
239
|
+
});
|
|
240
|
+
const url = `${this.options.apiUrl}vector_tiles/create_token/dashboards/${this.options.dashboardId}/widgets/${this.options.widgetId}/layers/${this.options.layerView.id}?${qs}`;
|
|
241
|
+
const request = {
|
|
242
|
+
createdAfter: createdAfter,
|
|
243
|
+
// 12 hours
|
|
244
|
+
expiresAfter: new Date(Date.now() + 1000 * 3600 * 12).toISOString(),
|
|
245
|
+
filters: (0, compressJson_1.default)(filters || [])
|
|
246
|
+
};
|
|
247
|
+
const response = await fetch(url, {
|
|
248
|
+
method: "POST",
|
|
249
|
+
body: JSON.stringify(request),
|
|
250
|
+
headers: {
|
|
251
|
+
Accept: "application/json",
|
|
252
|
+
"Content-Type": "application/json"
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
if (!response.ok) {
|
|
256
|
+
throw new Error("Error getting tiles token");
|
|
257
|
+
}
|
|
258
|
+
const { token, expires } = await response.json();
|
|
259
|
+
return { url: this.options.apiUrl + `vector_tiles/tiles/{z}/{x}/{y}?token=${token}`, expires };
|
|
260
|
+
}
|
|
261
|
+
// Gets widget data source for a popup widget
|
|
262
|
+
getPopupWidgetDataSource(design, widgetId) {
|
|
263
|
+
return new ServerWidgetLayerPopupWidgetDataSource({ ...this.options, popupWidgetId: widgetId });
|
|
264
|
+
}
|
|
265
|
+
// Create url
|
|
266
|
+
createUrl(filters, extension) {
|
|
267
|
+
const query = {
|
|
268
|
+
type: "dashboard_widget",
|
|
269
|
+
client: this.options.client,
|
|
270
|
+
share: this.options.share,
|
|
271
|
+
dashboard: this.options.dashboardId,
|
|
272
|
+
widget: this.options.widgetId,
|
|
273
|
+
layer: this.options.layerView.id,
|
|
274
|
+
rev: this.options.rev,
|
|
275
|
+
filters: (0, compressJson_1.default)(filters || [])
|
|
276
|
+
};
|
|
277
|
+
// Make URL change when cache expired
|
|
278
|
+
const cacheExpiry = this.options.dataSource.getCacheExpiry();
|
|
279
|
+
if (cacheExpiry) {
|
|
280
|
+
query.cacheExpiry = cacheExpiry;
|
|
281
|
+
}
|
|
282
|
+
let url = `${this.options.apiUrl}maps/tiles/{z}/{x}/{y}.${extension}?` + querystring_1.default.stringify(query);
|
|
283
|
+
// Add subdomains: {s} will be substituted with "a", "b" or "c" in leaflet for api.mwater.co only.
|
|
284
|
+
// Used to speed queries
|
|
285
|
+
if (url.match(/^https:\/\/api\.mwater\.co\//)) {
|
|
286
|
+
url = url.replace(/^https:\/\/api\.mwater\.co\//, "https://{s}-api.mwater.co/");
|
|
287
|
+
}
|
|
288
|
+
return url;
|
|
289
|
+
}
|
|
290
|
+
// Create query string
|
|
291
|
+
createLegacyUrl(design, extension, filters) {
|
|
292
|
+
let where;
|
|
293
|
+
let url = `${this.options.apiUrl}maps/tiles/{z}/{x}/{y}.${extension}?type=${design.type}&radius=1000`;
|
|
294
|
+
// Add subdomains: {s} will be substituted with "a", "b" or "c" in leaflet for api.mwater.co only.
|
|
295
|
+
// Used to speed queries
|
|
296
|
+
if (url.match(/^https:\/\/api\.mwater\.co\//)) {
|
|
297
|
+
url = url.replace(/^https:\/\/api\.mwater\.co\//, "https://{s}-api.mwater.co/");
|
|
298
|
+
}
|
|
299
|
+
if (this.options.client) {
|
|
300
|
+
url += `&client=${this.options.client}`;
|
|
301
|
+
}
|
|
302
|
+
if (this.options.share) {
|
|
303
|
+
url += `&share=${this.options.share}`;
|
|
304
|
+
}
|
|
305
|
+
// Add where for any relevant filters
|
|
306
|
+
const relevantFilters = lodash_1.default.where(filters, { table: design.table });
|
|
307
|
+
// If any, create and
|
|
308
|
+
const whereClauses = lodash_1.default.map(relevantFilters, (f) => (0, expressions_1.injectTableAlias)(f.jsonql, "main"));
|
|
309
|
+
// Wrap if multiple
|
|
310
|
+
if (whereClauses.length > 1) {
|
|
311
|
+
where = { type: "op", op: "and", exprs: whereClauses };
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
where = whereClauses[0];
|
|
315
|
+
}
|
|
316
|
+
if (where) {
|
|
317
|
+
url += "&where=" + encodeURIComponent((0, compressJson_1.default)(where));
|
|
318
|
+
}
|
|
319
|
+
return url;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
class ServerWidgetLayerPopupWidgetDataSource {
|
|
323
|
+
options;
|
|
324
|
+
// options:
|
|
325
|
+
// apiUrl: API url to use for talking to mWater server
|
|
326
|
+
// client: client id to use for talking to mWater server
|
|
327
|
+
// share: share id to use for talking to mWater server
|
|
328
|
+
// dashboardId: dashboard id to use on server
|
|
329
|
+
// dataSource: data source that is used for determining cache expiry
|
|
330
|
+
// rev: revision to use to allow caching
|
|
331
|
+
// widgetId: widget id to use
|
|
332
|
+
// layerView: layer view of map inside widget
|
|
333
|
+
// popupWidgetId: id of popup widget
|
|
334
|
+
constructor(options) {
|
|
335
|
+
this.options = options;
|
|
336
|
+
}
|
|
337
|
+
// Get the data that the widget needs. The widget should implement getData method (see above) to get the actual data on the server
|
|
338
|
+
// filters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. Use injectAlias to correct
|
|
339
|
+
// callback: (error, data)
|
|
340
|
+
getData(design, filters, callback) {
|
|
341
|
+
const query = {
|
|
342
|
+
client: this.options.client,
|
|
343
|
+
share: this.options.share,
|
|
344
|
+
filters: (0, compressJson_1.default)(filters),
|
|
345
|
+
rev: this.options.rev
|
|
346
|
+
};
|
|
347
|
+
const url = this.options.apiUrl +
|
|
348
|
+
`dashboards/${this.options.dashboardId}/widgets/${this.options.widgetId}/layers/${this.options.layerView.id}/widgets/${this.options.popupWidgetId}/data?` +
|
|
349
|
+
querystring_1.default.stringify(query);
|
|
350
|
+
const headers = {};
|
|
351
|
+
const cacheExpiry = this.options.dataSource.getCacheExpiry();
|
|
352
|
+
if (cacheExpiry) {
|
|
353
|
+
const seconds = Math.floor((new Date().getTime() - cacheExpiry) / 1000);
|
|
354
|
+
headers["Cache-Control"] = `max-age=${seconds}`;
|
|
355
|
+
}
|
|
356
|
+
jquery_1.default.ajax({
|
|
357
|
+
dataType: "json",
|
|
358
|
+
method: "GET",
|
|
359
|
+
url,
|
|
360
|
+
headers
|
|
361
|
+
})
|
|
362
|
+
.done((data) => {
|
|
363
|
+
return callback(null, data);
|
|
364
|
+
})
|
|
365
|
+
.fail((xhr) => {
|
|
366
|
+
console.log(xhr.responseText);
|
|
367
|
+
return callback(new Error(xhr.responseText));
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/** For map widgets, the following is required */
|
|
371
|
+
getMapDataSource(design) {
|
|
372
|
+
throw new Error("TODO!");
|
|
373
|
+
}
|
|
374
|
+
// Get the url to download an image (by id from an image or imagelist column)
|
|
375
|
+
// Height, if specified, is minimum height needed. May return larger image
|
|
376
|
+
getImageUrl(imageId, height) {
|
|
377
|
+
let url = this.options.apiUrl + `images/${imageId}`;
|
|
378
|
+
if (height) {
|
|
379
|
+
url += `?h=${height}`;
|
|
380
|
+
}
|
|
381
|
+
return url;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { DataSource, Schema } from "@mwater/expressions";
|
|
4
|
+
export interface SettingsModalComponentProps {
|
|
5
|
+
onDesignChange: any;
|
|
6
|
+
schema: Schema;
|
|
7
|
+
dataSource: DataSource;
|
|
8
|
+
}
|
|
9
|
+
interface SettingsModalComponentState {
|
|
10
|
+
design: any;
|
|
11
|
+
}
|
|
12
|
+
export default class SettingsModalComponent extends React.Component<SettingsModalComponentProps, SettingsModalComponentState> {
|
|
13
|
+
static contextTypes: {
|
|
14
|
+
globalFiltersElementFactory: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
};
|
|
16
|
+
constructor(props: any);
|
|
17
|
+
show(design: any): void;
|
|
18
|
+
handleSave: () => void;
|
|
19
|
+
handleCancel: () => void;
|
|
20
|
+
handleDesignChange: (design: any) => void;
|
|
21
|
+
handleFiltersChange: (filters: any) => void;
|
|
22
|
+
handleGlobalFiltersChange: (globalFilters: any) => void;
|
|
23
|
+
render(): React.CElement<{
|
|
24
|
+
size: string;
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
onAction: () => void;
|
|
27
|
+
}, React.Component<{
|
|
28
|
+
size: string;
|
|
29
|
+
onCancel: () => void;
|
|
30
|
+
onAction: () => void;
|
|
31
|
+
}, any, any>> | null;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const prop_types_1 = __importDefault(require("prop-types"));
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const react_1 = __importDefault(require("react"));
|
|
32
|
+
const R = react_1.default.createElement;
|
|
33
|
+
const update_object_1 = __importDefault(require("update-object"));
|
|
34
|
+
const languages_1 = require("../languages");
|
|
35
|
+
const ui = __importStar(require("@mwater/react-library/lib/bootstrap"));
|
|
36
|
+
const react_select_1 = __importDefault(require("react-select"));
|
|
37
|
+
const DashboardUtils = __importStar(require("./DashboardUtils"));
|
|
38
|
+
const ActionCancelModalComponent_1 = __importDefault(require("@mwater/react-library/lib/ActionCancelModalComponent"));
|
|
39
|
+
const QuickfiltersDesignComponent_1 = __importDefault(require("../quickfilter/QuickfiltersDesignComponent"));
|
|
40
|
+
const FiltersDesignerComponent_1 = __importDefault(require("../FiltersDesignerComponent"));
|
|
41
|
+
// Popup with settings for dashboard
|
|
42
|
+
class SettingsModalComponent extends react_1.default.Component {
|
|
43
|
+
static contextTypes = { globalFiltersElementFactory: prop_types_1.default.func };
|
|
44
|
+
constructor(props) {
|
|
45
|
+
super(props);
|
|
46
|
+
this.state = {
|
|
47
|
+
design: null // Set when being edited
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
show(design) {
|
|
51
|
+
return this.setState({ design });
|
|
52
|
+
}
|
|
53
|
+
handleSave = () => {
|
|
54
|
+
this.props.onDesignChange(this.state.design);
|
|
55
|
+
return this.setState({ design: null });
|
|
56
|
+
};
|
|
57
|
+
handleCancel = () => {
|
|
58
|
+
return this.setState({ design: null });
|
|
59
|
+
};
|
|
60
|
+
handleDesignChange = (design) => {
|
|
61
|
+
return this.setState({ design });
|
|
62
|
+
};
|
|
63
|
+
handleFiltersChange = (filters) => {
|
|
64
|
+
const design = lodash_1.default.extend({}, this.state.design, { filters });
|
|
65
|
+
return this.handleDesignChange(design);
|
|
66
|
+
};
|
|
67
|
+
handleGlobalFiltersChange = (globalFilters) => {
|
|
68
|
+
const design = lodash_1.default.extend({}, this.state.design, { globalFilters });
|
|
69
|
+
return this.handleDesignChange(design);
|
|
70
|
+
};
|
|
71
|
+
render() {
|
|
72
|
+
// Don't show if not editing
|
|
73
|
+
if (!this.state.design) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
// Get filterable tables
|
|
77
|
+
const filterableTables = DashboardUtils.getFilterableTables(this.state.design, this.props.schema);
|
|
78
|
+
const localeOptions = lodash_1.default.map(languages_1.languages, (language) => {
|
|
79
|
+
return {
|
|
80
|
+
value: language.code,
|
|
81
|
+
label: language.en + " (" + language.name + ")"
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
return R(ActionCancelModalComponent_1.default, {
|
|
85
|
+
size: "large",
|
|
86
|
+
onCancel: this.handleCancel,
|
|
87
|
+
onAction: this.handleSave
|
|
88
|
+
}, R("div", { style: { paddingBottom: 200 } }, R("h4", null, "Quick Filters"), R("div", { className: "text-muted" }, "Quick filters are shown to the user as a dropdown at the top of the dashboard and can be used to filter data of widgets."), filterableTables.length > 0
|
|
89
|
+
? R(QuickfiltersDesignComponent_1.default, {
|
|
90
|
+
design: this.state.design.quickfilters || [],
|
|
91
|
+
onDesignChange: (design) => this.handleDesignChange((0, update_object_1.default)(this.state.design, { quickfilters: { $set: design } })),
|
|
92
|
+
schema: this.props.schema,
|
|
93
|
+
dataSource: this.props.dataSource,
|
|
94
|
+
tables: filterableTables
|
|
95
|
+
})
|
|
96
|
+
: "Nothing to quickfilter. Add widgets to the dashboard", R("h4", { style: { paddingTop: 10 } }, "Filters"), R("div", { className: "text-muted" }, "Filters are built in to the dashboard and cannot be changed by viewers of the dashboard."), filterableTables.length > 0
|
|
97
|
+
? R(FiltersDesignerComponent_1.default, {
|
|
98
|
+
schema: this.props.schema,
|
|
99
|
+
dataSource: this.props.dataSource,
|
|
100
|
+
filters: this.state.design.filters,
|
|
101
|
+
onFiltersChange: this.handleFiltersChange,
|
|
102
|
+
filterableTables
|
|
103
|
+
})
|
|
104
|
+
: "Nothing to filter. Add widgets to the dashboard", this.context.globalFiltersElementFactory
|
|
105
|
+
? R("div", null, R("h4", { style: { paddingTop: 10 } }, "Global Filters"), this.context.globalFiltersElementFactory({
|
|
106
|
+
schema: this.props.schema,
|
|
107
|
+
dataSource: this.props.dataSource,
|
|
108
|
+
filterableTables,
|
|
109
|
+
globalFilters: this.state.design.globalFilters || [],
|
|
110
|
+
onChange: this.handleGlobalFiltersChange
|
|
111
|
+
}))
|
|
112
|
+
: undefined, R("h4", { style: { paddingTop: 10 } }, "Language"), R("div", { className: "text-muted" }, "Controls the preferred language of widgets and uses specified language when available"), R(react_select_1.default, {
|
|
113
|
+
value: lodash_1.default.findWhere(localeOptions, { value: this.state.design.locale || "en" }) || null,
|
|
114
|
+
options: localeOptions,
|
|
115
|
+
onChange: (locale) => this.handleDesignChange((0, update_object_1.default)(this.state.design, { locale: { $set: locale.value } }))
|
|
116
|
+
}), R("h4", { style: { paddingTop: 10 } }, "Advanced"), R(ui.Checkbox, {
|
|
117
|
+
value: this.state.design.implicitFiltersEnabled != null ? this.state.design.implicitFiltersEnabled : true,
|
|
118
|
+
onChange: (value) => this.handleDesignChange((0, update_object_1.default)(this.state.design, { implicitFiltersEnabled: { $set: value } }))
|
|
119
|
+
}, "Enable Implicit Filtering (leave unchecked for new dashboards)")));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.default = SettingsModalComponent;
|