@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,326 @@
|
|
|
1
|
+
import PropTypes from "prop-types"
|
|
2
|
+
import React from "react"
|
|
3
|
+
const R = React.createElement
|
|
4
|
+
import _ from "lodash"
|
|
5
|
+
import * as ui from "@mwater/react-library/lib/bootstrap"
|
|
6
|
+
import update from "@mwater/react-library/lib/update"
|
|
7
|
+
import Widget, { CreateViewElementOptions } from "./Widget"
|
|
8
|
+
import DropdownWidgetComponent from "./DropdownWidgetComponent"
|
|
9
|
+
import ModalPopupComponent from "@mwater/react-library/lib/ModalPopupComponent"
|
|
10
|
+
|
|
11
|
+
// Table of contents widget that displays the h1, h2, etc entries from all text fields in one widget
|
|
12
|
+
// design is:
|
|
13
|
+
// header: text of header. Defaults to "Contents"
|
|
14
|
+
// borderWeight: border weight. Defaults to 0=None. 1=light, 2=medium, 3=heavy
|
|
15
|
+
// numbering: true/false for prepending numbering to entries (e.g. 3.4.1)
|
|
16
|
+
export default class TOCWidget extends Widget {
|
|
17
|
+
// Creates a React element that is a view of the widget
|
|
18
|
+
// options:
|
|
19
|
+
// schema: schema to use
|
|
20
|
+
// dataSource: data source to use
|
|
21
|
+
// widgetDataSource: Gives data to the widget in a way that allows client-server separation and secure sharing. See definition in WidgetDataSource.
|
|
22
|
+
// design: widget design
|
|
23
|
+
// scope: scope of the widget (when the widget self-selects a particular scope)
|
|
24
|
+
// filters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. Use injectAlias to correct
|
|
25
|
+
// onScopeChange: called with scope of widget
|
|
26
|
+
// onDesignChange: called with new design. null/undefined for readonly
|
|
27
|
+
// width: width in pixels on screen
|
|
28
|
+
// height: height in pixels on screen
|
|
29
|
+
// tocEntries: entries in the table of contents
|
|
30
|
+
// onScrollToTOCEntry: called with (widgetId, tocEntryId) to scroll to TOC entry
|
|
31
|
+
createViewElement(options: CreateViewElementOptions) {
|
|
32
|
+
return R(TOCWidgetComponent, {
|
|
33
|
+
design: options.design,
|
|
34
|
+
onDesignChange: options.onDesignChange,
|
|
35
|
+
width: options.width,
|
|
36
|
+
height: options.height,
|
|
37
|
+
tocEntries: options.tocEntries,
|
|
38
|
+
onScrollToTOCEntry: options.onScrollToTOCEntry
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Determine if widget is auto-height, which means that a vertical height is not required.
|
|
43
|
+
isAutoHeight() {
|
|
44
|
+
return true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class TOCWidgetComponent extends React.Component {
|
|
49
|
+
static propTypes = {
|
|
50
|
+
design: PropTypes.object.isRequired, // See Map Design.md
|
|
51
|
+
onDesignChange: PropTypes.func, // Called with new design. null/undefined for readonly
|
|
52
|
+
|
|
53
|
+
width: PropTypes.number,
|
|
54
|
+
height: PropTypes.number,
|
|
55
|
+
tocEntries: PropTypes.arrayOf(
|
|
56
|
+
PropTypes.shape({
|
|
57
|
+
id: PropTypes.any,
|
|
58
|
+
widgetId: PropTypes.string.isRequired,
|
|
59
|
+
level: PropTypes.number.isRequired,
|
|
60
|
+
text: PropTypes.string.isRequired
|
|
61
|
+
})
|
|
62
|
+
),
|
|
63
|
+
onScrollToTOCEntry: PropTypes.func
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
constructor(props: any) {
|
|
67
|
+
super(props)
|
|
68
|
+
this.state = {
|
|
69
|
+
editing: false // true if editing
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
handleStartEditing = () => {
|
|
74
|
+
return this.setState({ editing: true })
|
|
75
|
+
}
|
|
76
|
+
handleEndEditing = () => {
|
|
77
|
+
return this.setState({ editing: false })
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
renderEditor() {
|
|
81
|
+
if (!this.state.editing) {
|
|
82
|
+
return null
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Create editor
|
|
86
|
+
const editor = R(TOCWidgetDesignerComponent, {
|
|
87
|
+
design: this.props.design,
|
|
88
|
+
onDesignChange: this.props.onDesignChange
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
return R(
|
|
92
|
+
ModalPopupComponent,
|
|
93
|
+
{
|
|
94
|
+
showCloseX: true,
|
|
95
|
+
header: "Table of Contents Options",
|
|
96
|
+
onClose: this.handleEndEditing
|
|
97
|
+
},
|
|
98
|
+
editor
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
renderContent() {
|
|
103
|
+
return R(TOCWidgetViewComponent, {
|
|
104
|
+
design: this.props.design,
|
|
105
|
+
onDesignChange: this.props.onDesignChange,
|
|
106
|
+
width: this.props.width,
|
|
107
|
+
height: this.props.height,
|
|
108
|
+
tocEntries: this.props.tocEntries,
|
|
109
|
+
onScrollToTOCEntry: this.props.onScrollToTOCEntry
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
render() {
|
|
114
|
+
const dropdownItems = []
|
|
115
|
+
if (this.props.onDesignChange != null) {
|
|
116
|
+
dropdownItems.push({ label: "Edit", icon: "pencil", onClick: this.handleStartEditing })
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Wrap in a simple widget
|
|
120
|
+
return R(
|
|
121
|
+
"div",
|
|
122
|
+
{ onDoubleClick: this.handleStartEditing },
|
|
123
|
+
this.props.onDesignChange != null ? this.renderEditor() : undefined,
|
|
124
|
+
R(
|
|
125
|
+
DropdownWidgetComponent,
|
|
126
|
+
{
|
|
127
|
+
width: this.props.width,
|
|
128
|
+
height: this.props.height,
|
|
129
|
+
dropdownItems
|
|
130
|
+
},
|
|
131
|
+
this.renderContent()
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Displays the contents of the widget
|
|
138
|
+
class TOCWidgetViewComponent extends React.Component {
|
|
139
|
+
static propTypes = {
|
|
140
|
+
design: PropTypes.object.isRequired, // Design of chart
|
|
141
|
+
onDesignChange: PropTypes.func, // Called with new design. null/undefined for readonly
|
|
142
|
+
|
|
143
|
+
width: PropTypes.number,
|
|
144
|
+
height: PropTypes.number,
|
|
145
|
+
|
|
146
|
+
tocEntries: PropTypes.arrayOf(
|
|
147
|
+
PropTypes.shape({
|
|
148
|
+
id: PropTypes.any,
|
|
149
|
+
widgetId: PropTypes.string.isRequired,
|
|
150
|
+
level: PropTypes.number.isRequired,
|
|
151
|
+
text: PropTypes.string.isRequired
|
|
152
|
+
})
|
|
153
|
+
),
|
|
154
|
+
onScrollToTOCEntry: PropTypes.func
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
handleEntryClick = (tocEntry: any) => {
|
|
158
|
+
return this.props.onScrollToTOCEntry?.(tocEntry.widgetId, tocEntry.id)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
renderTOCEntry(tocEntry: any, index: any) {
|
|
162
|
+
// Find indentation number (e.g "1.3.2") by counting # backwards that are same level with no level lower
|
|
163
|
+
let level
|
|
164
|
+
let indentation = ""
|
|
165
|
+
if (this.props.design.numbering) {
|
|
166
|
+
let asc, end
|
|
167
|
+
for (
|
|
168
|
+
level = 1, end = tocEntry.level, asc = 1 <= end;
|
|
169
|
+
asc ? level <= end : level >= end;
|
|
170
|
+
asc ? level++ : level--
|
|
171
|
+
) {
|
|
172
|
+
let value = 0
|
|
173
|
+
for (let i2 = 0, end1 = index, asc1 = 0 <= end1; asc1 ? i2 <= end1 : i2 >= end1; asc1 ? i2++ : i2--) {
|
|
174
|
+
if (this.props.tocEntries[i2].level === level) {
|
|
175
|
+
value += 1
|
|
176
|
+
} else if (this.props.tocEntries[i2].level < level) {
|
|
177
|
+
value = 0
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
indentation += `${value}.`
|
|
182
|
+
}
|
|
183
|
+
indentation += " "
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return R(
|
|
187
|
+
"div",
|
|
188
|
+
{ key: index, style: { paddingLeft: tocEntry.level * 8 - 8 } },
|
|
189
|
+
R(
|
|
190
|
+
"a",
|
|
191
|
+
{ className: "link-plain", onClick: this.handleEntryClick.bind(null, tocEntry) },
|
|
192
|
+
indentation,
|
|
193
|
+
R("span", null, tocEntry.text)
|
|
194
|
+
)
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
render() {
|
|
199
|
+
// Get border
|
|
200
|
+
const border = (() => {
|
|
201
|
+
switch (this.props.design.borderWeight) {
|
|
202
|
+
case 0:
|
|
203
|
+
return "none"
|
|
204
|
+
case 1:
|
|
205
|
+
return "solid 1px #f4f4f4"
|
|
206
|
+
case 2:
|
|
207
|
+
return "solid 1px #ccc"
|
|
208
|
+
case 3:
|
|
209
|
+
return "solid 1px #888"
|
|
210
|
+
}
|
|
211
|
+
})()
|
|
212
|
+
|
|
213
|
+
return R(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
style: {
|
|
217
|
+
width: this.props.width,
|
|
218
|
+
height: this.props.height,
|
|
219
|
+
border,
|
|
220
|
+
padding: 5,
|
|
221
|
+
margin: 1
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
// Render header
|
|
225
|
+
R("div", { style: { fontWeight: "bold" } }, this.props.design.header),
|
|
226
|
+
_.map(this.props.tocEntries, (tocEntry, i) => {
|
|
227
|
+
return this.renderTOCEntry(tocEntry, i)
|
|
228
|
+
}),
|
|
229
|
+
|
|
230
|
+
// Add placeholder if none and editable
|
|
231
|
+
this.props.onDesignChange && this.props.tocEntries.length === 0
|
|
232
|
+
? R(
|
|
233
|
+
"div",
|
|
234
|
+
{ className: "text-muted" },
|
|
235
|
+
"Table of Contents will appear here as text blocks with headings are added to the dashboard"
|
|
236
|
+
)
|
|
237
|
+
: undefined
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Designer for TOC widget options
|
|
243
|
+
class TOCWidgetDesignerComponent extends React.Component {
|
|
244
|
+
constructor(...args: any[]) {
|
|
245
|
+
super(...args)
|
|
246
|
+
this.update = this.update.bind(this)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
static propTypes = {
|
|
250
|
+
design: PropTypes.object.isRequired,
|
|
251
|
+
onDesignChange: PropTypes.func.isRequired
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Updates design with the specified changes
|
|
255
|
+
update() {
|
|
256
|
+
return update(this.props.design, this.props.onDesignChange, arguments)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
handleMarkdownChange = (ev: any) => {
|
|
260
|
+
const design = _.extend({}, this.props.design, { markdown: ev.target.value })
|
|
261
|
+
return this.props.onDesignChange(design)
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
render() {
|
|
265
|
+
return R(
|
|
266
|
+
"div",
|
|
267
|
+
null,
|
|
268
|
+
R(
|
|
269
|
+
ui.FormGroup,
|
|
270
|
+
{ label: "Header" },
|
|
271
|
+
R(ui.TextInput, { value: this.props.design.header || "", onChange: this.update("header"), placeholder: "None" })
|
|
272
|
+
),
|
|
273
|
+
R(
|
|
274
|
+
ui.FormGroup,
|
|
275
|
+
{ label: "Border" },
|
|
276
|
+
R(BorderComponent, { value: this.props.design.borderWeight || 0, onChange: this.update("borderWeight") })
|
|
277
|
+
),
|
|
278
|
+
R(
|
|
279
|
+
ui.FormGroup,
|
|
280
|
+
{ label: "Numbering" },
|
|
281
|
+
R(
|
|
282
|
+
ui.Radio,
|
|
283
|
+
{
|
|
284
|
+
inline: true,
|
|
285
|
+
value: this.props.design.numbering || false,
|
|
286
|
+
radioValue: true,
|
|
287
|
+
onChange: this.update("numbering")
|
|
288
|
+
},
|
|
289
|
+
"On"
|
|
290
|
+
),
|
|
291
|
+
R(
|
|
292
|
+
ui.Radio,
|
|
293
|
+
{
|
|
294
|
+
inline: true,
|
|
295
|
+
value: this.props.design.numbering || false,
|
|
296
|
+
radioValue: false,
|
|
297
|
+
onChange: this.update("numbering")
|
|
298
|
+
},
|
|
299
|
+
"Off"
|
|
300
|
+
)
|
|
301
|
+
)
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Allows setting border heaviness
|
|
307
|
+
class BorderComponent extends React.Component {
|
|
308
|
+
static propTypes = {
|
|
309
|
+
value: PropTypes.number,
|
|
310
|
+
defaultValue: PropTypes.number,
|
|
311
|
+
onChange: PropTypes.func.isRequired
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
render() {
|
|
315
|
+
const value = this.props.value != null ? this.props.value : this.props.defaultValue
|
|
316
|
+
|
|
317
|
+
return R(
|
|
318
|
+
"div",
|
|
319
|
+
null,
|
|
320
|
+
R(ui.Radio, { inline: true, value, radioValue: 0, onChange: this.props.onChange }, "None"),
|
|
321
|
+
R(ui.Radio, { inline: true, value, radioValue: 1, onChange: this.props.onChange }, "Light"),
|
|
322
|
+
R(ui.Radio, { inline: true, value, radioValue: 2, onChange: this.props.onChange }, "Medium"),
|
|
323
|
+
R(ui.Radio, { inline: true, value, radioValue: 3, onChange: this.props.onChange }, "Heavy")
|
|
324
|
+
)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Schema, DataSource } from "@mwater/expressions"
|
|
2
|
+
import { ReactElement } from "react"
|
|
3
|
+
import { WidgetScope, JsonQLFilter } from ".."
|
|
4
|
+
import { WidgetDataSource } from "./WidgetDataSource"
|
|
5
|
+
|
|
6
|
+
export interface CreateViewElementOptions {
|
|
7
|
+
/** schema to use **/
|
|
8
|
+
schema: Schema
|
|
9
|
+
/** data source to use. Only used when designing, for display uses widgetDataSource **/
|
|
10
|
+
dataSource: DataSource
|
|
11
|
+
/** Gives data to the widget in a way that allows client-server separation and secure sharing. See definition in WidgetDataSource. **/
|
|
12
|
+
widgetDataSource: WidgetDataSource
|
|
13
|
+
/** widget design **/
|
|
14
|
+
design: object
|
|
15
|
+
/** scope of the widget (when the widget self-selects a particular scope) **/
|
|
16
|
+
scope?: WidgetScope | null
|
|
17
|
+
/** array of filters to apply.**/
|
|
18
|
+
filters: JsonQLFilter[]
|
|
19
|
+
/** called with scope of widget **/
|
|
20
|
+
onScopeChange: (scope: WidgetScope | null) => void
|
|
21
|
+
/** called with new design. null/undefined for readonly **/
|
|
22
|
+
onDesignChange?: { (design: object): void } | null
|
|
23
|
+
/** width in pixels on screen **/
|
|
24
|
+
width?: number
|
|
25
|
+
/** height in pixels on screen **/
|
|
26
|
+
height?: number
|
|
27
|
+
/** optional table name of table that will be filtered to have a single row present. Widget designer should optionally account for this **/
|
|
28
|
+
singleRowTable?: string
|
|
29
|
+
/** Called with (tableId, rowId) when item is clicked **/
|
|
30
|
+
onRowClick?: (tableId: string, rowId: any) => void
|
|
31
|
+
/** Optional lookup of string name to value. Used for {{branding}} and other replacement strings in text widget */
|
|
32
|
+
namedStrings?: { [key: string]: string }
|
|
33
|
+
|
|
34
|
+
/** Entries in the table of content */
|
|
35
|
+
tocEntries?: string[]
|
|
36
|
+
|
|
37
|
+
/** the widget callback ref */
|
|
38
|
+
widgetRef?: (widget: any) => void
|
|
39
|
+
|
|
40
|
+
/** called with (widgetId, tocEntryId) to scroll to TOC entry */
|
|
41
|
+
onScrollToTOCEntry?: (widgetId: string, tocEntryId: string) => void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default class Widget {
|
|
45
|
+
/** Creates a React element that is a view of the widget */
|
|
46
|
+
createViewElement(options: CreateViewElementOptions): ReactElement<any> {
|
|
47
|
+
throw new Error("Not implemented")
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Get the data that the widget needs. This will be called on the server, typically.
|
|
51
|
+
* design: design of the chart
|
|
52
|
+
* schema: schema to use
|
|
53
|
+
* dataSource: data source to get data from
|
|
54
|
+
* filters: array of { table: table id, jsonql: jsonql condition with {alias} for tableAlias }
|
|
55
|
+
* callback: (error, data)
|
|
56
|
+
*/
|
|
57
|
+
getData(
|
|
58
|
+
design: any,
|
|
59
|
+
schema: Schema,
|
|
60
|
+
dataSource: DataSource,
|
|
61
|
+
filters: JsonQLFilter[],
|
|
62
|
+
callback: (error: any, data?: any) => void
|
|
63
|
+
): void {
|
|
64
|
+
throw new Error("Not implemented")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Determine if widget is auto-height, which means that a vertical height is not required. */
|
|
68
|
+
isAutoHeight(): boolean {
|
|
69
|
+
return false
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Get a list of table ids that can be filtered on */
|
|
73
|
+
getFilterableTables(design: any, schema: Schema): string[] {
|
|
74
|
+
return []
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Get table of contents entries for the widget, entries that should be displayed in the TOC.
|
|
78
|
+
* returns `[{ id: "id that is unique within widget", text: "text of TOC entry", level: 1, 2, etc. }]
|
|
79
|
+
*/
|
|
80
|
+
getTOCEntries(design: any, namedStrings?: { [key: string]: string }): { id: string; text: string; level: number }[] {
|
|
81
|
+
return []
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JsonQLFilter } from "../JsonQLFilter"
|
|
2
|
+
import { MapDataSource } from "../maps/MapDataSource"
|
|
3
|
+
import { MapDesign } from "../maps/MapDesign"
|
|
4
|
+
|
|
5
|
+
/** Interface for a widget data source that gives the widget access to the data it needs, even if that data is not directly available from the data source
|
|
6
|
+
* For example, Alice might share a widget with Bob. Bob can't access the data directly that Alice sees (since it's private), but he can use the widget
|
|
7
|
+
* data source to get it, as the server will return the exact data he needs for the widget, since the server has a copy of the design of the widget.
|
|
8
|
+
*/
|
|
9
|
+
export interface WidgetDataSource {
|
|
10
|
+
/** Get the data that the widget needs. The widget should implement getData method (see above) to get the actual data on the server
|
|
11
|
+
* design: design of the widget. Ignored in the case of server-side rendering
|
|
12
|
+
* filters: array of filters to apply. Each is { table: table id, jsonql: jsonql condition with {alias} for tableAlias. Use injectAlias to correct
|
|
13
|
+
* callback: (error, data)
|
|
14
|
+
*/
|
|
15
|
+
getData(design: any, filters: JsonQLFilter[], callback: (error: any, data?: any) => void): void
|
|
16
|
+
|
|
17
|
+
/** For map widgets, the following is required */
|
|
18
|
+
getMapDataSource?(design: MapDesign): MapDataSource
|
|
19
|
+
|
|
20
|
+
/** Get the url to download an image (by id from an image or imagelist column)
|
|
21
|
+
* Height, if specified, is minimum height needed. May return larger image */
|
|
22
|
+
getImageUrl(imageId: string, height?: number): string
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import ChartWidget from "./charts/ChartWidget"
|
|
2
|
+
import LayeredChart from "./charts/layered/LayeredChart"
|
|
3
|
+
import TableChart from "./charts/table/TableChart"
|
|
4
|
+
import CalendarChart from "./charts/calendar/CalendarChart"
|
|
5
|
+
import ImageMosaicChart from "./charts/imagemosaic/ImageMosaicChart"
|
|
6
|
+
import PivotChart from "./charts/pivot/PivotChart"
|
|
7
|
+
import MarkdownWidget from "./MarkdownWidget"
|
|
8
|
+
import TextWidget from "./text/TextWidget"
|
|
9
|
+
import ImageWidget from "./ImageWidget"
|
|
10
|
+
import MapWidget from "./MapWidget"
|
|
11
|
+
import IFrameWidget from "./IFrameWidget"
|
|
12
|
+
import TOCWidget from "./TOCWidget"
|
|
13
|
+
import Widget from "./Widget"
|
|
14
|
+
|
|
15
|
+
const widgetTypes = {
|
|
16
|
+
LayeredChart: new ChartWidget(new LayeredChart()),
|
|
17
|
+
TableChart: new ChartWidget(new TableChart()),
|
|
18
|
+
CalendarChart: new ChartWidget(new CalendarChart()),
|
|
19
|
+
ImageMosaicChart: new ChartWidget(new ImageMosaicChart()),
|
|
20
|
+
PivotChart: new ChartWidget(new PivotChart()),
|
|
21
|
+
Markdown: new MarkdownWidget(),
|
|
22
|
+
Map: new MapWidget(),
|
|
23
|
+
Text: new TextWidget(),
|
|
24
|
+
Image: new ImageWidget(),
|
|
25
|
+
IFrame: new IFrameWidget(),
|
|
26
|
+
TOC: new TOCWidget()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Creates widgets based on type
|
|
30
|
+
export default class WidgetFactory {
|
|
31
|
+
static createWidget(type: string): Widget {
|
|
32
|
+
if (widgetTypes[type]) {
|
|
33
|
+
return widgetTypes[type]
|
|
34
|
+
}
|
|
35
|
+
throw new Error(`Unknown widget type ${type}`)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _ from "lodash"
|
|
2
|
+
|
|
3
|
+
// Scopes widgets, applying scope that a widget specifies to itself and the filter to other
|
|
4
|
+
// widgets. Immutable.
|
|
5
|
+
// Scope is a JSON object consisting of:
|
|
6
|
+
// name: human-readable name for the scope/filter
|
|
7
|
+
// filter: filter for other widgets in format { table: table id, jsonql: JsonQL with {alias} for the table name to filter by }
|
|
8
|
+
// data: internal, opaque data that the widget understands. opaque
|
|
9
|
+
export default class WidgetScoper {
|
|
10
|
+
scopes: any
|
|
11
|
+
|
|
12
|
+
constructor(scopes?: any) {
|
|
13
|
+
this.scopes = scopes || {}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Applies a scope to a particular widget. Filter will be applied to all others
|
|
17
|
+
applyScope(widgetId: any, scope: any) {
|
|
18
|
+
const data = {}
|
|
19
|
+
data[widgetId] = scope
|
|
20
|
+
const scopes = _.extend({}, this.scopes, data)
|
|
21
|
+
return new WidgetScoper(scopes)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Gets the scope of a widget
|
|
25
|
+
getScope(widgetId: any) {
|
|
26
|
+
if (this.scopes[widgetId]) {
|
|
27
|
+
return this.scopes[widgetId]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Gets lookup of scopes by widget id
|
|
32
|
+
getScopes() {
|
|
33
|
+
return this.scopes
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getFilters(widgetId: any) {
|
|
37
|
+
const filters = []
|
|
38
|
+
for (let key in this.scopes) {
|
|
39
|
+
const value = this.scopes[key]
|
|
40
|
+
if (key !== widgetId && value && value.filter) {
|
|
41
|
+
filters.push(value.filter)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return filters
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
reset() {
|
|
49
|
+
return new WidgetScoper()
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _ from "lodash"
|
|
2
|
+
import PropTypes from "prop-types"
|
|
3
|
+
import React from "react"
|
|
4
|
+
const R = React.createElement
|
|
5
|
+
|
|
6
|
+
export interface WidgetScopesViewComponentProps {
|
|
7
|
+
/** lookup of id to scope (see WidgetScoper for definition) */
|
|
8
|
+
scopes: any
|
|
9
|
+
onRemoveScope: any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Shows widget scopes
|
|
13
|
+
export default class WidgetScopesViewComponent extends React.Component<WidgetScopesViewComponentProps> {
|
|
14
|
+
renderScope = (id: any, scope: any) => {
|
|
15
|
+
const style = {
|
|
16
|
+
cursor: "pointer",
|
|
17
|
+
borderRadius: 4,
|
|
18
|
+
border: "solid 1px #BBB",
|
|
19
|
+
padding: "1px 5px 1px 5px",
|
|
20
|
+
color: "#666",
|
|
21
|
+
backgroundColor: "#EEE",
|
|
22
|
+
display: "inline-block",
|
|
23
|
+
marginLeft: 4,
|
|
24
|
+
marginRight: 4
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!scope) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return R(
|
|
32
|
+
"div",
|
|
33
|
+
{ key: id, style, onClick: this.props.onRemoveScope.bind(null, id) },
|
|
34
|
+
scope.name,
|
|
35
|
+
" ",
|
|
36
|
+
R("span", { className: "fas fa-times" })
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
const { scopes } = this.props
|
|
42
|
+
if (_.compact(_.values(scopes)).length === 0) {
|
|
43
|
+
return null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return R(
|
|
47
|
+
"div",
|
|
48
|
+
{ className: "alert alert-info" },
|
|
49
|
+
R("span", { className: "fas fa-filter" }),
|
|
50
|
+
" Filters: ",
|
|
51
|
+
_.map(_.keys(scopes), (id) => this.renderScope(id, scopes[id]))
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|