@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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# https://stackoverflow.com/questions/63299999/how-can-i-create-sdf-icons-used-in-mapbox-from-png#63314688
|
|
5
|
+
|
|
6
|
+
set -o pipefail
|
|
7
|
+
set -exu
|
|
8
|
+
|
|
9
|
+
cd "$(dirname "$0")"
|
|
10
|
+
|
|
11
|
+
MKTEMP="$(which gmktemp || which mktemp)"
|
|
12
|
+
TMPDIR1="$("$MKTEMP" -d)"
|
|
13
|
+
TMPDIR2="$("$MKTEMP" -d)"
|
|
14
|
+
|
|
15
|
+
trap "rm -rf '$TMPDIR1' '$TMPDIR2' ; pkill -P '$$'" EXIT
|
|
16
|
+
|
|
17
|
+
declare -a IMGFILES
|
|
18
|
+
|
|
19
|
+
IMGFILES=(
|
|
20
|
+
asterisk.png
|
|
21
|
+
ban.png
|
|
22
|
+
beer.png
|
|
23
|
+
bell.png
|
|
24
|
+
bolt.png
|
|
25
|
+
building.png
|
|
26
|
+
bullseye.png
|
|
27
|
+
bus.png
|
|
28
|
+
caret-up.png
|
|
29
|
+
certificate.png
|
|
30
|
+
check-circle.png
|
|
31
|
+
check.png
|
|
32
|
+
chevron-circle-down.png
|
|
33
|
+
chevron-circle-up.png
|
|
34
|
+
cloud-rain.png
|
|
35
|
+
cloud.png
|
|
36
|
+
comment.png
|
|
37
|
+
crosshairs.png
|
|
38
|
+
dot-circle-o.png
|
|
39
|
+
exclamation-circle.png
|
|
40
|
+
exclamation-triangle.png
|
|
41
|
+
female.png
|
|
42
|
+
file.png
|
|
43
|
+
flag.png
|
|
44
|
+
flask.png
|
|
45
|
+
h-square.png
|
|
46
|
+
home.png
|
|
47
|
+
info-circle.png
|
|
48
|
+
male.png
|
|
49
|
+
medkit.png
|
|
50
|
+
mobile.png
|
|
51
|
+
plus-circle.png
|
|
52
|
+
plus-square.png
|
|
53
|
+
plus.png
|
|
54
|
+
square.png
|
|
55
|
+
star.png
|
|
56
|
+
thumbs-down.png
|
|
57
|
+
thumbs-up.png
|
|
58
|
+
ticket.png
|
|
59
|
+
times-circle.png
|
|
60
|
+
times.png
|
|
61
|
+
tint.png
|
|
62
|
+
tree.png
|
|
63
|
+
university.png
|
|
64
|
+
usd.png
|
|
65
|
+
user.png
|
|
66
|
+
users.png
|
|
67
|
+
wheelchair.png
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
SVGINDIR="$(realpath -e "../../../../../apps/mwater-server/lib/routes/maps/marker-symbols/font-awesome")"
|
|
71
|
+
PNGOUTDIR="$(realpath "./font-awesome")"
|
|
72
|
+
|
|
73
|
+
rm -rvf "$PNGOUTDIR"
|
|
74
|
+
mkdir -pv "$PNGOUTDIR"
|
|
75
|
+
|
|
76
|
+
which image-sdf || npm install -g image-sdf
|
|
77
|
+
|
|
78
|
+
for IMGFILE in "${IMGFILES[@]}"
|
|
79
|
+
do
|
|
80
|
+
BASENAME="$(basename "$IMGFILE" .png)"
|
|
81
|
+
nice magick "$SVGINDIR/$BASENAME.svg" -channel RGB -negate -size 2000x2000 "$TMPDIR1/$BASENAME.png"
|
|
82
|
+
image-sdf "$TMPDIR1/$BASENAME.png" --spread 32 --downscale 2 --color black --output "$TMPDIR2/$BASENAME.png" &
|
|
83
|
+
done
|
|
84
|
+
wait
|
|
85
|
+
|
|
86
|
+
for IMGFILE in "$TMPDIR2"/*.png
|
|
87
|
+
do
|
|
88
|
+
magick "$IMGFILE" -resize 20x20 "$PNGOUTDIR/$(basename "$IMGFILE")" &
|
|
89
|
+
done
|
|
90
|
+
wait
|
|
91
|
+
|
|
92
|
+
cd "$PNGOUTDIR"
|
|
93
|
+
identify ./*.png
|
package/src/maps/vectorMaps.tsx
CHANGED
|
@@ -43,8 +43,9 @@ export function useVectorMap(options: {
|
|
|
43
43
|
scrollZoom?: boolean
|
|
44
44
|
dragPan?: boolean
|
|
45
45
|
touchZoomRotate?: boolean
|
|
46
|
+
padding?: number
|
|
46
47
|
}) {
|
|
47
|
-
const { divRef, bounds, scrollZoom, dragPan, touchZoomRotate } = options
|
|
48
|
+
const { divRef, bounds, scrollZoom, dragPan, touchZoomRotate, padding } = options
|
|
48
49
|
|
|
49
50
|
// Maplibre map
|
|
50
51
|
const [map, setMap] = useState<maplibregl.Map>()
|
|
@@ -89,9 +90,8 @@ export function useVectorMap(options: {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
try {
|
|
92
|
-
const
|
|
93
|
+
const mapConstructorOptions: maplibregl.MapOptions = {
|
|
93
94
|
container: divRef,
|
|
94
|
-
bounds: bounds,
|
|
95
95
|
scrollZoom: scrollZoom === false ? false : true,
|
|
96
96
|
dragPan: dragPan === false ? false : true,
|
|
97
97
|
touchZoomRotate: touchZoomRotate === false ? false : true,
|
|
@@ -102,13 +102,21 @@ export function useVectorMap(options: {
|
|
|
102
102
|
layers: [],
|
|
103
103
|
sources: {}
|
|
104
104
|
},
|
|
105
|
-
// Prevent scrolling outside of world bounds
|
|
106
105
|
maxBounds: [
|
|
107
106
|
[-179.9, -85], // Southwest coordinates
|
|
108
107
|
[179.9, 85] // Northeast coordinates
|
|
109
108
|
],
|
|
110
109
|
preserveDrawingBuffer: printingModeEnabled
|
|
111
|
-
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (bounds) {
|
|
113
|
+
mapConstructorOptions.bounds = bounds
|
|
114
|
+
if (padding !== undefined) {
|
|
115
|
+
mapConstructorOptions.fitBoundsOptions = { padding }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const m = new maplibregl.Map(mapConstructorOptions)
|
|
112
120
|
|
|
113
121
|
setHasWebGLContext(true)
|
|
114
122
|
|
|
@@ -240,9 +248,8 @@ export function useBaseStyle(baseLayer: BaseLayer) {
|
|
|
240
248
|
} else if (baseLayer == "bing_road") {
|
|
241
249
|
loadStyle(`https://api.maptiler.com/maps/streets-v2/style.json?key=${mapTilerApiKey}`)
|
|
242
250
|
} else if (baseLayer == "bing_aerial") {
|
|
243
|
-
//
|
|
244
|
-
|
|
245
|
-
// loadStyle(`https://api.maptiler.com/maps/hybrid/style.json?key=${mapTilerApiKey}`)
|
|
251
|
+
// Stadia Maps
|
|
252
|
+
loadStyle("https://tiles.stadiamaps.com/styles/alidade_satellite.json?api_key=835a418e-91f9-4eb8-9856-0883c3656c9d")
|
|
246
253
|
} else if (baseLayer == "blank") {
|
|
247
254
|
setBaseStyle({
|
|
248
255
|
version: 8,
|
|
@@ -310,7 +317,10 @@ export function AttributionControl(props: {
|
|
|
310
317
|
if (props.baseLayer == "bing_aerial") {
|
|
311
318
|
return (
|
|
312
319
|
<div className="newmap-attribution-control">
|
|
313
|
-
|
|
320
|
+
© <a href="https://stadiamaps.com/" target="_blank">Stadia Maps</a>
|
|
321
|
+
© <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
|
|
322
|
+
© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>
|
|
323
|
+
© CNES, Distribution Airbus DS, © Airbus DS, © PlanetObserver (Contains Copernicus Data)
|
|
314
324
|
{props.extraText ? " " + props.extraText : null}
|
|
315
325
|
</div>
|
|
316
326
|
)
|
|
@@ -338,10 +348,7 @@ export function VectorMapLogo(props: {
|
|
|
338
348
|
}
|
|
339
349
|
|
|
340
350
|
if (props.baseLayer == "bing_aerial") {
|
|
341
|
-
return
|
|
342
|
-
src="https://dev.virtualearth.net/Branding/logo_powered_by.png"
|
|
343
|
-
style={{ position: "absolute", bottom: 38, left: 11, height: 22, zIndex: 1000, pointerEvents: "none" }}
|
|
344
|
-
/>
|
|
351
|
+
return null
|
|
345
352
|
}
|
|
346
353
|
|
|
347
354
|
return <img
|
|
@@ -350,36 +357,6 @@ export function VectorMapLogo(props: {
|
|
|
350
357
|
/>
|
|
351
358
|
}
|
|
352
359
|
|
|
353
|
-
async function loadBingBasemap(basemapType: "AerialWithLabels", opacity: number): Promise<maplibregl.StyleSpecification> {
|
|
354
|
-
// Load metadata
|
|
355
|
-
const bingApiKey = "Ao26dWY2IC8PjorsJKFaoR85EPXCnCohrJdisCWXIULAXFo0JAXquGauppTMQbyU"
|
|
356
|
-
|
|
357
|
-
const metadata = await fetch(`https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${basemapType}?key=${bingApiKey}`).then((response) => response.json())
|
|
358
|
-
const resource = metadata.resourceSets[0].resources[0]
|
|
359
|
-
|
|
360
|
-
return {
|
|
361
|
-
sources: {
|
|
362
|
-
"bing_raster": {
|
|
363
|
-
type: "raster",
|
|
364
|
-
tiles: resource.imageUrlSubdomains.map((subdomain: string) =>
|
|
365
|
-
resource.imageUrl.replace("{subdomain}", subdomain).replace("{culture}", "").replace("http:", "https:")),
|
|
366
|
-
tileSize: resource.imageHeight,
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
layers: [
|
|
370
|
-
{
|
|
371
|
-
id: "bing_raster",
|
|
372
|
-
type: "raster",
|
|
373
|
-
source: "bing_raster",
|
|
374
|
-
paint: {
|
|
375
|
-
"raster-opacity": opacity
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
],
|
|
379
|
-
version: 8
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
360
|
/** Persists map bounds to local storage */
|
|
384
361
|
export function usePersistedMapBounds(map: Map | undefined, localStorageKey: string) {
|
|
385
362
|
const [bounds, setBounds] = useState<{ n: number, e: number, s: number, w: number } | null>(null)
|
|
@@ -421,4 +398,3 @@ export function usePersistedMapBounds(map: Map | undefined, localStorageKey: str
|
|
|
421
398
|
}
|
|
422
399
|
}, [map])
|
|
423
400
|
}
|
|
424
|
-
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import _ from "lodash"
|
|
2
|
+
import $ from "jquery"
|
|
3
|
+
import React from "react"
|
|
4
|
+
import querystring from "querystring"
|
|
5
|
+
import * as uiComponents from "../UIComponents"
|
|
6
|
+
import { ExprUtils, Schema } from "@mwater/expressions"
|
|
7
|
+
import moment from "moment"
|
|
8
|
+
import { Form } from "@mwater/forms"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
interface FormsListComponentProps {
|
|
12
|
+
/** Url to hit api */
|
|
13
|
+
apiUrl: string
|
|
14
|
+
/** Optional client */
|
|
15
|
+
client?: string
|
|
16
|
+
schema: Schema
|
|
17
|
+
/** User id */
|
|
18
|
+
user?: string
|
|
19
|
+
/** Called with table selected */
|
|
20
|
+
onChange: any
|
|
21
|
+
extraTables: any
|
|
22
|
+
onExtraTableAdd: any
|
|
23
|
+
onExtraTableRemove: any
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface FormsListComponentState {
|
|
27
|
+
error?: any
|
|
28
|
+
search: any
|
|
29
|
+
forms: { id: string, name: string, desc?: string }[] | null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Searchable list of forms
|
|
33
|
+
export class FormsListComponent extends React.Component<FormsListComponentProps, FormsListComponentState> {
|
|
34
|
+
constructor(props: any) {
|
|
35
|
+
super(props)
|
|
36
|
+
this.state = {
|
|
37
|
+
forms: null,
|
|
38
|
+
search: ""
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
componentDidMount() {
|
|
43
|
+
// Get names and basic of forms
|
|
44
|
+
const query: any = {}
|
|
45
|
+
query.fields = JSON.stringify({
|
|
46
|
+
"design.name": 1,
|
|
47
|
+
"design.description": 1,
|
|
48
|
+
roles: 1,
|
|
49
|
+
created: 1,
|
|
50
|
+
modified: 1,
|
|
51
|
+
state: 1,
|
|
52
|
+
isMaster: 1
|
|
53
|
+
})
|
|
54
|
+
query.selector = JSON.stringify({ design: { $exists: true }, state: { $ne: "deleted" } })
|
|
55
|
+
query.client = this.props.client
|
|
56
|
+
|
|
57
|
+
// Get list of all form names
|
|
58
|
+
$.getJSON(this.props.apiUrl + "forms?" + querystring.stringify(query), (forms: Form[]) => {
|
|
59
|
+
// Sort by modified.on desc but first by user
|
|
60
|
+
forms = _.sortByOrder(
|
|
61
|
+
forms,
|
|
62
|
+
[
|
|
63
|
+
(form: Form) => ((this.props.extraTables || []).includes("responses:" + form._id) ? 1 : 0),
|
|
64
|
+
(form: Form) => (form.created.by === this.props.user ? 1 : 0),
|
|
65
|
+
(form: Form) => form.modified?.on
|
|
66
|
+
],
|
|
67
|
+
["desc", "desc", "desc"]
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
// TODO use name instead of design.name
|
|
71
|
+
this.setState({
|
|
72
|
+
forms: _.map(forms, (form) => {
|
|
73
|
+
let desc = ExprUtils.localizeString(form.design.description, null) || ""
|
|
74
|
+
if (desc) {
|
|
75
|
+
desc += " - "
|
|
76
|
+
}
|
|
77
|
+
desc += T`Modified ${moment(form.modified?.on, moment.ISO_8601).format("ll")}`
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
id: form._id,
|
|
81
|
+
name: ExprUtils.localizeString(form.design.name, null),
|
|
82
|
+
desc
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
}).fail((xhr: any) => {
|
|
87
|
+
this.setState({ error: xhr.responseText })
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
handleTableRemove = (table: any) => {
|
|
92
|
+
if (
|
|
93
|
+
confirm(
|
|
94
|
+
T`Remove ${ExprUtils.localizeString(
|
|
95
|
+
table.name,
|
|
96
|
+
T.locale
|
|
97
|
+
)}? Any widgets that depend on it will no longer work properly.`
|
|
98
|
+
)
|
|
99
|
+
) {
|
|
100
|
+
return this.props.onExtraTableRemove(table.id)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
searchRef = (comp: any) => {
|
|
105
|
+
// Focus
|
|
106
|
+
if (comp) {
|
|
107
|
+
return comp.focus()
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
render() {
|
|
112
|
+
let forms
|
|
113
|
+
if (this.state.error) {
|
|
114
|
+
return <div className="alert alert-danger">{this.state.error}</div>
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Filter forms
|
|
118
|
+
if (this.state.search) {
|
|
119
|
+
const escapeRegExp = (s: any) => s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
|
|
120
|
+
|
|
121
|
+
const searchStringRegExp = new RegExp(escapeRegExp(this.state.search), "i")
|
|
122
|
+
|
|
123
|
+
forms = _.filter(this.state.forms!, (form) => form.name.match(searchStringRegExp))
|
|
124
|
+
} else {
|
|
125
|
+
;({ forms } = this.state)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Remove if already included
|
|
129
|
+
forms = _.filter(forms || [], (f) => !(this.props.extraTables || []).includes(`responses:${f.id}`))
|
|
130
|
+
|
|
131
|
+
let tables = _.filter(
|
|
132
|
+
this.props.schema.getTables(),
|
|
133
|
+
(table) => (table.id.match(/^responses:/) || table.id.match(/^master_responses:/)) && !table.deprecated
|
|
134
|
+
)
|
|
135
|
+
tables = _.sortBy(tables, (t) => t.name.en)
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<div>
|
|
139
|
+
<label>{T`Included Surveys:`}</label>
|
|
140
|
+
{tables.length > 0 ? (
|
|
141
|
+
<uiComponents.OptionListComponent
|
|
142
|
+
items={_.map(tables, (table) => {
|
|
143
|
+
return {
|
|
144
|
+
name: ExprUtils.localizeString(table.name, T.locale),
|
|
145
|
+
desc: ExprUtils.localizeString(table.desc, T.locale),
|
|
146
|
+
onClick: this.props.onChange.bind(null, table.id),
|
|
147
|
+
onRemove: this.handleTableRemove.bind(null, table)
|
|
148
|
+
}
|
|
149
|
+
})}
|
|
150
|
+
/>
|
|
151
|
+
) : (
|
|
152
|
+
<div>{T`None`}</div>
|
|
153
|
+
)}
|
|
154
|
+
|
|
155
|
+
<br />
|
|
156
|
+
|
|
157
|
+
<label>{T`All Surveys:`}</label>
|
|
158
|
+
{!this.state.forms || this.state.forms.length === 0 ? (
|
|
159
|
+
<div className="alert alert-info">
|
|
160
|
+
<i className="fa fa-spinner fa-spin" />
|
|
161
|
+
{T`Loading...`}
|
|
162
|
+
</div>
|
|
163
|
+
) : (
|
|
164
|
+
<>
|
|
165
|
+
<input
|
|
166
|
+
type="text"
|
|
167
|
+
className="form-control form-control-sm"
|
|
168
|
+
placeholder={T`Search...`}
|
|
169
|
+
key="search"
|
|
170
|
+
ref={this.searchRef}
|
|
171
|
+
style={{ maxWidth: "20em", marginBottom: 10 }}
|
|
172
|
+
value={this.state.search}
|
|
173
|
+
onChange={(ev: any) => this.setState({ search: ev.target.value })}
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
<uiComponents.OptionListComponent
|
|
177
|
+
items={_.map(forms, (form) => ({
|
|
178
|
+
name: form.name,
|
|
179
|
+
desc: form.desc,
|
|
180
|
+
onClick: this.props.onChange.bind(null, "responses:" + form.id)
|
|
181
|
+
}))}
|
|
182
|
+
/>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
185
|
+
</div>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
}
|