From e6de86bc48801b67f5bc28aa1ba11013e9e110db Mon Sep 17 00:00:00 2001 From: Andy Rothwell Date: Wed, 27 Sep 2023 13:53:05 -0400 Subject: [PATCH] uses @phila/vue-datafetch which allows group by in http fetch nearby queries --- package-lock.json | 41 +++++++++++++-------------- package.json | 2 +- src/data-sources/nearby-violations.js | 1 + src/topics/nearby.js | 9 +++--- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5693d91..87fb736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4219,9 +4219,9 @@ "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==" }, "@mapbox/mapbox-gl-draw": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-draw/-/mapbox-gl-draw-1.4.2.tgz", - "integrity": "sha512-Zvl5YN+tIuYZlzPmuzOgkoJsZX6sHMQsnFI+O3ox8EwYkpLO2w0U2FvVhQuVnq1Yys12x6UnF+0IPoEdBy2UfA==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-draw/-/mapbox-gl-draw-1.4.3.tgz", + "integrity": "sha512-03qIJgyGmm0IoTZbV/cfODru9jRGogi4LcQ3maxIJDKccq1gY3ofgt2UYPkeU143ElxitZahEythNQv1NpsLhg==", "requires": { "@mapbox/geojson-area": "^0.2.2", "@mapbox/geojson-extent": "^1.0.1", @@ -4329,12 +4329,12 @@ } }, "@phila/mapboard": { - "version": "git+https://github.com/CityOfPhiladelphia/mapboard.git#0c2c213e5e06818205bd24fbbbe6d6202ac56c0f", - "from": "git+https://github.com/CityOfPhiladelphia/mapboard.git#0c2c213", + "version": "git+https://github.com/CityOfPhiladelphia/mapboard.git#781812734ad666864188638be832b7bcfa304d17", + "from": "git+https://github.com/CityOfPhiladelphia/mapboard.git#7818127", "requires": { "@mapbox/geo-viewport": "^0.5.0", "@phila/vue-comps": "git+https://github.com/CityOfPhiladelphia/phila-vue-comps.git#4c3f8a20f80a4959fa10cd38b5641330b066ab9f", - "@phila/vue-datafetch": "2.2.14", + "@phila/vue-datafetch": "git+https://github.com/CityOfPhiladelphia/phila-vue-datafetch.git#3970aea30bca316fdb33689e96bea5e5eb75c603", "@phila/vue-mapping": "3.1.16", "vue": "^2.7.10", "vue-i18n": "^8.22.0", @@ -4362,9 +4362,8 @@ } }, "@phila/vue-datafetch": { - "version": "2.2.14", - "resolved": "https://registry.npmjs.org/@phila/vue-datafetch/-/vue-datafetch-2.2.14.tgz", - "integrity": "sha512-9DmrCz7H+ZTz+5kiUBWJl3XL5eYdTD4l4Q5OI3tGJ/hDKdgeIvfYw5lgud749cSwhfLbqemqTLQbv6NA0hpOOA==", + "version": "git+https://github.com/CityOfPhiladelphia/phila-vue-datafetch.git#3970aea30bca316fdb33689e96bea5e5eb75c603", + "from": "git+https://github.com/CityOfPhiladelphia/phila-vue-datafetch.git#3970aea30bca316fdb33689e96bea5e5eb75c603", "requires": { "@turf/turf": "^6.5.0", "airtable": "^0.8.1", @@ -6048,9 +6047,9 @@ "integrity": "sha512-D0lgCq+3VWV85ey1MZVkE8ZveyuvW5VAfuahVTQRpXFQTxw03SuIf1/K4UQ87MMIXVKzpFjXFiFMZzLj2kU+iA==" }, "@types/mapbox__vector-tile": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.0.tgz", - "integrity": "sha512-kDwVreQO5V4c8yAxzZVQLE5tyWF+IPToAanloQaSnwfXmIcJ7cyOrv8z4Ft4y7PsLYmhWXmON8MBV8RX0Rgr8g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.1.tgz", + "integrity": "sha512-RpwGE57xM4a/YCH6XWzfcPVRPAu/jiCll0bEGRn6a4iubN2k4xZizskQoRj8fuXyo9BpI7F3bwz3uxs0pWbGNw==", "requires": { "@types/geojson": "*", "@types/mapbox__point-geometry": "*", @@ -6094,9 +6093,9 @@ "dev": true }, "@types/pbf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.2.tgz", - "integrity": "sha512-EDrLIPaPXOZqDjrkzxxbX7UlJSeQVgah3i0aA4pOSzmK9zq3BIh7/MZIQxED7slJByvKM4Gc6Hypyu2lJzh3SQ==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.3.tgz", + "integrity": "sha512-hw6bDMjvm+QTvEC+pRLpnTknQXoPu8Fnf+A+zX9HB7j/7RfYajFSbdukabo3adPwvvEHhIMafQl0R0Tpej7clQ==" }, "@types/qs": { "version": "6.9.7", @@ -11273,9 +11272,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.1.tgz", + "integrity": "sha512-hC2v6p8ZSI/W0HUzh3V8C5g+NwSKzKPtJwSpTjwl0o297GP9+ZLQSkdvHz46CM3LqyoXxq+5G9komY+eSqSO0g==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -16928,9 +16927,9 @@ }, "dependencies": { "@types/geojson": { - "version": "7946.0.10", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz", - "integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==" + "version": "7946.0.11", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.11.tgz", + "integrity": "sha512-L7A0AINMXQpVwxHJ4jxD6/XjZ4NDufaRlUJHjNIFKYUFBH1SvOW+neaqb0VTRSLW5suSrSu19ObFEFnfNcr+qg==" } } }, diff --git a/package.json b/package.json index 7d7895e..44a6106 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "lintFix": "vue-cli-service lint --fix" }, "dependencies": { - "@phila/mapboard": "https://github.com/CityOfPhiladelphia/mapboard#0c2c213", + "@phila/mapboard": "https://github.com/CityOfPhiladelphia/mapboard#7818127", "accounting": "^0.4.1", "vue": "^2.7.10" }, diff --git a/src/data-sources/nearby-violations.js b/src/data-sources/nearby-violations.js index 3527769..d2d725e 100644 --- a/src/data-sources/nearby-violations.js +++ b/src/data-sources/nearby-violations.js @@ -7,5 +7,6 @@ export default { dateMinNum: 1, dateMinType: 'year', dateField: 'casecreateddate', + groupby: 'casenumber, casecreateddate, caseprioritydesc, casestatus, address', }, }; diff --git a/src/topics/nearby.js b/src/topics/nearby.js index caf186c..2a7219c 100644 --- a/src/topics/nearby.js +++ b/src/topics/nearby.js @@ -375,7 +375,7 @@ export default { return itemRow; }); let rows2 = rows.filter((datum) => datum.typeofwork == 'NEW CONSTRUCTION'); - console.log('data:', data, 'rows2:', rows2, 'rows:', rows); + // console.log('data:', data, 'rows2:', rows2, 'rows:', rows); return rows2; }, }, @@ -622,9 +622,10 @@ export default { }, }, { - label: 'Type', + label: 'Status', value: function(state, item) { - return item.typeofwork; + // return item.casestatus; + return ''+item.casestatus+''; // if (item.media_url) { // return ''+item.service_name+''; // } @@ -651,7 +652,7 @@ export default { return itemRow; }); let rows2 = rows.filter((datum) => datum.caseprioritydesc == 'IMMINENTLY DANGEROUS'); - // console.log('data:', data, 'rows2:', rows2, 'rows:', rows); + console.log('violations data:', data, 'rows2:', rows2, 'rows:', rows); return rows2; }, },