@mwater/visualization 5.5.0 → 5.6.1
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/ColorComponent.js +2 -2
- package/lib/MWaterContextComponent.d.ts +1 -1
- package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
- package/lib/MWaterGlobalFiltersComponent.js +11 -20
- package/lib/MWaterLoaderComponent.d.ts +4 -13
- package/lib/MWaterLoaderComponent.js +2 -11
- package/lib/TranslationsTabComponent.d.ts +34 -0
- package/lib/TranslationsTabComponent.js +256 -0
- package/lib/UndoStack.d.ts +2 -1
- package/lib/UndoStack.js +12 -6
- package/lib/dashboards/DashboardComponent.js +6 -5
- package/lib/dashboards/DashboardDesign.d.ts +1 -1
- package/lib/dashboards/ServerDashboardDataSource.d.ts +0 -1
- package/lib/dashboards/ServerDashboardDataSource.js +0 -25
- package/lib/dashboards/SettingsModalComponent.js +9 -233
- package/lib/datagrids/DatagridComponent.js +27 -2
- package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
- package/lib/datagrids/DatagridDesignerComponent.js +108 -120
- package/lib/datagrids/DatagridViewComponent.js +33 -6
- 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 +0 -13
- package/lib/maps/BufferLayer.js +24 -237
- package/lib/maps/BufferLayerDesign.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.d.ts +1 -1
- package/lib/maps/BufferLayerDesignerComponent.js +2 -7
- package/lib/maps/ChoroplethLayer.d.ts +1 -16
- package/lib/maps/ChoroplethLayer.js +25 -358
- package/lib/maps/ChoroplethLayerDesign.d.ts +5 -2
- package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -32
- package/lib/maps/ChoroplethLayerDesigner.js +58 -89
- package/lib/maps/ClusterLayer.d.ts +0 -9
- package/lib/maps/ClusterLayer.js +0 -250
- package/lib/maps/DirectMapDataSource.js +1 -48
- package/lib/maps/EditHoverOver.d.ts +4 -3
- package/lib/maps/EditHoverOver.js +3 -3
- package/lib/maps/GridLayer.d.ts +0 -15
- package/lib/maps/GridLayer.js +0 -212
- package/lib/maps/HoverContent.js +1 -1
- package/lib/maps/Layer.d.ts +1 -26
- package/lib/maps/Layer.js +0 -13
- package/lib/maps/LeafletMapComponent.js +10 -19
- package/lib/maps/MapComponent.d.ts +19 -35
- package/lib/maps/MapComponent.js +135 -77
- package/lib/maps/MapControlComponent.d.ts +4 -5
- package/lib/maps/MapControlComponent.js +5 -12
- package/lib/maps/MapDesign.d.ts +8 -0
- package/lib/maps/MapDesignerComponent.d.ts +2 -0
- package/lib/maps/MapDesignerComponent.js +7 -2
- package/lib/maps/MapLayerDataSource.d.ts +0 -4
- package/lib/maps/MapLayerViewDesignerComponent.d.ts +3 -1
- package/lib/maps/MapLayerViewDesignerComponent.js +5 -1
- package/lib/maps/MapLayersDesignerComponent.d.ts +2 -0
- package/lib/maps/MapLayersDesignerComponent.js +2 -1
- package/lib/maps/MapTranslationsTab.d.ts +15 -0
- package/lib/maps/MapTranslationsTab.js +47 -0
- package/lib/maps/MapUtils.d.ts +11 -0
- package/lib/maps/MapUtils.js +57 -1
- package/lib/maps/MapViewComponent.d.ts +1 -1
- package/lib/maps/MapViewComponent.js +1 -8
- package/lib/maps/MarkersLayer.d.ts +1 -14
- package/lib/maps/MarkersLayer.js +89 -254
- package/lib/maps/MarkersLayerDesign.d.ts +5 -1
- package/lib/maps/MarkersLayerDesignerComponent.d.ts +32 -57
- package/lib/maps/MarkersLayerDesignerComponent.js +158 -134
- package/lib/maps/ServerMapDataSource.d.ts +0 -1
- package/lib/maps/ServerMapDataSource.js +0 -25
- package/lib/maps/SwitchableTileUrlLayer.d.ts +0 -2
- package/lib/maps/SwitchableTileUrlLayer.js +0 -9
- package/lib/maps/TileUrlLayer.d.ts +0 -1
- package/lib/maps/TileUrlLayer.js +0 -5
- package/lib/maps/VectorMapViewComponent.js +13 -10
- 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 +6 -6
- package/lib/maps/vectorMaps.js +33 -45
- package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +4 -2
- package/lib/mwater_table_selection/IndicatorsListComponent.js +103 -34
- 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 +26 -0
- package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +237 -51
- package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +2 -2
- package/lib/mwater_table_selection/MWaterTableSelectComponent.js +9 -4
- 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 +6 -3
- 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 +3 -4
- package/src/ColorComponent.tsx +2 -2
- package/src/MWaterContextComponent.tsx +1 -1
- package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
- package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +17 -18
- package/src/TranslationsTabComponent.tsx +429 -0
- package/src/UndoStack.ts +14 -6
- package/src/dashboards/DashboardComponent.tsx +6 -5
- package/src/dashboards/DashboardDesign.ts +1 -1
- package/src/dashboards/ServerDashboardDataSource.ts +0 -31
- package/src/dashboards/SettingsModalComponent.tsx +27 -383
- package/src/datagrids/DatagridComponent.tsx +36 -2
- package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
- package/src/datagrids/DatagridViewComponent.tsx +44 -7
- 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 +30 -263
- package/src/maps/BufferLayerDesign.ts +1 -1
- package/src/maps/BufferLayerDesignerComponent.tsx +2 -7
- package/src/maps/ChoroplethLayer.ts +30 -394
- package/src/maps/ChoroplethLayerDesign.ts +5 -2
- package/src/maps/ChoroplethLayerDesigner.tsx +169 -165
- package/src/maps/ClusterLayer.ts +0 -274
- package/src/maps/DirectMapDataSource.ts +2 -61
- package/src/maps/EditHoverOver.tsx +9 -5
- package/src/maps/GridLayer.ts +0 -224
- package/src/maps/HoverContent.tsx +1 -1
- package/src/maps/Layer.ts +1 -35
- package/src/maps/LeafletMapComponent.tsx +10 -19
- package/src/maps/MapComponent.tsx +448 -0
- package/src/maps/MapControlComponent.tsx +41 -0
- package/src/maps/MapDesign.ts +6 -0
- package/src/maps/MapDesignerComponent.tsx +18 -1
- package/src/maps/MapLayerDataSource.ts +0 -5
- package/src/maps/MapLayerViewDesignerComponent.ts +9 -2
- package/src/maps/MapLayersDesignerComponent.ts +4 -1
- package/src/maps/MapTranslationsTab.tsx +53 -0
- package/src/maps/MapUtils.ts +61 -1
- package/src/maps/MapViewComponent.tsx +2 -8
- package/src/maps/MarkersLayer.ts +101 -275
- package/src/maps/MarkersLayerDesign.ts +7 -1
- package/src/maps/MarkersLayerDesignerComponent.tsx +436 -0
- package/src/maps/ServerMapDataSource.ts +0 -31
- package/src/maps/SwitchableTileUrlLayer.tsx +0 -11
- package/src/maps/TileUrlLayer.tsx +0 -6
- package/src/maps/VectorMapViewComponent.tsx +15 -15
- 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 +32 -53
- package/src/mwater_table_selection/IndicatorsListComponent.tsx +165 -37
- package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
- package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +373 -37
- package/src/mwater_table_selection/MWaterTableSelectComponent.tsx +12 -8
- 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 +11 -1
- 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 -3
- package/.storybook/webpack.config.js +0 -15
- package/src/maps/BingLayer.ts +0 -146
- package/src/maps/MapComponent.ts +0 -312
- package/src/maps/MapControlComponent.ts +0 -46
- package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
- package/src/maps/RasterMapViewComponent.ts +0 -345
- package/src/quickfilter/TextLiteralComponent.ts +0 -165
- 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
|
@@ -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
|
|
|
@@ -502,15 +505,15 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
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() {
|
|
@@ -526,35 +529,36 @@ export default class ChoroplethLayerDesigner extends React.Component<{
|
|
|
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
|
}
|