@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,163 @@
|
|
|
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 react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
9
|
+
const R = react_1.default.createElement;
|
|
10
|
+
const react_dnd_1 = require("react-dnd");
|
|
11
|
+
// Block which can be dragged around in block layout.
|
|
12
|
+
class DraggableBlockComponent extends react_1.default.Component {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.state = {
|
|
16
|
+
hoverSide: null
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
renderHover() {
|
|
20
|
+
const lineStyle = { position: "absolute" };
|
|
21
|
+
// Show
|
|
22
|
+
if (this.props.isOver) {
|
|
23
|
+
// style.backgroundColor = "#DDF"
|
|
24
|
+
switch (this.state.hoverSide) {
|
|
25
|
+
case "left":
|
|
26
|
+
lineStyle.borderLeft = "solid 3px #38D";
|
|
27
|
+
lineStyle.top = 0;
|
|
28
|
+
lineStyle.bottom = 0;
|
|
29
|
+
lineStyle.left = 0;
|
|
30
|
+
break;
|
|
31
|
+
case "right":
|
|
32
|
+
lineStyle.borderRight = "solid 3px #38D";
|
|
33
|
+
lineStyle.top = 0;
|
|
34
|
+
lineStyle.right = 0;
|
|
35
|
+
lineStyle.bottom = 0;
|
|
36
|
+
break;
|
|
37
|
+
case "top":
|
|
38
|
+
lineStyle.borderTop = "solid 3px #38D";
|
|
39
|
+
lineStyle.top = 0;
|
|
40
|
+
lineStyle.left = 0;
|
|
41
|
+
lineStyle.right = 0;
|
|
42
|
+
break;
|
|
43
|
+
case "bottom":
|
|
44
|
+
lineStyle.borderBottom = "solid 3px #38D";
|
|
45
|
+
lineStyle.bottom = 0;
|
|
46
|
+
lineStyle.left = 0;
|
|
47
|
+
lineStyle.right = 0;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
return R("div", { style: lineStyle });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const style = {};
|
|
58
|
+
// Hide if dragging
|
|
59
|
+
if (this.props.isDragging) {
|
|
60
|
+
style.visibility = "hidden";
|
|
61
|
+
}
|
|
62
|
+
return this.props.connectDropTarget(R("div", { style: this.props.style }, R("div", { style: { position: "relative" } }, this.renderHover(), react_1.default.cloneElement(react_1.default.Children.only(this.props.children), {
|
|
63
|
+
connectMoveHandle: this.props.connectDragSource,
|
|
64
|
+
connectDragPreview: this.props.connectDragPreview
|
|
65
|
+
}))));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Gets the drop side (top, left, right, bottom)
|
|
69
|
+
function getDropSide(monitor, component) {
|
|
70
|
+
// Get underlying component
|
|
71
|
+
let pos;
|
|
72
|
+
const blockComponent = component.getDecoratedComponentInstance();
|
|
73
|
+
// Get bounds of component
|
|
74
|
+
const hoverBoundingRect = react_dom_1.default.findDOMNode(blockComponent).getBoundingClientRect();
|
|
75
|
+
const clientOffset = monitor.getClientOffset();
|
|
76
|
+
// Get position within hovered item
|
|
77
|
+
const hoverClientX = clientOffset.x - hoverBoundingRect.left;
|
|
78
|
+
const hoverClientY = clientOffset.y - hoverBoundingRect.top;
|
|
79
|
+
// Determine if over is more left, right, top or bottom
|
|
80
|
+
const fractionX = hoverClientX / (hoverBoundingRect.right - hoverBoundingRect.left);
|
|
81
|
+
const fractionY = hoverClientY / (hoverBoundingRect.bottom - hoverBoundingRect.top);
|
|
82
|
+
if (fractionX > fractionY) {
|
|
83
|
+
// top or right
|
|
84
|
+
if (1 - fractionX > fractionY) {
|
|
85
|
+
// top or left
|
|
86
|
+
pos = "top";
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
pos = "right";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
// bottom or left
|
|
94
|
+
if (1 - fractionX > fractionY) {
|
|
95
|
+
// top or left
|
|
96
|
+
pos = "left";
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
pos = "bottom";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return pos;
|
|
103
|
+
}
|
|
104
|
+
const blockTargetSpec = {
|
|
105
|
+
// Called when an block hovers over this component
|
|
106
|
+
hover(props, monitor, component) {
|
|
107
|
+
// Hovering over self does nothing
|
|
108
|
+
let side;
|
|
109
|
+
const hoveringId = monitor.getItem().block.id;
|
|
110
|
+
const myId = props.block.id;
|
|
111
|
+
if (hoveringId === myId) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (props.onlyBottom) {
|
|
115
|
+
side = "bottom";
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
side = getDropSide(monitor, component);
|
|
119
|
+
}
|
|
120
|
+
// Set the state
|
|
121
|
+
return component.getDecoratedComponentInstance().setState({ hoverSide: side });
|
|
122
|
+
},
|
|
123
|
+
canDrop(props, monitor) {
|
|
124
|
+
const hoveringId = monitor.getItem().block.id;
|
|
125
|
+
const myId = props.block.id;
|
|
126
|
+
if (hoveringId === myId) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
},
|
|
131
|
+
drop(props, monitor, component) {
|
|
132
|
+
if (monitor.didDrop()) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const side = component.getDecoratedComponentInstance().state.hoverSide;
|
|
136
|
+
props.onBlockDrop(monitor.getItem().block, props.block, side);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const blockSourceSpec = {
|
|
140
|
+
beginDrag(props, monitor, component) {
|
|
141
|
+
return {
|
|
142
|
+
block: props.block
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
isDragging(props, monitor) {
|
|
146
|
+
return props.block.id === monitor.getItem().block.id;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
function collectTarget(connect, monitor) {
|
|
150
|
+
return {
|
|
151
|
+
connectDropTarget: connect.dropTarget(),
|
|
152
|
+
isOver: monitor.isOver({ shallow: true }),
|
|
153
|
+
canDrop: monitor.canDrop()
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function collectSource(connect, monitor) {
|
|
157
|
+
return {
|
|
158
|
+
connectDragSource: connect.dragSource(),
|
|
159
|
+
connectDragPreview: connect.dragPreview(),
|
|
160
|
+
isDragging: monitor.isDragging()
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
exports.default = lodash_1.default.flow((0, react_dnd_1.DragSource)("visualization-block", blockSourceSpec, collectSource), (0, react_dnd_1.DropTarget)("visualization-block", blockTargetSpec, collectTarget))(DraggableBlockComponent);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LayoutBlock } from "./blockUtils";
|
|
3
|
+
export interface HorizontalBlockComponentProps {
|
|
4
|
+
block: LayoutBlock;
|
|
5
|
+
collapseColumns?: boolean;
|
|
6
|
+
renderBlock: any;
|
|
7
|
+
/** Called with (sourceBlock, targetBlock, side) when block is dropped on it. side is top, left, bottom, right */
|
|
8
|
+
onBlockDrop?: any;
|
|
9
|
+
/** Called with (block) when block is removed */
|
|
10
|
+
onBlockRemove?: any;
|
|
11
|
+
onBlockUpdate?: any;
|
|
12
|
+
}
|
|
13
|
+
interface HorizontalBlockComponentState {
|
|
14
|
+
dragInitialX: any;
|
|
15
|
+
leftSize: any;
|
|
16
|
+
rightSize: any;
|
|
17
|
+
dragXOffset: any;
|
|
18
|
+
dragIndex: any;
|
|
19
|
+
}
|
|
20
|
+
export default class HorizontalBlockComponent extends React.Component<HorizontalBlockComponentProps, HorizontalBlockComponentState> {
|
|
21
|
+
blockRefs: {
|
|
22
|
+
[blockId: string]: HTMLElement | null;
|
|
23
|
+
};
|
|
24
|
+
constructor(props: any);
|
|
25
|
+
componentWillUnmount(): void;
|
|
26
|
+
handleMouseDown: (index: any, ev: any) => void;
|
|
27
|
+
handleMouseMove: (ev: any) => void;
|
|
28
|
+
handleMouseUp: (ev: any) => void;
|
|
29
|
+
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,191 @@
|
|
|
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 react_1 = __importDefault(require("react"));
|
|
8
|
+
const R = react_1.default.createElement;
|
|
9
|
+
const DraggableBlockComponent_1 = __importDefault(require("./DraggableBlockComponent"));
|
|
10
|
+
class HorizontalBlockComponent extends react_1.default.Component {
|
|
11
|
+
blockRefs;
|
|
12
|
+
constructor(props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
dragIndex: null,
|
|
16
|
+
dragInitialX: null,
|
|
17
|
+
dragXOffset: null,
|
|
18
|
+
leftSize: null,
|
|
19
|
+
rightSize: null
|
|
20
|
+
};
|
|
21
|
+
this.blockRefs = {};
|
|
22
|
+
}
|
|
23
|
+
componentWillUnmount() {
|
|
24
|
+
// Remove listeners
|
|
25
|
+
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
26
|
+
return document.removeEventListener("mouseup", this.handleMouseUp);
|
|
27
|
+
}
|
|
28
|
+
handleMouseDown = (index, ev) => {
|
|
29
|
+
// Prevent html5 drag
|
|
30
|
+
ev.preventDefault();
|
|
31
|
+
// Get sizes of two blocks
|
|
32
|
+
this.setState({
|
|
33
|
+
dragIndex: index,
|
|
34
|
+
leftSize: this.blockRefs[`block${index}`].offsetWidth,
|
|
35
|
+
rightSize: this.blockRefs[`block${index + 1}`].offsetWidth
|
|
36
|
+
});
|
|
37
|
+
document.addEventListener("mousemove", this.handleMouseMove);
|
|
38
|
+
return document.addEventListener("mouseup", this.handleMouseUp);
|
|
39
|
+
};
|
|
40
|
+
handleMouseMove = (ev) => {
|
|
41
|
+
if (!this.state.dragInitialX) {
|
|
42
|
+
this.setState({ dragInitialX: ev.clientX });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let dragXOffset = ev.clientX - this.state.dragInitialX;
|
|
46
|
+
// Can't make left block too small
|
|
47
|
+
if (dragXOffset < -this.state.leftSize + 100) {
|
|
48
|
+
dragXOffset = -this.state.leftSize + 100;
|
|
49
|
+
}
|
|
50
|
+
// Can't make right block too small
|
|
51
|
+
if (dragXOffset > this.state.rightSize - 100) {
|
|
52
|
+
dragXOffset = this.state.rightSize - 100;
|
|
53
|
+
}
|
|
54
|
+
return this.setState({ dragXOffset });
|
|
55
|
+
};
|
|
56
|
+
handleMouseUp = (ev) => {
|
|
57
|
+
// Remove listeners
|
|
58
|
+
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
59
|
+
document.removeEventListener("mouseup", this.handleMouseUp);
|
|
60
|
+
// Determine weights of two blocks
|
|
61
|
+
const weights = this.props.block.weights || [];
|
|
62
|
+
const newLeftSize = this.state.leftSize + this.state.dragXOffset;
|
|
63
|
+
const newRightSize = this.state.rightSize - this.state.dragXOffset;
|
|
64
|
+
// Get current weights
|
|
65
|
+
const leftWeight = weights[this.state.dragIndex] || 1;
|
|
66
|
+
const rightWeight = weights[this.state.dragIndex + 1] || 1;
|
|
67
|
+
weights[this.state.dragIndex] = ((leftWeight + rightWeight) * newLeftSize) / (newLeftSize + newRightSize);
|
|
68
|
+
weights[this.state.dragIndex + 1] = ((leftWeight + rightWeight) * newRightSize) / (newLeftSize + newRightSize);
|
|
69
|
+
const block = lodash_1.default.extend({}, this.props.block, { weights });
|
|
70
|
+
this.props.onBlockUpdate(block);
|
|
71
|
+
return this.setState({ dragIndex: null, dragInitialX: null, dragXOffset: null });
|
|
72
|
+
};
|
|
73
|
+
render() {
|
|
74
|
+
// Handle simple case of collapseColumns (no editing allowed)
|
|
75
|
+
let index, weight;
|
|
76
|
+
let asc, end;
|
|
77
|
+
let asc1, end1;
|
|
78
|
+
if (this.props.collapseColumns) {
|
|
79
|
+
return R("div", null, lodash_1.default.map(this.props.block.blocks, (block, index) => this.props.renderBlock(block, true)));
|
|
80
|
+
}
|
|
81
|
+
// Calculate widths (percentages)
|
|
82
|
+
let totalWeight = 0;
|
|
83
|
+
for (index = 0, end = this.props.block.blocks.length, asc = 0 <= end; asc ? index < end : index > end; asc ? index++ : index--) {
|
|
84
|
+
weight = (this.props.block.weights || [])[index] || 1;
|
|
85
|
+
totalWeight += (this.props.block.weights || [])[index] || 1;
|
|
86
|
+
}
|
|
87
|
+
const percentages = [];
|
|
88
|
+
for (index = 0, end1 = this.props.block.blocks.length, asc1 = 0 <= end1; asc1 ? index < end1 : index > end1; asc1 ? index++ : index--) {
|
|
89
|
+
weight = (this.props.block.weights || [])[index] || 1;
|
|
90
|
+
percentages[index] = (weight * 100) / totalWeight;
|
|
91
|
+
}
|
|
92
|
+
if (this.props.onBlockUpdate != null) {
|
|
93
|
+
let elem = R("table", {
|
|
94
|
+
style: { width: "100%", tableLayout: "fixed", position: "relative", paddingTop: 5 },
|
|
95
|
+
className: "mwater-visualization-horizontal-block"
|
|
96
|
+
}, // Add padding to allow dropping
|
|
97
|
+
R("tbody", null, R("tr", null, lodash_1.default.map(this.props.block.blocks, (block, index) => {
|
|
98
|
+
return [
|
|
99
|
+
index > 0 && this.props.onBlockUpdate != null
|
|
100
|
+
? R("td", {
|
|
101
|
+
style: { width: 5, position: "relative", left: this.state.dragXOffset },
|
|
102
|
+
key: `splitter${index}`,
|
|
103
|
+
className: `mwater-visualization-horizontal-block-splitter ${index - 1 === this.state.dragIndex ? "active" : ""}`,
|
|
104
|
+
onMouseDown: this.handleMouseDown.bind(null, index - 1)
|
|
105
|
+
})
|
|
106
|
+
: undefined,
|
|
107
|
+
R("td", {
|
|
108
|
+
style: { width: `${percentages[index]}%`, verticalAlign: "top" },
|
|
109
|
+
key: block.id,
|
|
110
|
+
ref: (c) => {
|
|
111
|
+
return (this.blockRefs[`block${index}`] = c);
|
|
112
|
+
}
|
|
113
|
+
}, this.props.renderBlock(block))
|
|
114
|
+
];
|
|
115
|
+
}))));
|
|
116
|
+
// Allow dropping
|
|
117
|
+
elem = R(DraggableBlockComponent_1.default, {
|
|
118
|
+
block: this.props.block,
|
|
119
|
+
onBlockDrop: this.props.onBlockDrop
|
|
120
|
+
}, elem);
|
|
121
|
+
return elem;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// Simplify in this case for printing
|
|
125
|
+
return R("div", { className: "mwater-visualization-horizontal-block" }, lodash_1.default.map(this.props.block.blocks, (block, index) => {
|
|
126
|
+
return [
|
|
127
|
+
R("div", {
|
|
128
|
+
style: { width: `${percentages[index]}%`, verticalAlign: "top", display: "inline-block" },
|
|
129
|
+
key: block.id,
|
|
130
|
+
ref: (c) => {
|
|
131
|
+
return (this.blockRefs[`block${index}`] = c);
|
|
132
|
+
},
|
|
133
|
+
className: "mwater-visualization-horizontal-block-item"
|
|
134
|
+
}, this.props.renderBlock(block))
|
|
135
|
+
];
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.default = HorizontalBlockComponent;
|
|
141
|
+
// handleAspectMouseDown: (ev) =>
|
|
142
|
+
// # Get height of overall block
|
|
143
|
+
// @setState(aspectDragY: ev.currentTarget.parentElement.offsetHeight, initialAspectDragY: ev.currentTarget.parentElement.offsetHeight)
|
|
144
|
+
// document.addEventListener("mousemove", @handleMouseMove)
|
|
145
|
+
// document.addEventListener("mouseup", @handleMouseUp)
|
|
146
|
+
// handleMouseMove: (ev) =>
|
|
147
|
+
// if @state.initialClientY?
|
|
148
|
+
// aspectDragY = @state.initialAspectDragY + ev.clientY - @state.initialClientY
|
|
149
|
+
// if aspectDragY > 20
|
|
150
|
+
// @setState(aspectDragY: aspectDragY)
|
|
151
|
+
// else
|
|
152
|
+
// @setState(initialClientY: ev.clientY)
|
|
153
|
+
// handleMouseUp: (ev) =>
|
|
154
|
+
// # Remove listeners
|
|
155
|
+
// document.removeEventListener("mousemove", @handleMouseMove)
|
|
156
|
+
// document.removeEventListener("mouseup", @handleMouseUp)
|
|
157
|
+
// # Fire new aspect ratio
|
|
158
|
+
// @props.onAspectRatioChange(@props.aspectRatio / (@state.aspectDragY / @state.initialAspectDragY))
|
|
159
|
+
// @setState(aspectDragY: null, initialAspectDragY: null, initialClientY: null)
|
|
160
|
+
// renderAspectDrag: ->
|
|
161
|
+
// if @state.aspectDragY?
|
|
162
|
+
// lineStyle = {
|
|
163
|
+
// position: "absolute"
|
|
164
|
+
// borderTop: "solid 3px #38D"
|
|
165
|
+
// top: @state.aspectDragY
|
|
166
|
+
// left: 0
|
|
167
|
+
// right: 0
|
|
168
|
+
// }
|
|
169
|
+
// return R 'div', style: lineStyle, key: "aspectDrag"
|
|
170
|
+
// else
|
|
171
|
+
// return null
|
|
172
|
+
// render: ->
|
|
173
|
+
// elem = R 'div', className: "mwater-visualization-decorated-block", style: @props.style,
|
|
174
|
+
// @props.children
|
|
175
|
+
// @renderAspectDrag()
|
|
176
|
+
// if not @props.isDragging and @props.connectMoveHandle?
|
|
177
|
+
// @props.connectMoveHandle(R 'div', key: "move", className: "mwater-visualization-decorated-block-move",
|
|
178
|
+
// R 'i', className: "fa fa-arrows")
|
|
179
|
+
// if not @props.isDragging and @props.onBlockRemove?
|
|
180
|
+
// R 'div', key: "remove", className: "mwater-visualization-decorated-block-remove", onClick: @props.onBlockRemove,
|
|
181
|
+
// R 'i', className: "fa fa-times"
|
|
182
|
+
// if not @props.isDragging and @props.onAspectRatioChange?
|
|
183
|
+
// # TODO sometimes drags (onDragStart) and so doesn't work. Disable dragging?
|
|
184
|
+
// R 'div', key: "aspect", className: "mwater-visualization-decorated-block-aspect", onMouseDown: @handleAspectMouseDown,
|
|
185
|
+
// R 'i', className: "fa fa-arrows-v"
|
|
186
|
+
// if not @props.isDragging and @props.connectResizeHandle?
|
|
187
|
+
// @props.connectResizeHandle(R 'div', key: "resize", className: "mwater-visualization-decorated-block-resize",
|
|
188
|
+
// R 'i', className: "fa fa-expand fa-rotate-90")
|
|
189
|
+
// if @props.connectDragPreview
|
|
190
|
+
// elem = @props.connectDragPreview(elem)
|
|
191
|
+
// return elem
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface PaletteItemComponentProps {
|
|
3
|
+
/** Create the drag item */
|
|
4
|
+
createItem: any;
|
|
5
|
+
title?: any;
|
|
6
|
+
subtitle?: any;
|
|
7
|
+
}
|
|
8
|
+
export default class PaletteItemComponent extends React.Component<PaletteItemComponentProps> {
|
|
9
|
+
render(): React.CElement<{
|
|
10
|
+
createDragItem: any;
|
|
11
|
+
}, React.Component<{
|
|
12
|
+
createDragItem: any;
|
|
13
|
+
}, any, any>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 react_1 = __importDefault(require("react"));
|
|
7
|
+
const R = react_1.default.createElement;
|
|
8
|
+
const DragSourceComponent = require("../DragSourceComponent").default("visualization-block");
|
|
9
|
+
// Item in a palette that can be dragged to add a widget or other item
|
|
10
|
+
class PaletteItemComponent extends react_1.default.Component {
|
|
11
|
+
render() {
|
|
12
|
+
return R(DragSourceComponent, { createDragItem: this.props.createItem }, R("div", { className: "mwater-visualization-palette-item" }, R("div", { className: "title", key: "title" }, this.props.title), R("div", { className: "subtitle", key: "subtitle" }, this.props.subtitle)));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = PaletteItemComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Layout that does blocks that are stacked vertically or horizontally alternately. That is, first is vertical stack, which can contain horizontal stack, etc.
|
|
2
|
+
|
|
3
|
+
Contents:
|
|
4
|
+
|
|
5
|
+
id: id of block
|
|
6
|
+
type: "root"/"vertical"/"horizontal"/"widget"/"spacer"
|
|
7
|
+
widgetType: if a widget
|
|
8
|
+
aspectRatio: w/h if not autoHeight
|
|
9
|
+
design: widget design
|
|
10
|
+
weights: weights for proportioning horizontal blocks. Default is 1
|
|
11
|
+
blocks: other blocks if not a widget
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Layout that does blocks that are stacked vertically or horizontally
|
|
2
|
+
* alternately. That is, first is vertical stack, which can contain horizontal
|
|
3
|
+
* stack, etc. */
|
|
4
|
+
export interface LayoutBlock {
|
|
5
|
+
/** id of block */
|
|
6
|
+
id: string;
|
|
7
|
+
type: "root" | "vertical" | "horizontal" | "widget" | "spacer";
|
|
8
|
+
/** if a widget */
|
|
9
|
+
widgetType?: string;
|
|
10
|
+
/** w/h if not autoHeight */
|
|
11
|
+
aspectRatio?: number;
|
|
12
|
+
/** widget design */
|
|
13
|
+
design?: any;
|
|
14
|
+
/** weights for proportioning horizontal blocks. Default is 1 */
|
|
15
|
+
weights?: number[];
|
|
16
|
+
/** other blocks if not a widget */
|
|
17
|
+
blocks?: LayoutBlock[];
|
|
18
|
+
}
|
|
19
|
+
export declare function dropBlock(rootBlock: LayoutBlock, sourceBlock: LayoutBlock, targetBlock: LayoutBlock, side: "top" | "left" | "right" | "bottom"): LayoutBlock;
|
|
20
|
+
export declare function updateBlock(rootBlock: LayoutBlock, block: LayoutBlock): LayoutBlock;
|
|
21
|
+
export declare function removeBlock(rootBlock: LayoutBlock, block: LayoutBlock): LayoutBlock | null;
|
|
22
|
+
export declare function cleanBlock(rootBlock: LayoutBlock): LayoutBlock;
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
exports.cleanBlock = exports.removeBlock = exports.updateBlock = exports.dropBlock = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const uuid_1 = __importDefault(require("uuid"));
|
|
9
|
+
// When block is dropped on it. side is top, left, bottom, right)
|
|
10
|
+
// returns new root block
|
|
11
|
+
function dropBlock(rootBlock, sourceBlock, targetBlock, side) {
|
|
12
|
+
// Handle root case, only dropping on bottom
|
|
13
|
+
if (targetBlock.type === "root" && rootBlock.id === targetBlock.id) {
|
|
14
|
+
const blocks = rootBlock.blocks.slice();
|
|
15
|
+
blocks.push(sourceBlock);
|
|
16
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
17
|
+
}
|
|
18
|
+
// If vertical
|
|
19
|
+
if (["vertical", "root"].includes(rootBlock.type)) {
|
|
20
|
+
let blocks = rootBlock.blocks;
|
|
21
|
+
// Find target block
|
|
22
|
+
const index = lodash_1.default.findIndex(blocks, { id: targetBlock.id });
|
|
23
|
+
if (index >= 0) {
|
|
24
|
+
blocks = blocks.slice();
|
|
25
|
+
// Add
|
|
26
|
+
switch (side) {
|
|
27
|
+
case "top":
|
|
28
|
+
blocks.splice(index, 0, sourceBlock);
|
|
29
|
+
break;
|
|
30
|
+
case "bottom":
|
|
31
|
+
blocks.splice(index + 1, 0, sourceBlock);
|
|
32
|
+
break;
|
|
33
|
+
case "left":
|
|
34
|
+
blocks.splice(index, 1, { id: (0, uuid_1.default)(), type: "horizontal", blocks: [sourceBlock, targetBlock] });
|
|
35
|
+
break;
|
|
36
|
+
case "right":
|
|
37
|
+
blocks.splice(index, 1, { id: (0, uuid_1.default)(), type: "horizontal", blocks: [targetBlock, sourceBlock] });
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Recurse
|
|
44
|
+
blocks = lodash_1.default.map(blocks, (block) => dropBlock(block, sourceBlock, targetBlock, side));
|
|
45
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// If horizontal
|
|
49
|
+
if (rootBlock.type === "horizontal") {
|
|
50
|
+
let blocks = rootBlock.blocks;
|
|
51
|
+
// Find target block
|
|
52
|
+
const index = lodash_1.default.findIndex(blocks, { id: targetBlock.id });
|
|
53
|
+
if (index >= 0) {
|
|
54
|
+
blocks = blocks.slice();
|
|
55
|
+
// TODO splice into weights
|
|
56
|
+
// TODO weights as map?
|
|
57
|
+
// Add
|
|
58
|
+
switch (side) {
|
|
59
|
+
case "left":
|
|
60
|
+
blocks.splice(index, 0, sourceBlock);
|
|
61
|
+
break;
|
|
62
|
+
case "right":
|
|
63
|
+
blocks.splice(index + 1, 0, sourceBlock);
|
|
64
|
+
break;
|
|
65
|
+
case "top":
|
|
66
|
+
blocks.splice(index, 1, { id: (0, uuid_1.default)(), type: "vertical", blocks: [sourceBlock, targetBlock] });
|
|
67
|
+
break;
|
|
68
|
+
case "bottom":
|
|
69
|
+
blocks.splice(index, 1, { id: (0, uuid_1.default)(), type: "vertical", blocks: [targetBlock, sourceBlock] });
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Recurse
|
|
76
|
+
blocks = lodash_1.default.map(blocks, (block) => dropBlock(block, sourceBlock, targetBlock, side));
|
|
77
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return rootBlock;
|
|
81
|
+
}
|
|
82
|
+
exports.dropBlock = dropBlock;
|
|
83
|
+
// Updates a block
|
|
84
|
+
// returns new root block
|
|
85
|
+
function updateBlock(rootBlock, block) {
|
|
86
|
+
// If vertical or horizontal
|
|
87
|
+
if (["vertical", "horizontal", "root"].includes(rootBlock.type)) {
|
|
88
|
+
let { blocks } = rootBlock;
|
|
89
|
+
// Update block
|
|
90
|
+
blocks = lodash_1.default.map(blocks, function (b) {
|
|
91
|
+
if (b.id === block.id) {
|
|
92
|
+
return block;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return b;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
// Recurse
|
|
99
|
+
blocks = lodash_1.default.map(blocks, (b) => updateBlock(b, block));
|
|
100
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
101
|
+
}
|
|
102
|
+
return rootBlock;
|
|
103
|
+
}
|
|
104
|
+
exports.updateBlock = updateBlock;
|
|
105
|
+
// When block is removed
|
|
106
|
+
// returns new root block
|
|
107
|
+
function removeBlock(rootBlock, block) {
|
|
108
|
+
// If vertical or horizontal
|
|
109
|
+
if (["vertical", "horizontal", "root"].includes(rootBlock.type)) {
|
|
110
|
+
let blocks = rootBlock.blocks;
|
|
111
|
+
// Remove blocks
|
|
112
|
+
blocks = lodash_1.default.filter(blocks, (b) => b.id !== block.id);
|
|
113
|
+
// TODO remove weight
|
|
114
|
+
// Recurse
|
|
115
|
+
blocks = lodash_1.default.compact(lodash_1.default.map(blocks, (b) => removeBlock(b, block)));
|
|
116
|
+
// If empty and not root, return null
|
|
117
|
+
if (blocks.length === 0 && rootBlock.type !== "root") {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return { ...rootBlock, blocks };
|
|
121
|
+
}
|
|
122
|
+
return rootBlock;
|
|
123
|
+
}
|
|
124
|
+
exports.removeBlock = removeBlock;
|
|
125
|
+
// Clean blocks, simplifying as needed
|
|
126
|
+
function cleanBlock(rootBlock) {
|
|
127
|
+
// If vertical or horizontal
|
|
128
|
+
if (["vertical", "horizontal", "root"].includes(rootBlock.type)) {
|
|
129
|
+
let blocks = rootBlock.blocks;
|
|
130
|
+
// Simplify
|
|
131
|
+
if (blocks.length === 1 && rootBlock.type !== "root") {
|
|
132
|
+
return blocks[0];
|
|
133
|
+
}
|
|
134
|
+
// Simplify nested blocks of same type (e.g. vertical inside root becomes a flat list)
|
|
135
|
+
blocks = lodash_1.default.flatten(lodash_1.default.map(blocks, function (b) {
|
|
136
|
+
if (b.type === "horizontal" && rootBlock.type === "horizontal") {
|
|
137
|
+
return b.blocks;
|
|
138
|
+
}
|
|
139
|
+
if (b.type === "vertical" && ["root", "vertical"].includes(rootBlock.type)) {
|
|
140
|
+
return b.blocks;
|
|
141
|
+
}
|
|
142
|
+
return b;
|
|
143
|
+
}));
|
|
144
|
+
// TODO # Truncate weights
|
|
145
|
+
// weights = null
|
|
146
|
+
// if rootBlock.type == "horizontal" and rootBlock.weights
|
|
147
|
+
// if rootBlock.weights.length > blocks.length
|
|
148
|
+
// weights = _.take(rootBlock.w)
|
|
149
|
+
// Recurse
|
|
150
|
+
blocks = lodash_1.default.map(blocks, (b) => cleanBlock(b));
|
|
151
|
+
return lodash_1.default.extend({}, rootBlock, { blocks });
|
|
152
|
+
}
|
|
153
|
+
return rootBlock;
|
|
154
|
+
}
|
|
155
|
+
exports.cleanBlock = cleanBlock;
|