What Happened
When downloading the Tabulation Report in PDF format for collision data that covers more than ~15 years, the year-by-year breakdown overflows the page.
What Should Happen
Year-by-year breakdowns covering more than ~15 years should be truncated to the most recent ~15 years, such that they are guaranteed to fit on the page.
To Reproduce
Steps to reproduce the bug:
Go to any location with lots of collisions (e.g. expressway ramps, major intersections, downtown core intersections);
Click "View Reports" in the collisions section.
Select the "Tabulation Report".
Click "Download" > "PDF".
Open the resulting PDF and scroll down to the "Year of Collision" table.
At this point, the year-by-year breakdown should overflow the page, with several of its rows rendered on the next page (which is otherwise blank except for the standard header / footer).
Here we see that 1985-2002 (18 years) fit on the first page.
Additional Notes
When truncating, we may wish to include a category covering all previous years (e.g. "pre-YYYY" or "YYYY and earlier"), to avoid losing data.
In combination with #468 , this suggests a general truncation strategy:
include null in orderX, orderY;
if limit !== null && limit < orderY.length, show top limit - 1 values from orderY and lump orderY.slice(limit - 1) into a single "Other" bucket.
This will likely require additional wrapper functions / handling around the current implementation for cross-tabulation dimensions - e.g. some kind of CrossTabulationDimension object that handles all the relevant mechanics.
The year-by-year use case here also suggests a need for the "Other" bucket name to be configurable.
What Happened When downloading the Tabulation Report in PDF format for collision data that covers more than ~15 years, the year-by-year breakdown overflows the page.
What Should Happen Year-by-year breakdowns covering more than ~15 years should be truncated to the most recent ~15 years, such that they are guaranteed to fit on the page.
To Reproduce Steps to reproduce the bug:
At this point, the year-by-year breakdown should overflow the page, with several of its rows rendered on the next page (which is otherwise blank except for the standard header / footer).
Screenshots From https://move.intra.dev-toronto.ca/view/location/2/13465043/reports/collision:
Here we see that 1985-2002 (18 years) fit on the first page.
Additional Notes When truncating, we may wish to include a category covering all previous years (e.g. "pre-YYYY" or "YYYY and earlier"), to avoid losing data.
In combination with #468 , this suggests a general truncation strategy:
null
inorderX
,orderY
;limit !== null && limit < orderY.length
, show toplimit - 1
values fromorderY
and lumporderY.slice(limit - 1)
into a single "Other" bucket.This will likely require additional wrapper functions / handling around the current implementation for cross-tabulation dimensions - e.g. some kind of
CrossTabulationDimension
object that handles all the relevant mechanics.The year-by-year use case here also suggests a need for the "Other" bucket name to be configurable.