@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.
Files changed (310) hide show
  1. package/lib/MWaterContextComponent.d.ts +1 -1
  2. package/lib/MWaterContextComponent.js +1 -1
  3. package/lib/MWaterGlobalFiltersComponent.d.ts +2 -2
  4. package/lib/MWaterGlobalFiltersComponent.js +11 -20
  5. package/lib/MWaterLoaderComponent.d.ts +5 -14
  6. package/lib/MWaterLoaderComponent.js +2 -11
  7. package/lib/UndoStack.d.ts +2 -1
  8. package/lib/UndoStack.js +12 -6
  9. package/lib/dashboards/DashboardComponent.js +7 -5
  10. package/lib/dashboards/DashboardDesign.d.ts +1 -1
  11. package/lib/dashboards/LayoutOptionsComponent.js +18 -11
  12. package/lib/dashboards/ServerDashboardDataSource.d.ts +10 -1
  13. package/lib/dashboards/ServerDashboardDataSource.js +29 -10
  14. package/lib/dashboards/SettingsModalComponent.js +1 -1
  15. package/lib/dashboards/layoutOptions.d.ts +5 -1
  16. package/lib/datagrids/DatagridComponent.js +23 -3
  17. package/lib/datagrids/DatagridDesignerComponent.d.ts +2 -3
  18. package/lib/datagrids/DatagridDesignerComponent.js +108 -120
  19. package/lib/datagrids/DatagridViewComponent.js +3 -2
  20. package/lib/datagrids/ExprCellComponent.d.ts +1 -0
  21. package/lib/datagrids/ExprCellComponent.js +22 -20
  22. package/lib/datagrids/OrderBysDesignerComponent.d.ts +7 -7
  23. package/lib/datagrids/OrderBysDesignerComponent.js +19 -28
  24. package/lib/index.css +45 -2
  25. package/lib/index.d.ts +5 -5
  26. package/lib/index.js +2 -3
  27. package/lib/layouts/blocks/BlocksDisplayComponent.d.ts +8 -1
  28. package/lib/layouts/blocks/BlocksDisplayComponent.js +46 -4
  29. package/lib/maps/BufferLayer.d.ts +18 -0
  30. package/lib/maps/BufferLayer.js +36 -14
  31. package/lib/maps/BufferLayerDesign.d.ts +1 -1
  32. package/lib/maps/BufferLayerDesignerComponent.js +2 -2
  33. package/lib/maps/ChoroplethLayer.d.ts +18 -0
  34. package/lib/maps/ChoroplethLayer.js +46 -25
  35. package/lib/maps/ChoroplethLayerDesign.d.ts +7 -3
  36. package/lib/maps/ChoroplethLayerDesigner.d.ts +10 -22
  37. package/lib/maps/ChoroplethLayerDesigner.js +58 -89
  38. package/lib/maps/DirectMapDataSource.js +17 -10
  39. package/lib/maps/EditHoverOver.d.ts +4 -3
  40. package/lib/maps/EditHoverOver.js +64 -35
  41. package/lib/maps/HoverContent.d.ts +10 -5
  42. package/lib/maps/HoverContent.js +7 -36
  43. package/lib/maps/Layer.d.ts +37 -0
  44. package/lib/maps/Layer.js +30 -4
  45. package/lib/maps/LeafletMapComponent.js +10 -19
  46. package/lib/maps/MWaterServerLayer.d.ts +2 -2
  47. package/lib/maps/MWaterServerLayer.js +6 -6
  48. package/lib/maps/MapComponent.js +0 -1
  49. package/lib/maps/MapLayerDataSource.d.ts +9 -0
  50. package/lib/maps/MapUtils.d.ts +19 -1
  51. package/lib/maps/MapUtils.js +80 -1
  52. package/lib/maps/MarkersLayer.d.ts +18 -0
  53. package/lib/maps/MarkersLayer.js +42 -26
  54. package/lib/maps/MarkersLayerDesign.d.ts +1 -1
  55. package/lib/maps/MarkersLayerDesignerComponent.d.ts +12 -28
  56. package/lib/maps/MarkersLayerDesignerComponent.js +81 -111
  57. package/lib/maps/RasterMapViewComponent.js +1 -1
  58. package/lib/maps/ServerMapDataSource.d.ts +9 -0
  59. package/lib/maps/ServerMapDataSource.js +29 -10
  60. package/lib/maps/VectorMapViewComponent.js +7 -15
  61. package/lib/maps/maps.d.ts +4 -2
  62. package/lib/maps/symbols/font-awesome/asterisk.png +0 -0
  63. package/lib/maps/symbols/font-awesome/ban.png +0 -0
  64. package/lib/maps/symbols/font-awesome/beer.png +0 -0
  65. package/lib/maps/symbols/font-awesome/bell.png +0 -0
  66. package/lib/maps/symbols/font-awesome/bolt.png +0 -0
  67. package/lib/maps/symbols/font-awesome/building.png +0 -0
  68. package/lib/maps/symbols/font-awesome/bullseye.png +0 -0
  69. package/lib/maps/symbols/font-awesome/bus.png +0 -0
  70. package/lib/maps/symbols/font-awesome/caret-up.png +0 -0
  71. package/lib/maps/symbols/font-awesome/certificate.png +0 -0
  72. package/lib/maps/symbols/font-awesome/check-circle.png +0 -0
  73. package/lib/maps/symbols/font-awesome/check.png +0 -0
  74. package/lib/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  75. package/lib/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  76. package/lib/maps/symbols/font-awesome/cloud-rain.png +0 -0
  77. package/lib/maps/symbols/font-awesome/cloud.png +0 -0
  78. package/lib/maps/symbols/font-awesome/comment.png +0 -0
  79. package/lib/maps/symbols/font-awesome/crosshairs.png +0 -0
  80. package/lib/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  81. package/lib/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  82. package/lib/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  83. package/lib/maps/symbols/font-awesome/female.png +0 -0
  84. package/lib/maps/symbols/font-awesome/file.png +0 -0
  85. package/lib/maps/symbols/font-awesome/flag.png +0 -0
  86. package/lib/maps/symbols/font-awesome/flask.png +0 -0
  87. package/lib/maps/symbols/font-awesome/h-square.png +0 -0
  88. package/lib/maps/symbols/font-awesome/home.png +0 -0
  89. package/lib/maps/symbols/font-awesome/info-circle.png +0 -0
  90. package/lib/maps/symbols/font-awesome/male.png +0 -0
  91. package/lib/maps/symbols/font-awesome/medkit.png +0 -0
  92. package/lib/maps/symbols/font-awesome/mobile.png +0 -0
  93. package/lib/maps/symbols/font-awesome/plus-circle.png +0 -0
  94. package/lib/maps/symbols/font-awesome/plus-square.png +0 -0
  95. package/lib/maps/symbols/font-awesome/plus.png +0 -0
  96. package/lib/maps/symbols/font-awesome/square.png +0 -0
  97. package/lib/maps/symbols/font-awesome/star.png +0 -0
  98. package/lib/maps/symbols/font-awesome/thumbs-down.png +0 -0
  99. package/lib/maps/symbols/font-awesome/thumbs-up.png +0 -0
  100. package/lib/maps/symbols/font-awesome/ticket.png +0 -0
  101. package/lib/maps/symbols/font-awesome/times-circle.png +0 -0
  102. package/lib/maps/symbols/font-awesome/times.png +0 -0
  103. package/lib/maps/symbols/font-awesome/tint.png +0 -0
  104. package/lib/maps/symbols/font-awesome/tree.png +0 -0
  105. package/lib/maps/symbols/font-awesome/university.png +0 -0
  106. package/lib/maps/symbols/font-awesome/usd.png +0 -0
  107. package/lib/maps/symbols/font-awesome/user.png +0 -0
  108. package/lib/maps/symbols/font-awesome/users.png +0 -0
  109. package/lib/maps/symbols/font-awesome/wheelchair.png +0 -0
  110. package/lib/maps/symbols/sdf-ize.sh +93 -0
  111. package/lib/maps/vectorMaps.d.ts +1 -0
  112. package/lib/maps/vectorMaps.js +20 -36
  113. package/lib/mwater_table_selection/FormsListComponent.d.ts +33 -0
  114. package/lib/mwater_table_selection/FormsListComponent.js +141 -0
  115. package/lib/mwater_table_selection/IndicatorsListComponent.d.ts +49 -0
  116. package/lib/mwater_table_selection/IndicatorsListComponent.js +251 -0
  117. package/lib/mwater_table_selection/IssuesListComponent.d.ts +29 -0
  118. package/lib/mwater_table_selection/IssuesListComponent.js +123 -0
  119. package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.d.ts +20 -0
  120. package/lib/mwater_table_selection/MWaterAccountingSystemListComponent.js +157 -0
  121. package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.d.ts +17 -0
  122. package/lib/mwater_table_selection/MWaterAssetSystemsListComponent.js +79 -0
  123. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.d.ts +18 -0
  124. package/lib/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.js +80 -0
  125. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.d.ts +63 -0
  126. package/lib/mwater_table_selection/MWaterCompleteTableSelectComponent.js +461 -0
  127. package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.d.ts +17 -0
  128. package/lib/mwater_table_selection/MWaterCustomTablesetListComponent.js +94 -0
  129. package/lib/mwater_table_selection/MWaterMetricsTableListComponent.d.ts +17 -0
  130. package/lib/mwater_table_selection/MWaterMetricsTableListComponent.js +80 -0
  131. package/lib/mwater_table_selection/MWaterTableSelectComponent.d.ts +32 -0
  132. package/lib/mwater_table_selection/MWaterTableSelectComponent.js +163 -0
  133. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.d.ts +19 -0
  134. package/lib/mwater_table_selection/MWaterWorkflowsSelectComponent.js +111 -0
  135. package/lib/quickfilter/QuickfiltersComponent.d.ts +3 -102
  136. package/lib/quickfilter/QuickfiltersComponent.js +53 -110
  137. package/lib/quickfilter/TextLiteralComponent.d.ts +23 -47
  138. package/lib/quickfilter/TextLiteralComponent.js +85 -82
  139. package/lib/widgets/MapWidget.js +4 -2
  140. package/lib/widgets/charts/Chart.d.ts +11 -0
  141. package/lib/widgets/charts/Chart.js +15 -0
  142. package/lib/widgets/charts/ChartWidgetComponent.d.ts +1 -0
  143. package/lib/widgets/charts/ChartWidgetComponent.js +27 -1
  144. package/lib/widgets/charts/layered/LayeredChartDesign.d.ts +1 -1
  145. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.d.ts +1 -1
  146. package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +5 -12
  147. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.d.ts +43 -57
  148. package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +113 -110
  149. package/lib/widgets/charts/layered/LayeredChartUtils.d.ts +2 -1
  150. package/lib/widgets/charts/layered/LayeredChartUtils.js +0 -2
  151. package/lib/widgets/charts/pivot/PivotChart.d.ts +2 -0
  152. package/lib/widgets/charts/pivot/PivotChart.js +156 -0
  153. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -20
  154. package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +31 -61
  155. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.d.ts +4 -0
  156. package/lib/widgets/charts/pivot/PivotChartLayoutBuilder.js +4 -2
  157. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.d.ts +5 -44
  158. package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +38 -63
  159. package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +7 -68
  160. package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +58 -106
  161. package/lib/widgets/charts/table/TableChart.d.ts +2 -0
  162. package/lib/widgets/charts/table/TableChart.js +172 -1
  163. package/lib/widgets/charts/table/TableChartDesignerComponent.d.ts +7 -17
  164. package/lib/widgets/charts/table/TableChartDesignerComponent.js +79 -95
  165. package/lib/widgets/charts/table/TableChartViewComponent.d.ts +1 -7
  166. package/lib/widgets/charts/table/TableChartViewComponent.js +19 -27
  167. package/lib/widgets/text/ExprItemEditorComponent.d.ts +3 -8
  168. package/lib/widgets/text/ExprItemEditorComponent.js +36 -33
  169. package/lib/widgets/text/ExprUpdateModalComponent.d.ts +1 -0
  170. package/package.json +4 -10
  171. package/src/MWaterContextComponent.tsx +2 -2
  172. package/src/{MWaterGlobalFiltersComponent.ts → MWaterGlobalFiltersComponent.tsx} +32 -33
  173. package/src/{MWaterLoaderComponent.ts → MWaterLoaderComponent.tsx} +18 -19
  174. package/src/UndoStack.ts +14 -6
  175. package/src/dashboards/DashboardComponent.tsx +7 -5
  176. package/src/dashboards/DashboardDesign.ts +1 -1
  177. package/src/dashboards/LayoutOptionsComponent.tsx +22 -10
  178. package/src/dashboards/ServerDashboardDataSource.ts +36 -13
  179. package/src/dashboards/SettingsModalComponent.tsx +1 -1
  180. package/src/dashboards/layoutOptions.tsx +5 -1
  181. package/src/datagrids/DatagridComponent.tsx +31 -3
  182. package/src/datagrids/DatagridDesignerComponent.tsx +241 -229
  183. package/src/datagrids/DatagridViewComponent.tsx +3 -2
  184. package/src/datagrids/ExprCellComponent.tsx +23 -20
  185. package/src/datagrids/OrderBysDesignerComponent.tsx +61 -70
  186. package/src/index.css +45 -2
  187. package/src/index.ts +5 -11
  188. package/src/layouts/blocks/BlocksDisplayComponent.tsx +60 -5
  189. package/src/maps/BufferLayer.ts +48 -20
  190. package/src/maps/BufferLayerDesign.ts +1 -1
  191. package/src/maps/BufferLayerDesignerComponent.tsx +2 -1
  192. package/src/maps/ChoroplethLayer.ts +70 -39
  193. package/src/maps/ChoroplethLayerDesign.ts +6 -2
  194. package/src/maps/ChoroplethLayerDesigner.tsx +171 -167
  195. package/src/maps/DirectMapDataSource.ts +21 -13
  196. package/src/maps/EditHoverOver.tsx +98 -54
  197. package/src/maps/HoverContent.tsx +17 -48
  198. package/src/maps/Layer.ts +42 -4
  199. package/src/maps/LeafletMapComponent.tsx +10 -19
  200. package/src/maps/MWaterServerLayer.ts +6 -6
  201. package/src/maps/MapComponent.ts +0 -1
  202. package/src/maps/MapLayerDataSource.ts +8 -0
  203. package/src/maps/MapUtils.ts +82 -3
  204. package/src/maps/MarkersLayer.ts +54 -27
  205. package/src/maps/MarkersLayerDesign.ts +1 -1
  206. package/src/maps/MarkersLayerDesignerComponent.tsx +360 -0
  207. package/src/maps/RasterMapViewComponent.ts +1 -1
  208. package/src/maps/ServerMapDataSource.ts +35 -12
  209. package/src/maps/VectorMapViewComponent.tsx +8 -19
  210. package/src/maps/maps.ts +4 -2
  211. package/src/maps/symbols/font-awesome/asterisk.png +0 -0
  212. package/src/maps/symbols/font-awesome/ban.png +0 -0
  213. package/src/maps/symbols/font-awesome/beer.png +0 -0
  214. package/src/maps/symbols/font-awesome/bell.png +0 -0
  215. package/src/maps/symbols/font-awesome/bolt.png +0 -0
  216. package/src/maps/symbols/font-awesome/building.png +0 -0
  217. package/src/maps/symbols/font-awesome/bullseye.png +0 -0
  218. package/src/maps/symbols/font-awesome/bus.png +0 -0
  219. package/src/maps/symbols/font-awesome/caret-up.png +0 -0
  220. package/src/maps/symbols/font-awesome/certificate.png +0 -0
  221. package/src/maps/symbols/font-awesome/check-circle.png +0 -0
  222. package/src/maps/symbols/font-awesome/check.png +0 -0
  223. package/src/maps/symbols/font-awesome/chevron-circle-down.png +0 -0
  224. package/src/maps/symbols/font-awesome/chevron-circle-up.png +0 -0
  225. package/src/maps/symbols/font-awesome/cloud-rain.png +0 -0
  226. package/src/maps/symbols/font-awesome/cloud.png +0 -0
  227. package/src/maps/symbols/font-awesome/comment.png +0 -0
  228. package/src/maps/symbols/font-awesome/crosshairs.png +0 -0
  229. package/src/maps/symbols/font-awesome/dot-circle-o.png +0 -0
  230. package/src/maps/symbols/font-awesome/exclamation-circle.png +0 -0
  231. package/src/maps/symbols/font-awesome/exclamation-triangle.png +0 -0
  232. package/src/maps/symbols/font-awesome/female.png +0 -0
  233. package/src/maps/symbols/font-awesome/file.png +0 -0
  234. package/src/maps/symbols/font-awesome/flag.png +0 -0
  235. package/src/maps/symbols/font-awesome/flask.png +0 -0
  236. package/src/maps/symbols/font-awesome/h-square.png +0 -0
  237. package/src/maps/symbols/font-awesome/home.png +0 -0
  238. package/src/maps/symbols/font-awesome/info-circle.png +0 -0
  239. package/src/maps/symbols/font-awesome/male.png +0 -0
  240. package/src/maps/symbols/font-awesome/medkit.png +0 -0
  241. package/src/maps/symbols/font-awesome/mobile.png +0 -0
  242. package/src/maps/symbols/font-awesome/plus-circle.png +0 -0
  243. package/src/maps/symbols/font-awesome/plus-square.png +0 -0
  244. package/src/maps/symbols/font-awesome/plus.png +0 -0
  245. package/src/maps/symbols/font-awesome/square.png +0 -0
  246. package/src/maps/symbols/font-awesome/star.png +0 -0
  247. package/src/maps/symbols/font-awesome/thumbs-down.png +0 -0
  248. package/src/maps/symbols/font-awesome/thumbs-up.png +0 -0
  249. package/src/maps/symbols/font-awesome/ticket.png +0 -0
  250. package/src/maps/symbols/font-awesome/times-circle.png +0 -0
  251. package/src/maps/symbols/font-awesome/times.png +0 -0
  252. package/src/maps/symbols/font-awesome/tint.png +0 -0
  253. package/src/maps/symbols/font-awesome/tree.png +0 -0
  254. package/src/maps/symbols/font-awesome/university.png +0 -0
  255. package/src/maps/symbols/font-awesome/usd.png +0 -0
  256. package/src/maps/symbols/font-awesome/user.png +0 -0
  257. package/src/maps/symbols/font-awesome/users.png +0 -0
  258. package/src/maps/symbols/font-awesome/wheelchair.png +0 -0
  259. package/src/maps/symbols/sdf-ize.sh +93 -0
  260. package/src/maps/vectorMaps.tsx +20 -44
  261. package/src/mwater_table_selection/FormsListComponent.tsx +188 -0
  262. package/src/mwater_table_selection/IndicatorsListComponent.tsx +411 -0
  263. package/src/mwater_table_selection/IssuesListComponent.tsx +167 -0
  264. package/src/mwater_table_selection/MWaterAccountingSystemListComponent.tsx +225 -0
  265. package/src/{MWaterAssetSystemsListComponent.tsx → mwater_table_selection/MWaterAssetSystemsListComponent.tsx} +2 -2
  266. package/src/mwater_table_selection/MWaterCalculatedDataSourcesListComponent.tsx +111 -0
  267. package/src/mwater_table_selection/MWaterCompleteTableSelectComponent.tsx +713 -0
  268. package/src/{MWaterCustomTablesetListComponent.tsx → mwater_table_selection/MWaterCustomTablesetListComponent.tsx} +1 -1
  269. package/src/{MWaterMetricsTableListComponent.tsx → mwater_table_selection/MWaterMetricsTableListComponent.tsx} +1 -1
  270. package/src/{MWaterTableSelectComponent.tsx → mwater_table_selection/MWaterTableSelectComponent.tsx} +91 -90
  271. package/src/mwater_table_selection/MWaterWorkflowsSelectComponent.tsx +159 -0
  272. package/src/quickfilter/{QuickfiltersComponent.ts → QuickfiltersComponent.tsx} +165 -158
  273. package/src/quickfilter/TextLiteralComponent.tsx +197 -0
  274. package/src/widgets/MapWidget.tsx +9 -1
  275. package/src/widgets/charts/Chart.ts +17 -0
  276. package/src/widgets/charts/ChartWidgetComponent.tsx +36 -1
  277. package/src/widgets/charts/layered/LayeredChartDesign.ts +1 -1
  278. package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +23 -24
  279. package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +260 -211
  280. package/src/widgets/charts/layered/LayeredChartUtils.ts +7 -7
  281. package/src/widgets/charts/pivot/PivotChart.ts +191 -0
  282. package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +124 -129
  283. package/src/widgets/charts/pivot/PivotChartLayoutBuilder.ts +4 -2
  284. package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +120 -149
  285. package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +178 -198
  286. package/src/widgets/charts/table/TableChart.ts +177 -1
  287. package/src/widgets/charts/table/TableChartDesignerComponent.tsx +422 -0
  288. package/src/widgets/charts/table/{TableChartViewComponent.ts → TableChartViewComponent.tsx} +65 -60
  289. package/src/widgets/text/ExprItemEditorComponent.tsx +83 -77
  290. package/src/widgets/text/ExprUpdateModalComponent.tsx +1 -0
  291. package/test/UndoStackTests.ts +52 -1
  292. package/.storybook/config.js +0 -7
  293. package/.storybook/head.html +0 -4
  294. package/.storybook/webpack.config.js +0 -15
  295. package/src/MWaterCompleteTableSelectComponent.tsx +0 -975
  296. package/src/maps/BingLayer.ts +0 -146
  297. package/src/maps/MarkersLayerDesignerComponent.ts +0 -374
  298. package/src/quickfilter/TextLiteralComponent.ts +0 -165
  299. package/src/widgets/charts/table/TableChartDesignerComponent.ts +0 -441
  300. package/stories/UpdateableComponent.js +0 -29
  301. package/stories/consoles.js +0 -202
  302. package/stories/dashboards.js +0 -217
  303. package/stories/datagridDesign.js +0 -114
  304. package/stories/datagrids.js +0 -69
  305. package/stories/dates.js +0 -80
  306. package/stories/exprcomponent.js +0 -43
  307. package/stories/index.js +0 -18
  308. package/stories/leaflet.js +0 -59
  309. package/stories/maps.js +0 -24
  310. package/stories/pivotChart.js +0 -235
@@ -1,146 +0,0 @@
1
- /*
2
- Copyright (c) 2011-2014, Pavel Shramov, Bruno Bergot
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification, are
6
- permitted provided that the following conditions are met:
7
-
8
- 1. Redistributions of source code must retain the above copyright notice, this list of
9
- conditions and the following disclaimer.
10
-
11
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
12
- of conditions and the following disclaimer in the documentation and/or other materials
13
- provided with the distribution.
14
-
15
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
16
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
18
- COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
22
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
- */
25
-
26
- import L from "leaflet"
27
-
28
- module.exports = L.TileLayer.extend({
29
- options: {
30
- subdomains: [0, 1, 2, 3],
31
- type: "Aerial",
32
- attribution: "Bing",
33
- culture: "",
34
- maxZoom: 21,
35
- maxNativeZoom: 19
36
- },
37
-
38
- initialize: function (key: any, options: any) {
39
- L.Util.setOptions(this, options)
40
-
41
- this._key = key
42
- this._url = null
43
- this.meta = {}
44
- this.loadMetadata()
45
- },
46
-
47
- tile2quad: function (x: any, y: any, z: any) {
48
- var quad = ""
49
- for (var i = z; i > 0; i--) {
50
- var digit = 0
51
- var mask = 1 << (i - 1)
52
- if ((x & mask) !== 0) digit += 1
53
- if ((y & mask) !== 0) digit += 2
54
- quad = quad + digit
55
- }
56
- return quad
57
- },
58
-
59
- getTileUrl: function (p: any, z: any) {
60
- var zoom = this._getZoomForUrl()
61
- var subdomains = this.options.subdomains,
62
- s = this.options.subdomains[Math.abs((p.x + p.y) % subdomains.length)]
63
- return this._url
64
- .replace("{subdomain}", s)
65
- .replace("{quadkey}", this.tile2quad(p.x, p.y, zoom))
66
- .replace("{culture}", this.options.culture)
67
- },
68
-
69
- loadMetadata: function () {
70
- var _this = this
71
- var url = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${this.options.type}?include=ImageryProviders&key=${this._key}&UriScheme=https`
72
-
73
- fetch(url)
74
- .then(response => response.json())
75
- .then(meta => {
76
- _this.meta = meta
77
- if (meta.errorDetails) {
78
- return
79
- }
80
- _this.initMetadata()
81
- })
82
- .catch(error => console.error('Error loading Bing Maps metadata:', error))
83
- },
84
-
85
- initMetadata: function () {
86
- var r = this.meta.resourceSets[0].resources[0]
87
- if (!r) {
88
- console.error("Error loading Bing Maps metadata")
89
- return
90
- }
91
- this.options.subdomains = r.imageUrlSubdomains
92
- this._url = r.imageUrl
93
- this._providers = []
94
- if (r.imageryProviders) {
95
- for (var i = 0; i < r.imageryProviders.length; i++) {
96
- var p = r.imageryProviders[i]
97
- for (var j = 0; j < p.coverageAreas.length; j++) {
98
- var c = p.coverageAreas[j]
99
- var coverage: any = { zoomMin: c.zoomMin, zoomMax: c.zoomMax, active: false }
100
- var bounds = new L.LatLngBounds(
101
- new L.LatLng(c.bbox[0] + 0.01, c.bbox[1] + 0.01),
102
- new L.LatLng(c.bbox[2] - 0.01, c.bbox[3] - 0.01)
103
- )
104
- coverage.bounds = bounds
105
- coverage.attrib = p.attribution
106
- this._providers.push(coverage)
107
- }
108
- }
109
- }
110
- this._update()
111
- },
112
-
113
- _update: function () {
114
- if (this._url === null || !this._map) return
115
- this._update_attribution()
116
- ;(L.TileLayer.prototype as any)._update.apply(this, [])
117
- },
118
-
119
- _update_attribution: function () {
120
- var bounds = this._map.getBounds()
121
- var zoom = this._map.getZoom()
122
- for (var i = 0; i < this._providers.length; i++) {
123
- var p = this._providers[i]
124
- if (zoom <= p.zoomMax && zoom >= p.zoomMin && bounds.intersects(p.bounds)) {
125
- if (!p.active && this._map.attributionControl) this._map.attributionControl.addAttribution(p.attrib)
126
- p.active = true
127
- } else {
128
- if (p.active && this._map.attributionControl) this._map.attributionControl.removeAttribution(p.attrib)
129
- p.active = false
130
- }
131
- }
132
- },
133
-
134
- onRemove: function (map: any) {
135
- if (this._providers) {
136
- for (var i = 0; i < this._providers.length; i++) {
137
- var p = this._providers[i]
138
- if (p.active && this._map.attributionControl) {
139
- this._map.attributionControl.removeAttribution(p.attrib)
140
- p.active = false
141
- }
142
- }
143
- }
144
- L.TileLayer.prototype.onRemove.apply(this, [map])
145
- }
146
- })
@@ -1,374 +0,0 @@
1
- import _ from "lodash"
2
- import React from "react"
3
- const R = React.createElement
4
- import { FilterExprComponent } from "@mwater/expressions-ui"
5
- import { DataSource, ExprUtils, OpExpr, Schema } from "@mwater/expressions"
6
- import { ExprCompiler } from "@mwater/expressions"
7
- import AxisComponent from "./../axes/AxisComponent"
8
- import ColorComponent from "../ColorComponent"
9
- import { TableSelectComponent } from "@mwater/expressions-ui"
10
- import EditPopupComponent from "./EditPopupComponent"
11
- import ZoomLevelsComponent from "./ZoomLevelsComponent"
12
- import MarkerSymbolSelectComponent from "./MarkerSymbolSelectComponent"
13
- import * as PopupFilterJoinsUtils from "./PopupFilterJoinsUtils"
14
- import * as ui from "@mwater/react-library/lib/bootstrap"
15
- import EditHoverOver from "./EditHoverOver"
16
- import { MarkersLayerDesign } from "./MarkersLayerDesign"
17
- import { default as Rcslider } from "rc-slider"
18
-
19
- export interface MarkersLayerDesignerComponentProps {
20
- /** Schema to use */
21
- schema: Schema
22
- dataSource: DataSource
23
- /** Design of the marker layer */
24
- design: MarkersLayerDesign
25
- /** Called with new design */
26
- onDesignChange: any
27
- filters?: any
28
- }
29
-
30
- // Designer for a markers layer
31
- export default class MarkersLayerDesignerComponent extends React.Component<MarkersLayerDesignerComponentProps> {
32
- // Apply updates to design
33
- update(updates: any) {
34
- return this.props.onDesignChange(_.extend({}, this.props.design, updates))
35
- }
36
-
37
- // Update axes with specified changes
38
- updateAxes(changes: any) {
39
- const axes = _.extend({}, this.props.design.axes, changes)
40
- return this.update({ axes })
41
- }
42
-
43
- handleTableChange = (table: any) => {
44
- return this.update({ table })
45
- }
46
- handleGeometryAxisChange = (axis: any) => {
47
- return this.updateAxes({ geometry: axis })
48
- }
49
- handleColorAxisChange = (axis: any) => {
50
- return this.updateAxes({ color: axis })
51
- }
52
- handleFilterChange = (expr: any) => {
53
- return this.update({ filter: expr })
54
- }
55
- handleColorChange = (color: any) => {
56
- return this.update({ color })
57
- }
58
- handlePolygonBorderColorChange = (polygonBorderColor: any) => {
59
- return this.update({ polygonBorderColor })
60
- }
61
- handlePolygonFillOpacityChange = (polygonFillOpacity: any) => {
62
- return this.update({ polygonFillOpacity: polygonFillOpacity / 100 })
63
- }
64
- handleSymbolChange = (symbol: any) => {
65
- return this.update({ symbol })
66
- }
67
- handleNameChange = (e: any) => {
68
- return this.update({ name: e.target.value })
69
- }
70
- handleMarkerSizeChange = (markerSize: any) => {
71
- return this.update({ markerSize })
72
- }
73
- handleLineWidthChange = (lineWidth: any) => {
74
- return this.update({ lineWidth })
75
- }
76
-
77
- renderTable() {
78
- return R(
79
- "div",
80
- { className: "mb-3" },
81
- R("label", { className: "text-muted" }, R("i", { className: "fa fa-database" }), " ", T`Data Source`),
82
- R(
83
- "div",
84
- { style: { marginLeft: 10 } },
85
- R(TableSelectComponent, {
86
- schema: this.props.schema,
87
- value: this.props.design.table,
88
- onChange: this.handleTableChange,
89
- filter: this.props.design.filter,
90
- onFilterChange: this.handleFilterChange
91
- })
92
- )
93
- )
94
- }
95
-
96
- renderGeometryAxis() {
97
- if (!this.props.design.table) {
98
- return
99
- }
100
-
101
- const title = R("span", null, R("span", { className: "fas fa-map-marker-alt" }), " ", T`Location`)
102
-
103
- const filters = _.clone(this.props.filters) || []
104
-
105
- if (this.props.design.filter != null) {
106
- const exprCompiler = new ExprCompiler(this.props.schema)
107
- const jsonql = exprCompiler.compileExpr({ expr: this.props.design.filter, tableAlias: "{alias}" })
108
- if (jsonql) {
109
- filters.push({ table: (this.props.design.filter as OpExpr).table, jsonql })
110
- }
111
- }
112
-
113
- return R(
114
- "div",
115
- { className: "mb-3" },
116
- R("label", { className: "text-muted" }, title),
117
- R(
118
- "div",
119
- { style: { marginLeft: 10 } },
120
- R(AxisComponent, {
121
- schema: this.props.schema,
122
- dataSource: this.props.dataSource,
123
- table: this.props.design.table,
124
- types: ["geometry"],
125
- aggrNeed: "none",
126
- value: this.props.design.axes.geometry,
127
- onChange: this.handleGeometryAxisChange,
128
- filters
129
- })
130
- )
131
- )
132
- }
133
-
134
- renderColor() {
135
- if (!this.props.design.axes.geometry) {
136
- return
137
- }
138
-
139
- const filters = _.clone(this.props.filters) || []
140
-
141
- if (this.props.design.filter != null) {
142
- const exprCompiler = new ExprCompiler(this.props.schema)
143
- const jsonql = exprCompiler.compileExpr({ expr: this.props.design.filter, tableAlias: "{alias}" })
144
- if (jsonql) {
145
- filters.push({ table: (this.props.design.filter as OpExpr).table, jsonql })
146
- }
147
- }
148
-
149
- return R(
150
- "div",
151
- null,
152
- !this.props.design.axes.color
153
- ? R(
154
- "div",
155
- { className: "mb-3" },
156
- R("label", { className: "text-muted" }, R("span", { className: "fas fa-tint" }), T`Color`),
157
-
158
- R(
159
- "div",
160
- null,
161
- R(ColorComponent, {
162
- color: this.props.design.color,
163
- onChange: this.handleColorChange
164
- })
165
- )
166
- )
167
- : undefined,
168
-
169
- R(
170
- "div",
171
- { className: "mb-3" },
172
- R("label", { className: "text-muted" }, R("span", { className: "fas fa-tint" }), T`Color By Data`),
173
-
174
- R(AxisComponent, {
175
- schema: this.props.schema,
176
- dataSource: this.props.dataSource,
177
- table: this.props.design.table,
178
- types: ["text", "enum", "boolean", "date"],
179
- aggrNeed: "none",
180
- value: this.props.design.axes.color,
181
- defaultColor: this.props.design.color,
182
- showColorMap: true,
183
- onChange: this.handleColorAxisChange,
184
- allowExcludedValues: true,
185
- filters
186
- })
187
- )
188
- )
189
- }
190
-
191
- renderSymbol() {
192
- if (!this.props.design.axes.geometry) {
193
- return
194
- }
195
-
196
- return R(MarkerSymbolSelectComponent, { symbol: this.props.design.symbol, onChange: this.handleSymbolChange })
197
- }
198
-
199
- renderMarkerSize() {
200
- if (!this.props.design.axes.geometry) {
201
- return
202
- }
203
-
204
- return R(
205
- "div",
206
- { className: "mb-3" },
207
- R("label", { className: "text-muted" }, T`Marker Size`),
208
- R(ui.Select, {
209
- value: this.props.design.markerSize || 10,
210
- options: [
211
- { value: 5, label: T`Extra small` },
212
- { value: 8, label: T`Small` },
213
- { value: 10, label: T`Normal` },
214
- { value: 13, label: T`Large` },
215
- { value: 16, label: T`Extra large` }
216
- ],
217
- onChange: this.handleMarkerSizeChange
218
- })
219
- )
220
- }
221
-
222
- renderLineWidth() {
223
- if (!this.props.design.axes.geometry) {
224
- return
225
- }
226
-
227
- return R(
228
- "div",
229
- { className: "mb-3" },
230
- R("label", { className: "text-muted" }, T`Line Width (for shapes)`),
231
- R(ui.Select, {
232
- value: this.props.design.lineWidth != null ? this.props.design.lineWidth : 3,
233
- options: [
234
- { value: 0, label: T`None` },
235
- { value: 1, label: T`1 pixel` },
236
- { value: 2, label: T`2 pixels` },
237
- { value: 3, label: T`3 pixels` },
238
- { value: 4, label: T`4 pixels` },
239
- { value: 5, label: T`5 pixels` },
240
- { value: 6, label: T`6 pixels` }
241
- ],
242
- onChange: this.handleLineWidthChange
243
- })
244
- )
245
- }
246
-
247
- renderPolygonBorderColor() {
248
- if (!this.props.design.axes.geometry) {
249
- return
250
- }
251
-
252
- return R(
253
- "div",
254
- { className: "mb-3" },
255
- R("label", { className: "text-muted" }, T`Polygon border color (blank for same as fill color)`),
256
- R(
257
- "div",
258
- null,
259
- R(ColorComponent, {
260
- color: this.props.design.polygonBorderColor,
261
- onChange: this.handlePolygonBorderColorChange
262
- })
263
- )
264
- )
265
- }
266
-
267
- renderPolygonFillOpacity() {
268
- if (!this.props.design.axes.geometry) {
269
- return
270
- }
271
-
272
- const opacity = this.props.design.polygonFillOpacity != null ? this.props.design.polygonFillOpacity : 0.25
273
-
274
- return R(
275
- "div",
276
- { className: "mb-3"},
277
- R("label", { className: "text-muted" }, R("span", null, T`Polygon Fill Opacity: ${Math.round(opacity * 100)}%`)),
278
- R(
279
- "div",
280
- { style: { padding: "10px" } },
281
- React.createElement(Rcslider, {
282
- min: 0,
283
- max: 100,
284
- step: 1,
285
- tipTransitionName: "rc-slider-tooltip-zoom-down",
286
- value: opacity * 100,
287
- onChange: this.handlePolygonFillOpacityChange
288
- })
289
- )
290
- )
291
- }
292
-
293
- renderFilter() {
294
- // If no data, hide
295
- if (!this.props.design.axes.geometry) {
296
- return null
297
- }
298
-
299
- return R(
300
- "div",
301
- { className: "mb-3" },
302
- R("label", { className: "text-muted" }, R("span", { className: "fas fa-filter" }), T`Filters`),
303
- R(
304
- "div",
305
- { style: { marginLeft: 8 } },
306
- R(FilterExprComponent, {
307
- schema: this.props.schema,
308
- dataSource: this.props.dataSource,
309
- onChange: this.handleFilterChange,
310
- table: this.props.design.table,
311
- value: this.props.design.filter
312
- })
313
- )
314
- )
315
- }
316
-
317
- renderPopup() {
318
- if (!this.props.design.table) {
319
- return null
320
- }
321
-
322
- return R(EditPopupComponent, {
323
- design: this.props.design,
324
- onDesignChange: this.props.onDesignChange,
325
- schema: this.props.schema,
326
- dataSource: this.props.dataSource,
327
- table: this.props.design.table,
328
- idTable: this.props.design.table,
329
- defaultPopupFilterJoins: PopupFilterJoinsUtils.createDefaultPopupFilterJoins(this.props.design.table)
330
- })
331
- }
332
-
333
- renderHoverOver() {
334
- if (!this.props.design.table) {
335
- return null
336
- }
337
-
338
- return R(EditHoverOver, {
339
- design: this.props.design,
340
- onDesignChange: this.props.onDesignChange,
341
- schema: this.props.schema,
342
- dataSource: this.props.dataSource,
343
- table: this.props.design.table,
344
- idTable: this.props.design.table,
345
- defaultPopupFilterJoins: PopupFilterJoinsUtils.createDefaultPopupFilterJoins(this.props.design.table)
346
- })
347
- }
348
-
349
- render() {
350
- return R(
351
- "div",
352
- null,
353
- this.renderTable(),
354
- this.renderGeometryAxis(),
355
- this.renderColor(),
356
- this.renderSymbol(),
357
- this.renderMarkerSize(),
358
- R(ui.CollapsibleSection, {
359
- label: T`Shape Options`,
360
- labelMuted: true
361
- }, [
362
- this.renderLineWidth(),
363
- this.renderPolygonBorderColor(),
364
- this.renderPolygonFillOpacity(),
365
- ]),
366
- this.renderFilter(),
367
- this.renderPopup(),
368
- this.renderHoverOver(),
369
- this.props.design.table
370
- ? R(ZoomLevelsComponent, { design: this.props.design, onDesignChange: this.props.onDesignChange })
371
- : undefined
372
- )
373
- }
374
- }
@@ -1,165 +0,0 @@
1
- import _ from "lodash"
2
- import React from "react"
3
- const R = React.createElement
4
- import { default as AsyncReactSelect } from "react-select/async"
5
- import { ExprCompiler, Schema } from "@mwater/expressions"
6
- import { ExprUtils } from "@mwater/expressions"
7
- import { JsonQLFilter } from "../JsonQLFilter"
8
- import { QuickfiltersDataSource } from "./QuickfiltersDataSource"
9
-
10
- export interface TextLiteralComponentProps {
11
- value?: any
12
- onChange?: any
13
- schema: Schema
14
- /** See QuickfiltersDataSource */
15
- quickfiltersDataSource: QuickfiltersDataSource
16
- expr: any
17
- index: number
18
- /** true to display multiple values */
19
- multi?: boolean
20
-
21
- /** Filters to add to restrict quick filter data to */
22
- filters?: JsonQLFilter[]
23
- }
24
-
25
- /** Displays a combo box that allows selecting single or multiple text values from an expression
26
- * The expression can be type `text` or `text[]`
27
- */
28
- export default class TextLiteralComponent extends React.Component<TextLiteralComponentProps> {
29
- handleSingleChange = (val: any) => {
30
- const value = val ? val.value || null : null // Blank is null
31
- return this.props.onChange(value)
32
- }
33
-
34
- handleMultipleChange = (val: any) => {
35
- const value = val ? _.pluck(val, "value") : []
36
-
37
- if (value.length > 0) {
38
- return this.props.onChange(value)
39
- } else {
40
- return this.props.onChange(null)
41
- }
42
- }
43
-
44
- getOptions = (input: any, cb: any) => {
45
- // Determine type of expression
46
- const filters = (this.props.filters || []).slice()
47
-
48
- const exprUtils = new ExprUtils(this.props.schema)
49
- const exprType = exprUtils.getExprType(this.props.expr)
50
-
51
- // Create query to get matches
52
- const exprCompiler = new ExprCompiler(this.props.schema)
53
-
54
- if(!this.props.expr.table) {
55
- return
56
- }
57
-
58
- // Add filter for input (simple if just text)
59
- if (exprType === "text") {
60
- if (input) {
61
- filters.push({
62
- table: this.props.expr.table,
63
- jsonql: {
64
- type: "op",
65
- op: "~*",
66
- exprs: [
67
- exprCompiler.compileExpr({ expr: this.props.expr, tableAlias: "{alias}" }),
68
- escapeRegex(input) // Don't use _.escapeRegExp as adds weird backslashes that postgres doesn't like
69
- ]
70
- }
71
- })
72
- }
73
- } else if (exprType === "text[]") {
74
- // Special filter for text[]
75
- if (input) {
76
- filters.push({
77
- table: "values",
78
- jsonql: {
79
- type: "op",
80
- op: "~*",
81
- exprs: [
82
- { type: "field", tableAlias: "{alias}", column: "value" },
83
- "^" + escapeRegex(input) // Don't use _.escapeRegExp as adds weird backslashes that postgres doesn't like
84
- ]
85
- }
86
- })
87
- }
88
- } else {
89
- return
90
- }
91
-
92
- // Execute query
93
- this.props.quickfiltersDataSource.getValues(
94
- this.props.index,
95
- this.props.expr,
96
- filters,
97
- null,
98
- 250,
99
- (err: any, values: any) => {
100
- if (err) {
101
- return
102
- }
103
-
104
- // Filter null and blank
105
- values = _.filter(values, (value) => value)
106
-
107
- return cb(
108
- _.map(values, (value) => ({
109
- value,
110
- label: value
111
- }))
112
- )
113
- }
114
- )
115
- }
116
-
117
- renderSingle() {
118
- const currentValue = this.props.value ? { value: this.props.value, label: this.props.value } : null
119
-
120
- return R(AsyncReactSelect, {
121
- key: JSON.stringify(this.props.filters), // Include to force a change when filters change
122
- placeholder: T`All`,
123
- value: currentValue,
124
- loadOptions: this.getOptions,
125
- onChange: this.props.onChange ? this.handleSingleChange : undefined,
126
- isClearable: true,
127
- defaultOptions: true,
128
- isDisabled: this.props.onChange == null,
129
- noOptionsMessage: () => T`Type to search`,
130
- styles: {
131
- // Keep menu above fixed data table headers
132
- menu: (style) => _.extend({}, style, { zIndex: 2000 })
133
- }
134
- })
135
- }
136
-
137
- renderMultiple() {
138
- const currentValue = this.props.value ? _.map(this.props.value, (v) => ({ value: v, label: v })) : null
139
-
140
- return R(AsyncReactSelect, {
141
- placeholder: T`All`,
142
- value: currentValue,
143
- key: JSON.stringify(this.props.filters), // Include to force a change when filters change
144
- isMulti: true,
145
- loadOptions: this.getOptions,
146
- defaultOptions: true,
147
- onChange: this.props.onChange ? this.handleMultipleChange : undefined,
148
- isClearable: true,
149
- isDisabled: this.props.onChange == null,
150
- noOptionsMessage: () => T`Type to search`,
151
- styles: {
152
- // Keep menu above fixed data table headers
153
- menu: (style) => _.extend({}, style, { zIndex: 2000 })
154
- }
155
- })
156
- }
157
-
158
- render() {
159
- return R("div", { style: { width: "100%" } }, this.props.multi ? this.renderMultiple() : this.renderSingle())
160
- }
161
- }
162
-
163
- function escapeRegex(s: any) {
164
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
165
- }