@mwater/visualization 5.4.5 → 5.6.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/lib/MWaterContextComponent.d.ts +1 -1
- package/lib/MWaterContextComponent.js +1 -1
- package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
- package/lib/MWaterGlobalFiltersComponent.js +11 -20
- package/lib/MWaterLoaderComponent.d.ts +5 -14
- package/lib/MWaterLoaderComponent.js +2 -11
- package/lib/UndoStack.d.ts +2 -1
- package/lib/UndoStack.js +12 -6
- package/lib/dashboards/DashboardComponent.js +7 -5
- package/lib/dashboards/DashboardDesign.d.ts +1 -1
- package/lib/dashboards/LayoutOptionsComponent.js +18 -11
- package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
- package/lib/dashboards/ServerDashboardDataSource.js +29 -10
- package/lib/dashboards/SettingsModalComponent.js +1 -1
- package/lib/dashboards/layoutOptions.d.ts +5 -1
- package/lib/datagrids/DatagridComponent.js +23 -3
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
- package/lib/datagrids/DatagridDesignerComponent.js +108 -120
- package/lib/datagrids/DatagridViewComponent.js +3 -2
- package/lib/datagrids/ExprCellComponent.d.ts +1 -0
- package/lib/datagrids/ExprCellComponent.js +22 -20
- package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
- package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
- package/lib/index.css +45 -2
- package/lib/index.d.ts +5 -5
- package/lib/index.js +2 -3
- package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
- package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
- package/lib/maps/BufferLayer.d.ts +18 -0
- package/lib/maps/BufferLayer.js +36 -14
- package/lib/maps/BufferLayerDesign.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -2
- package/lib/maps/ChoroplethLayer.d.ts +18 -0
- package/lib/maps/ChoroplethLayer.js +46 -25
- package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
- package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
- package/lib/maps/ChoroplethLayerDesigner.js +58 -89
- package/lib/maps/DirectMapDataSource.js +17 -10
- package/lib/maps/EditHoverOver.d.ts +4 -3
- package/lib/maps/EditHoverOver.js +64 -35
- package/lib/maps/HoverContent.d.ts +10 -5
- package/lib/maps/HoverContent.js +7 -36
- package/lib/maps/Layer.d.ts +37 -0
- package/lib/maps/Layer.js +30 -4
- package/lib/maps/LeafletMapComponent.js +10 -19
- package/lib/maps/MWaterServerLayer.d.ts +2 -2
- package/lib/maps/MWaterServerLayer.js +6 -6
- package/lib/maps/MapComponent.js +0 -1
- package/lib/maps/MapLayerDataSource.d.ts +9 -0
- package/lib/maps/MapUtils.d.ts +19 -1
- package/lib/maps/MapUtils.js +80 -1
- package/lib/maps/MarkersLayer.d.ts +18 -0
- package/lib/maps/MarkersLayer.js +42 -26
- package/lib/maps/MarkersLayerDesign.d.ts +1 -1
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
- package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
- package/lib/maps/RasterMapViewComponent.js +1 -1
- package/lib/maps/ServerMapDataSource.d.ts +9 -0
- package/lib/maps/ServerMapDataSource.js +29 -10
- package/lib/maps/VectorMapViewComponent.js +7 -15
- package/lib/maps/maps.d.ts +4 -2
- 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-rain.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/symbols/sdf-ize.sh +93 -0
- package/lib/maps/vectorMaps.d.ts +1 -0
- package/lib/maps/vectorMaps.js +20 -36
- package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
- package/lib/mwater_table_selection/FormsListComponent.js +141 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
- package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
- package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
- package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
- package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
- package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
- package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
- package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
- package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
- package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
- package/lib/quickfilter/QuickfiltersComponent.js +53 -110
- package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
- package/lib/quickfilter/TextLiteralComponent.js +85 -82
- package/lib/widgets/MapWidget.js +4 -2
- package/lib/widgets/charts/Chart.d.ts +11 -0
- package/lib/widgets/charts/Chart.js +15 -0
- package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
- package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
- package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
- package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
- package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
- package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
- package/lib/widgets/charts/pivot/PivotChart.js +156 -0
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
- package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
- package/lib/widgets/charts/table/TableChart.d.ts +2 -0
- package/lib/widgets/charts/table/TableChart.js +172 -1
- package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
- package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
- package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
- package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
- package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
- package/package.json +4 -10
- package/src/MWaterContextComponent.tsx +2 -2
- package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
- package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
- package/src/UndoStack.ts +14 -6
- package/src/dashboards/DashboardComponent.tsx +7 -5
- package/src/dashboards/DashboardDesign.ts +1 -1
- package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
- package/src/dashboards/ServerDashboardDataSource.ts +36 -13
- package/src/dashboards/SettingsModalComponent.tsx +1 -1
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.tsx +31 -3
- package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
- package/src/datagrids/DatagridViewComponent.tsx +3 -2
- package/src/datagrids/ExprCellComponent.tsx +23 -20
- package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
- package/src/index.css +45 -2
- package/src/index.ts +5 -11
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
- package/src/maps/BufferLayer.ts +48 -20
- package/src/maps/BufferLayerDesign.ts +1 -1
- package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
- package/src/maps/ChoroplethLayer.ts +70 -39
- package/src/maps/ChoroplethLayerDesign.ts +6 -2
- package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
- package/src/maps/DirectMapDataSource.ts +21 -13
- package/src/maps/EditHoverOver.tsx +98 -54
- package/src/maps/HoverContent.tsx +17 -48
- package/src/maps/Layer.ts +42 -4
- package/src/maps/LeafletMapComponent.tsx +10 -19
- package/src/maps/MWaterServerLayer.ts +6 -6
- package/src/maps/MapComponent.ts +0 -1
- package/src/maps/MapLayerDataSource.ts +8 -0
- package/src/maps/MapUtils.ts +82 -3
- package/src/maps/MarkersLayer.ts +54 -27
- package/src/maps/MarkersLayerDesign.ts +1 -1
- package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
- package/src/maps/RasterMapViewComponent.ts +1 -1
- package/src/maps/ServerMapDataSource.ts +35 -12
- package/src/maps/VectorMapViewComponent.tsx +8 -19
- package/src/maps/maps.ts +4 -2
- 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-rain.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/symbols/sdf-ize.sh +93 -0
- package/src/maps/vectorMaps.tsx +20 -44
- package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
- package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
- package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
- package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
- package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
- package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
- package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
- package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
- package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
- package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
- package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
- package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
- package/src/quickfilter/TextLiteralComponent.tsx +197 -0
- package/src/widgets/MapWidget.tsx +9 -1
- package/src/widgets/charts/Chart.ts +17 -0
- package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
- package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
- package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
- package/src/widgets/charts/pivot/PivotChart.ts +191 -0
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
- package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
- package/src/widgets/charts/table/TableChart.ts +177 -1
- package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
- package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
- package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
- package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
- package/test/UndoStackTests.ts +52 -1
- package/.storybook/config.js +0 -7
- package/.storybook/head.html +0 -4
- package/.storybook/webpack.config.js +0 -15
- package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
- package/src/maps/BingLayer.ts +0 -146
- package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
- package/src/quickfilter/TextLiteralComponent.ts +0 -165
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
- package/stories/UpdateableComponent.js +0 -29
- package/stories/consoles.js +0 -202
- package/stories/dashboards.js +0 -217
- package/stories/datagridDesign.js +0 -114
- package/stories/datagrids.js +0 -69
- package/stories/dates.js +0 -80
- package/stories/exprcomponent.js +0 -43
- package/stories/index.js +0 -18
- package/stories/leaflet.js +0 -59
- package/stories/maps.js +0 -24
- package/stories/pivotChart.js +0 -235
|
@@ -29,6 +29,7 @@ import { getDefaultLayoutOptions } from "../dashboards/layoutOptions"
|
|
|
29
29
|
import Widget from "../widgets/Widget"
|
|
30
30
|
import BlocksLayoutManager from "../layouts/blocks/BlocksLayoutManager"
|
|
31
31
|
import { getTranslatableStringsFromLayoutManager } from "../dashboards/DashboardUtils"
|
|
32
|
+
import { getSimpleHoverOverData } from "./MapUtils"
|
|
32
33
|
|
|
33
34
|
export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
34
35
|
/** Gets the type of layer definition */
|
|
@@ -913,7 +914,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
913
914
|
|
|
914
915
|
// Scope overall
|
|
915
916
|
if (design.scope) {
|
|
916
|
-
;(query.where as JsonQLOp).exprs.push({
|
|
917
|
+
; (query.where as JsonQLOp).exprs.push({
|
|
917
918
|
type: "op",
|
|
918
919
|
op: "=",
|
|
919
920
|
exprs: [
|
|
@@ -926,7 +927,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
926
927
|
// Add filters on regions to outer query
|
|
927
928
|
for (const filter of filters) {
|
|
928
929
|
if (filter.table == regionsTable) {
|
|
929
|
-
;(query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions"))
|
|
930
|
+
; (query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions"))
|
|
930
931
|
}
|
|
931
932
|
}
|
|
932
933
|
|
|
@@ -1061,7 +1062,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1061
1062
|
|
|
1062
1063
|
// Scope overall
|
|
1063
1064
|
if (design.scope) {
|
|
1064
|
-
;(query.where as JsonQLOp).exprs.push({
|
|
1065
|
+
; (query.where as JsonQLOp).exprs.push({
|
|
1065
1066
|
type: "op",
|
|
1066
1067
|
op: "=",
|
|
1067
1068
|
exprs: [
|
|
@@ -1074,7 +1075,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1074
1075
|
// Add filters on regions to outer query
|
|
1075
1076
|
for (const filter of filters) {
|
|
1076
1077
|
if (filter.table == regionsTable) {
|
|
1077
|
-
;(query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions2"))
|
|
1078
|
+
; (query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions2"))
|
|
1078
1079
|
}
|
|
1079
1080
|
}
|
|
1080
1081
|
|
|
@@ -1147,7 +1148,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1147
1148
|
|
|
1148
1149
|
// Scope overall
|
|
1149
1150
|
if (design.scope) {
|
|
1150
|
-
;(query.where as JsonQLOp).exprs.push({
|
|
1151
|
+
; (query.where as JsonQLOp).exprs.push({
|
|
1151
1152
|
type: "op",
|
|
1152
1153
|
op: "=",
|
|
1153
1154
|
exprs: [
|
|
@@ -1160,7 +1161,7 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1160
1161
|
// Add filters on regions to outer query
|
|
1161
1162
|
for (const filter of filters) {
|
|
1162
1163
|
if (filter.table == regionsTable) {
|
|
1163
|
-
;(query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions"))
|
|
1164
|
+
; (query.where as JsonQLOp).exprs.push(injectTableAlias(filter.jsonql, "regions"))
|
|
1164
1165
|
}
|
|
1165
1166
|
}
|
|
1166
1167
|
|
|
@@ -1377,13 +1378,9 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1377
1378
|
ev: { data: any; event: any },
|
|
1378
1379
|
hoverOptions: OnGridHoverOptions<ChoroplethLayerDesign>
|
|
1379
1380
|
): OnGridHoverResults {
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
if (hoverOptions.design.regionMode == "plain" || hoverOptions.design.regionMode == "direct") {
|
|
1384
|
-
if (!ev.data || !ev.data.id) {
|
|
1385
|
-
return null
|
|
1386
|
-
}
|
|
1381
|
+
// Only applicable to indirect mode
|
|
1382
|
+
if (hoverOptions.design.regionMode !== "indirect") {
|
|
1383
|
+
return null
|
|
1387
1384
|
}
|
|
1388
1385
|
|
|
1389
1386
|
// Ignore if indirect with no table
|
|
@@ -1391,35 +1388,16 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1391
1388
|
return null
|
|
1392
1389
|
}
|
|
1393
1390
|
|
|
1394
|
-
if (ev.data && ev.data.id) {
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
// Popup
|
|
1399
|
-
if (hoverOptions.design.hoverOver) {
|
|
1400
|
-
// Create default popup filter joins
|
|
1401
|
-
const defaultPopupFilterJoins: { [tableId: string]: Expr } = {}
|
|
1402
|
-
if (hoverOptions.design.adminRegionExpr) {
|
|
1403
|
-
defaultPopupFilterJoins[hoverOptions.design.table] = hoverOptions.design.adminRegionExpr
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
// Create filter using popupFilterJoins
|
|
1407
|
-
const popupFilterJoins = hoverOptions.design.popupFilterJoins || defaultPopupFilterJoins
|
|
1408
|
-
const popupFilters = PopupFilterJoinsUtils.createPopupFilters(
|
|
1409
|
-
popupFilterJoins,
|
|
1410
|
-
hoverOptions.schema,
|
|
1411
|
-
table,
|
|
1412
|
-
ev.data.id,
|
|
1413
|
-
true
|
|
1414
|
-
)
|
|
1415
|
-
|
|
1416
|
-
results.hoverOver = React.createElement(HoverContent, {
|
|
1391
|
+
if (ev.data && ev.data.id && hoverOptions.design.hoverOver && hoverOptions.design.hoverOver.items.length > 0) {
|
|
1392
|
+
const results: OnGridHoverResults = {
|
|
1393
|
+
hoverOver: React.createElement(HoverContent, {
|
|
1417
1394
|
key: ev.data.id,
|
|
1418
1395
|
schema: hoverOptions.schema,
|
|
1419
|
-
|
|
1420
|
-
|
|
1396
|
+
mapLayerDataSource: hoverOptions.layerDataSource,
|
|
1397
|
+
design: hoverOptions.design,
|
|
1421
1398
|
items: hoverOptions.design.hoverOver.items,
|
|
1422
|
-
|
|
1399
|
+
data: ev.data,
|
|
1400
|
+
filters: hoverOptions.filters,
|
|
1423
1401
|
locale: hoverOptions.locale,
|
|
1424
1402
|
translate: hoverOptions.translate
|
|
1425
1403
|
})
|
|
@@ -1622,6 +1600,19 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1622
1600
|
delete draft.filter
|
|
1623
1601
|
}
|
|
1624
1602
|
|
|
1603
|
+
// Clean hover over expressions only for indirect mode with a valid table
|
|
1604
|
+
if (design.table && design.regionMode === "indirect" && design.hoverOver && design.hoverOver.items) {
|
|
1605
|
+
for (let i = 0; i < design.hoverOver.items.length; i++) {
|
|
1606
|
+
const item = design.hoverOver.items[i]
|
|
1607
|
+
if (item.value) {
|
|
1608
|
+
draft.hoverOver!.items[i].value = exprCleaner.cleanExpr(item.value || null, {
|
|
1609
|
+
table: design.table,
|
|
1610
|
+
aggrStatuses: ["individual", "literal", "aggregate"]
|
|
1611
|
+
})
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1625
1616
|
if (design.detailLevel == null) {
|
|
1626
1617
|
draft.detailLevel = 0
|
|
1627
1618
|
}
|
|
@@ -1731,4 +1722,44 @@ export default class ChoroplethLayer extends Layer<ChoroplethLayerDesign> {
|
|
|
1731
1722
|
// Remove duplicates
|
|
1732
1723
|
return _.uniq(strings)
|
|
1733
1724
|
}
|
|
1725
|
+
|
|
1726
|
+
/** Gets hover over data for hover over items. This should be implemented by layers that have hover over items.
|
|
1727
|
+
* It will be called on the server side if using a server map data source, or on the client side if using a direct
|
|
1728
|
+
* map data source.
|
|
1729
|
+
*/
|
|
1730
|
+
getHoverOverData(options: {
|
|
1731
|
+
/** Design of the layer */
|
|
1732
|
+
design: ChoroplethLayerDesign,
|
|
1733
|
+
/** Data of the current item being hovered over. e.g. { id: 123 } */
|
|
1734
|
+
data: any,
|
|
1735
|
+
/** Filters to apply to the hover over data, not including filtering down to the current item */
|
|
1736
|
+
filters: JsonQLFilter[],
|
|
1737
|
+
/** Schema to use */
|
|
1738
|
+
schema: Schema,
|
|
1739
|
+
/** Data source to use */
|
|
1740
|
+
dataSource: DataSource,
|
|
1741
|
+
}): Promise<{ [key: string]: any }> {
|
|
1742
|
+
// Use popup filter joins utilities to create filters
|
|
1743
|
+
const popupFilterJoins: { [tableId: string]: Expr } = {}
|
|
1744
|
+
if (options.design.adminRegionExpr) {
|
|
1745
|
+
popupFilterJoins[options.design.table!] = options.design.adminRegionExpr
|
|
1746
|
+
}
|
|
1747
|
+
const popupFilters = PopupFilterJoinsUtils.createPopupFilters(
|
|
1748
|
+
popupFilterJoins,
|
|
1749
|
+
options.schema,
|
|
1750
|
+
options.design.table!,
|
|
1751
|
+
options.data.id,
|
|
1752
|
+
true
|
|
1753
|
+
)
|
|
1754
|
+
|
|
1755
|
+
return getSimpleHoverOverData({
|
|
1756
|
+
// Filter using popup filters instead of id since will return multiple rows
|
|
1757
|
+
id: null,
|
|
1758
|
+
table: options.design.table!,
|
|
1759
|
+
filters: popupFilters,
|
|
1760
|
+
schema: options.schema,
|
|
1761
|
+
dataSource: options.dataSource,
|
|
1762
|
+
hoverOverItems: options.design.hoverOver!.items,
|
|
1763
|
+
})
|
|
1764
|
+
}
|
|
1734
1765
|
}
|
|
@@ -62,11 +62,15 @@ export default interface ChoroplethLayerDesign {
|
|
|
62
62
|
/** contains items: which is BlocksLayoutManager items. Will be displayed when the region is clicked. Only when region mode is "indirect" */
|
|
63
63
|
popup: { items: LayoutBlock }
|
|
64
64
|
|
|
65
|
-
hoverOver: { items: HoverOverItem[] }
|
|
66
|
-
|
|
67
65
|
/** customizable filtering for popup. See PopupFilterJoins.md. Only when region mode is "indirect" */
|
|
68
66
|
popupFilterJoins: PopupFilterJoins
|
|
69
67
|
|
|
68
|
+
/** Hover over items to display when hovering over a region. Only when region mode is "indirect".
|
|
69
|
+
* This is an aggregate hover over, but can contain individual items. If so, only the first row
|
|
70
|
+
* of the resulting query will be displayed.
|
|
71
|
+
*/
|
|
72
|
+
hoverOver?: { items: HoverOverItem[] }
|
|
73
|
+
|
|
70
74
|
/** minimum zoom level */
|
|
71
75
|
minZoom?: number
|
|
72
76
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import _ from "lodash"
|
|
2
2
|
import React from "react"
|
|
3
|
-
const R = React.createElement
|
|
4
3
|
import { produce } from "immer"
|
|
5
4
|
|
|
6
5
|
import { ExprComponent, FilterExprComponent } from "@mwater/expressions-ui"
|
|
7
|
-
import { ExprCompiler, Schema, DataSource, Expr, OpExpr } from "@mwater/expressions"
|
|
6
|
+
import { ExprCompiler, Schema, DataSource, Expr, OpExpr, ExprUtils } from "@mwater/expressions"
|
|
8
7
|
import AxisComponent from "./../axes/AxisComponent"
|
|
9
8
|
import { TableSelectComponent } from "@mwater/expressions-ui"
|
|
10
9
|
import ColorComponent from "../ColorComponent"
|
|
@@ -18,7 +17,7 @@ import { Axis } from "../axes/Axis"
|
|
|
18
17
|
|
|
19
18
|
import AdminScopeAndDetailLevelComponent from "./AdminScopeAndDetailLevelComponent"
|
|
20
19
|
import ScopeAndDetailLevelComponent from "./ScopeAndDetailLevelComponent"
|
|
21
|
-
import EditHoverOver from "./EditHoverOver"
|
|
20
|
+
import { EditHoverOver } from "./EditHoverOver"
|
|
22
21
|
|
|
23
22
|
// Designer for a choropleth layer
|
|
24
23
|
export default class ChoroplethLayerDesigner extends React.Component<{
|
|
@@ -188,9 +187,10 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
renderRegionsTable() {
|
|
190
|
+
// Regions tables are either "regions." or "regions_<name>" with a shape column
|
|
191
191
|
let options = _.map(
|
|
192
|
-
_.filter(this.props.schema.getTables(), table => table.id.startsWith("regions.")),
|
|
193
|
-
table => ({ value: table.id, label: table.name
|
|
192
|
+
_.filter(this.props.schema.getTables(), table => table.id.startsWith("regions.") || (table.id.startsWith("regions_") && this.props.schema.getColumn(table.id, "shape") != null)),
|
|
193
|
+
table => ({ value: table.id, label: ExprUtils.localizeString(table.name) })
|
|
194
194
|
)
|
|
195
195
|
|
|
196
196
|
const regionsTable = this.props.design.regionsTable || "admin_regions"
|
|
@@ -253,34 +253,34 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
253
253
|
const regionsTable = this.props.design.regionsTable || "admin_regions"
|
|
254
254
|
|
|
255
255
|
if (regionsTable === "admin_regions") {
|
|
256
|
-
return
|
|
257
|
-
schema
|
|
258
|
-
dataSource
|
|
259
|
-
scope
|
|
260
|
-
scopeLevel
|
|
261
|
-
detailLevel
|
|
262
|
-
onScopeAndDetailLevelChange
|
|
263
|
-
|
|
256
|
+
return <AdminScopeAndDetailLevelComponent
|
|
257
|
+
schema={this.props.schema}
|
|
258
|
+
dataSource={this.props.dataSource}
|
|
259
|
+
scope={this.props.design.scope as number | undefined}
|
|
260
|
+
scopeLevel={this.props.design.scopeLevel || 0}
|
|
261
|
+
detailLevel={this.props.design.detailLevel}
|
|
262
|
+
onScopeAndDetailLevelChange={this.handleScopeAndDetailLevelChange}
|
|
263
|
+
/>
|
|
264
264
|
} else {
|
|
265
|
-
return
|
|
266
|
-
schema
|
|
267
|
-
dataSource
|
|
268
|
-
scope
|
|
269
|
-
scopeLevel
|
|
270
|
-
detailLevel
|
|
271
|
-
onScopeAndDetailLevelChange
|
|
272
|
-
regionsTable
|
|
273
|
-
|
|
265
|
+
return <ScopeAndDetailLevelComponent
|
|
266
|
+
schema={this.props.schema}
|
|
267
|
+
dataSource={this.props.dataSource}
|
|
268
|
+
scope={this.props.design.scope as string | undefined}
|
|
269
|
+
scopeLevel={this.props.design.scopeLevel}
|
|
270
|
+
detailLevel={this.props.design.detailLevel}
|
|
271
|
+
onScopeAndDetailLevelChange={this.handleScopeAndDetailLevelChange}
|
|
272
|
+
regionsTable={regionsTable}
|
|
273
|
+
/>
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
renderDisplayNames() {
|
|
278
|
-
return
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
</
|
|
278
|
+
return (
|
|
279
|
+
<div className="mb-3">
|
|
280
|
+
<ui.Checkbox value={this.props.design.displayNames} onChange={value => this.handleDisplayNamesChange(value)}>
|
|
281
|
+
{T`Display Region Names`}
|
|
282
|
+
</ui.Checkbox>
|
|
283
|
+
</div>
|
|
284
284
|
)
|
|
285
285
|
}
|
|
286
286
|
|
|
@@ -290,19 +290,20 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
290
290
|
return null
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
293
|
+
return (
|
|
294
|
+
<div className="mb-3">
|
|
295
|
+
<label className="text-muted">
|
|
296
|
+
<span className="fas fa-tint" />
|
|
297
|
+
{T`Fill Color`}
|
|
298
|
+
</label>
|
|
299
|
+
|
|
300
|
+
<div>
|
|
301
|
+
<ColorComponent
|
|
302
|
+
color={this.props.design.color}
|
|
303
|
+
onChange={this.handleColorChange}
|
|
304
|
+
/>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
306
307
|
)
|
|
307
308
|
}
|
|
308
309
|
|
|
@@ -328,28 +329,29 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
328
329
|
|
|
329
330
|
const table = this.props.design.table
|
|
330
331
|
|
|
331
|
-
return
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
332
|
+
return (
|
|
333
|
+
<div>
|
|
334
|
+
<div className="mb-3">
|
|
335
|
+
<label className="text-muted">
|
|
336
|
+
<span className="fas fa-tint" />
|
|
337
|
+
{T`Color By Data`}
|
|
338
|
+
</label>
|
|
339
|
+
|
|
340
|
+
<AxisComponent
|
|
341
|
+
schema={this.props.schema}
|
|
342
|
+
dataSource={this.props.dataSource}
|
|
343
|
+
table={this.props.design.table}
|
|
344
|
+
types={["text", "enum", "boolean", "date"]}
|
|
345
|
+
aggrNeed="required"
|
|
346
|
+
value={this.props.design.axes.color}
|
|
347
|
+
defaultColor={this.props.design.color}
|
|
348
|
+
showColorMap={true}
|
|
349
|
+
onChange={this.handleColorAxisChange}
|
|
350
|
+
allowExcludedValues={true}
|
|
351
|
+
filters={filters}
|
|
352
|
+
/>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
353
355
|
)
|
|
354
356
|
} else {
|
|
355
357
|
// direct mode
|
|
@@ -380,28 +382,29 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
380
382
|
})
|
|
381
383
|
}
|
|
382
384
|
|
|
383
|
-
return
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
385
|
+
return (
|
|
386
|
+
<div>
|
|
387
|
+
<div className="mb-3">
|
|
388
|
+
<label className="text-muted">
|
|
389
|
+
<span className="fas fa-tint" />
|
|
390
|
+
{T`Color By Data`}
|
|
391
|
+
</label>
|
|
392
|
+
|
|
393
|
+
<AxisComponent
|
|
394
|
+
schema={this.props.schema}
|
|
395
|
+
dataSource={this.props.dataSource}
|
|
396
|
+
table={regionsTable}
|
|
397
|
+
types={["text", "enum", "boolean", "date"]}
|
|
398
|
+
aggrNeed="none"
|
|
399
|
+
value={this.props.design.axes.color}
|
|
400
|
+
defaultColor={this.props.design.color}
|
|
401
|
+
showColorMap={true}
|
|
402
|
+
onChange={this.handleColorAxisChange}
|
|
403
|
+
allowExcludedValues={true}
|
|
404
|
+
filters={filters}
|
|
405
|
+
/>
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
405
408
|
)
|
|
406
409
|
}
|
|
407
410
|
}
|
|
@@ -428,40 +431,39 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
428
431
|
// onChange: @handleColorAxisChange)
|
|
429
432
|
|
|
430
433
|
renderFillOpacity() {
|
|
431
|
-
return
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
{
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
onChange: (val: number) => this.handleFillOpacityChange(Math.sqrt(val / 100))
|
|
447
|
-
})
|
|
434
|
+
return (
|
|
435
|
+
<div className="mb-3">
|
|
436
|
+
<label className="text-muted">
|
|
437
|
+
{T`Fill Opacity: ${(this.props.design.fillOpacity * this.props.design.fillOpacity * 100).toFixed(0)}%`}
|
|
438
|
+
</label>
|
|
439
|
+
{": "}
|
|
440
|
+
<Rcslider
|
|
441
|
+
min={0}
|
|
442
|
+
max={100}
|
|
443
|
+
step={1}
|
|
444
|
+
tipTransitionName="rc-slider-tooltip-zoom-down"
|
|
445
|
+
value={Math.round(this.props.design.fillOpacity * this.props.design.fillOpacity * 100)}
|
|
446
|
+
onChange={(val: number) => this.handleFillOpacityChange(Math.sqrt(val / 100))}
|
|
447
|
+
/>
|
|
448
|
+
</div>
|
|
448
449
|
)
|
|
449
450
|
}
|
|
450
451
|
|
|
451
452
|
renderBorderColor() {
|
|
452
|
-
return
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
453
|
+
return (
|
|
454
|
+
<div className="mb-3">
|
|
455
|
+
<label className="text-muted">
|
|
456
|
+
<span className="fas fa-tint" />
|
|
457
|
+
{T`Border Color`}
|
|
458
|
+
</label>
|
|
459
|
+
|
|
460
|
+
<div>
|
|
461
|
+
<ColorComponent
|
|
462
|
+
color={this.props.design.borderColor || "#000"}
|
|
463
|
+
onChange={this.handleBorderColorChange}
|
|
464
|
+
/>
|
|
465
|
+
</div>
|
|
466
|
+
</div>
|
|
465
467
|
)
|
|
466
468
|
}
|
|
467
469
|
|
|
@@ -471,21 +473,22 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
471
473
|
return null
|
|
472
474
|
}
|
|
473
475
|
|
|
474
|
-
return
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
476
|
+
return (
|
|
477
|
+
<div className="mb-3">
|
|
478
|
+
<label className="text-muted">
|
|
479
|
+
<span className="fas fa-filter" />
|
|
480
|
+
{T`Filters`}
|
|
481
|
+
</label>
|
|
482
|
+
<div style={{ marginLeft: 8 }}>
|
|
483
|
+
<FilterExprComponent
|
|
484
|
+
schema={this.props.schema}
|
|
485
|
+
dataSource={this.props.dataSource}
|
|
486
|
+
onChange={this.handleFilterChange}
|
|
487
|
+
table={this.props.design.table}
|
|
488
|
+
value={this.props.design.filter}
|
|
489
|
+
/>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
489
492
|
)
|
|
490
493
|
}
|
|
491
494
|
|
|
@@ -497,20 +500,20 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
497
500
|
|
|
498
501
|
const regionsTable = this.props.design.regionsTable || "admin_regions"
|
|
499
502
|
|
|
500
|
-
const defaultPopupFilterJoins = {}
|
|
503
|
+
const defaultPopupFilterJoins: { [tableId: string]: Expr } = {}
|
|
501
504
|
if (this.props.design.adminRegionExpr) {
|
|
502
505
|
defaultPopupFilterJoins[this.props.design.table] = this.props.design.adminRegionExpr
|
|
503
506
|
}
|
|
504
507
|
|
|
505
|
-
return
|
|
506
|
-
design
|
|
507
|
-
onDesignChange
|
|
508
|
-
schema
|
|
509
|
-
dataSource
|
|
510
|
-
table
|
|
511
|
-
idTable
|
|
512
|
-
defaultPopupFilterJoins
|
|
513
|
-
|
|
508
|
+
return <EditPopupComponent
|
|
509
|
+
design={this.props.design}
|
|
510
|
+
onDesignChange={this.props.onDesignChange}
|
|
511
|
+
schema={this.props.schema}
|
|
512
|
+
dataSource={this.props.dataSource}
|
|
513
|
+
table={this.props.design.table}
|
|
514
|
+
idTable={regionsTable}
|
|
515
|
+
defaultPopupFilterJoins={defaultPopupFilterJoins}
|
|
516
|
+
/>
|
|
514
517
|
}
|
|
515
518
|
|
|
516
519
|
renderHoverOver() {
|
|
@@ -521,40 +524,41 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
521
524
|
|
|
522
525
|
const regionsTable = this.props.design.regionsTable || "admin_regions"
|
|
523
526
|
|
|
524
|
-
const defaultPopupFilterJoins = {}
|
|
527
|
+
const defaultPopupFilterJoins: { [tableId: string]: Expr } = {}
|
|
525
528
|
if (this.props.design.adminRegionExpr) {
|
|
526
529
|
defaultPopupFilterJoins[this.props.design.table] = this.props.design.adminRegionExpr
|
|
527
530
|
}
|
|
528
531
|
|
|
529
|
-
return
|
|
530
|
-
design
|
|
531
|
-
onDesignChange
|
|
532
|
-
schema
|
|
533
|
-
dataSource
|
|
534
|
-
table
|
|
535
|
-
idTable
|
|
536
|
-
defaultPopupFilterJoins
|
|
537
|
-
|
|
532
|
+
return <EditHoverOver
|
|
533
|
+
design={this.props.design}
|
|
534
|
+
onDesignChange={this.props.onDesignChange}
|
|
535
|
+
schema={this.props.schema}
|
|
536
|
+
dataSource={this.props.dataSource}
|
|
537
|
+
table={this.props.design.table}
|
|
538
|
+
idTable={regionsTable}
|
|
539
|
+
defaultPopupFilterJoins={defaultPopupFilterJoins}
|
|
540
|
+
aggrStatuses={["individual", "aggregate", "literal"]}
|
|
541
|
+
/>
|
|
538
542
|
}
|
|
539
543
|
|
|
540
544
|
render() {
|
|
541
|
-
return
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
545
|
+
return (
|
|
546
|
+
<div>
|
|
547
|
+
{this.renderRegionMode()}
|
|
548
|
+
{this.renderRegionsTable()}
|
|
549
|
+
{this.renderTable()}
|
|
550
|
+
{this.renderAdminRegionExpr()}
|
|
551
|
+
{this.renderScopeAndDetailLevel()}
|
|
552
|
+
{this.renderDisplayNames()}
|
|
553
|
+
{this.renderColor()}
|
|
554
|
+
{this.renderColorAxis()}
|
|
555
|
+
{this.renderFillOpacity()}
|
|
556
|
+
{this.renderBorderColor()}
|
|
557
|
+
{this.renderFilter()}
|
|
558
|
+
{this.renderPopup()}
|
|
559
|
+
{this.renderHoverOver()}
|
|
560
|
+
<ZoomLevelsComponent design={this.props.design} onDesignChange={this.props.onDesignChange} />
|
|
561
|
+
</div>
|
|
558
562
|
)
|
|
559
563
|
}
|
|
560
564
|
}
|