Closed danrademacher closed 4 years ago
Here is the panel, and its filtering behavior for the statistics and the map. This is currently implemented in the gda-vehiclefilter
branch.
SCREENSHOTS
BEHAVIOR NOTES
When no options are selected, no vehicle-involvement filter is applied.
Like the crash type (injury/fatality) filter, this new vehicle-involvement filter is an OR clause. That is to say, adding options will expand the range of results. Crashes which involve a motorcycle AND/OR involve a bicycle AND/OR involve a scooter.
That's as opposed to ANDing them, by which adding options will narrow the range of results to find combinations. Crashes involving a bicycle AND a car. I could see an argument for preferring this behavior in order to find combinations. Of course, beyond 2 selections one approaches very specific and very few matches, e.g. Crashes involving a bicycle and a car and a motorcycle.
This is working well locally for me. I did add the word "Type" to the Vehicle Type panel title.
I do notice that the behavior of the Crash Type and Vehicle Type panels is slightly different, where the Crash Type is a true set of toggle, which load in the "ON" position and if you turn them all off, blank map.
Vehicle Type loads in the OFF position and as you describe, no filter is applied:
While both approaches have their merits, since the Crash Type has been in the app and set the pattern, ideally we would make the Vehicle Type panel work the same way, so the loaded state would look like this:
⬆️ Per https://github.com/GreenInfo-Network/nyc-crash-mapper/issues/104#issuecomment-572820328 the Vehicle Type panel is now all-on by default, so applying a filter of "any of these 8" by default.
Note that at present 23,410 crash entries in the database which are false for all 8 flags, so would now be omitted from this default view. This may cause some discrepancies in a detailed count of records of CrashMapper vs Socrata. I will bring that up in https://github.com/GreenInfo-Network/nyc-crash-mapper-etl-script/issues/22 for further discussion at the ETL level.
The data cleanup in https://github.com/GreenInfo-Network/nyc-crash-mapper-etl-script/issues/22 went well, and now we have 22,500-ish records with an empty vehicle_type
array.
Per discussion, let's rework the Other button as "Other / Unspecified" The SQL clause would be hasvehicle_other = true OR no to the other 7
This would effectively "fill in the blank" of crashes with unspecified vehicle types, but would leave the underlying data intact for later evaluation, re-classification, or a change in behavior.
Reviewed and ready to deploy, but holding until matching filter in Chart view is also functional. (https://github.com/GreenInfo-Network/nyc-crash-mapper-chart-view/issues/108)
e0dabcc -- The Trend, Compare, and Ranks hyperlinks at the top, now include the vehicle-type URL params. These match the format used in https://github.com/GreenInfo-Network/nyc-crash-mapper-chart-view/issues/108 and are confirmed to correctly load all three chart views with the same vehicle filter selected.
This is for the gda-vehiclefilter
branch. Let's give it a test, and see whether #104 and https://github.com/GreenInfo-Network/nyc-crash-mapper-chart-view/issues/108 are working, so they may be deployed and closed.
Deployed.
Over in https://github.com/GreenInfo-Network/nyc-crash-mapper-etl-script/issues/22, we started pulling in and allocating Vehicle Type data. Now we need to add a filter for it.
Basically this:
In context of the whole sidebar on the map:
It fits between current "Filter by Type" and "Data", and then rename the label on "Filter by Type" to "Filter by Crash Type"