CityofToronto / bdit_flashcrow

Working repository for MOVE, a project to modernize transportation data systems at the City of Toronto.
MIT License
9 stars 2 forks source link

Tabulation report: year-by-year breakdown overflows page #469

Closed candu closed 4 years ago

candu commented 4 years ago

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:

  1. Go to any location with lots of collisions (e.g. expressway ramps, major intersections, downtown core intersections);
  2. Click "View Reports" in the collisions section.
  3. Select the "Tabulation Report".
  4. Click "Download" > "PDF".
  5. 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).

Screenshots From https://move.intra.dev-toronto.ca/view/location/2/13465043/reports/collision: image

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:

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.

candu commented 4 years ago

Closed by #488 .