You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating the Pre-Election and additional reporting date charts for more sortability.
On the current (or as of 2020 pre-election and 2021 special election) charts, the only way to filter the chart is to choose a state from a drop down menu. The goal was to see if there was a way to sort the table chronologically as well (Public Records produces a PDF demonstrating the alphabetical and chronological reporting dates (https://www.fec.gov/resources/cms-content/documents/2020pdates.pdf)). This applies to the Congressional pre-election report table, as well as the coordinated communication, electioneering communication, federal election activity, and independent expenditure reporting tables.
Completion criteria
Create sortability on both election date and state for election tables
Test extra carefully - it's very important not to scramble the data
The text was updated successfully, but these errors were encountered:
djgarr
changed the title
Updates to the Pre-Election and additional reporting date charts
Update(s) to the Pre-Election and additional reporting date charts
Apr 29, 2021
kathycarothers
changed the title
Update(s) to the Pre-Election and additional reporting date charts
Front end - Update(s) to the Pre-Election and additional reporting date charts
Jul 29, 2021
lbeaufort
changed the title
Front end - Update(s) to the Pre-Election and additional reporting date charts
Make the Pre-Election and additional reporting date charts sortable
Jul 29, 2021
While it's possible to add sort to a basic table with JS, the existence of the hidden footnote rows adds a layer of complexity making this very complicated, if not impossible. Given the complications involved, I think it's worth evaluating the priority for implementing this before trying to move forward.
Created two partially working prototypes for the the Congressional Pre-Reporting table but these are still not complete and only apply to that one table on a FullWidth page. The issue author, @djgarr has said that this feature is currently a nice-to-have and not a must-have so we agreed to shelve this work for now.
The possible approaches, for future reference, are to
Export reporting-dates-tables.js as a module (instead of a "page)" and include jQuery datatables node-module via a require variable. Then apply datatables to the table in the script and enable its sorting functionality. (this one also requires making the footnotes to be added on-click instead of the current way of adding when the table loads(with hide/show on-click), so that there are no colspans that confuse Jq Datatables sorting functionality on-load)
var $ = require('jquery');
require('datatables.net');
require('datatables.net-responsive');
var moment = require('moment');
...
$(this.dates_table).DataTable( { ....
```
Use a native JS table sort function. Will likely also require making the footnotes to be added on-click instead of when the table loads so that there are no colspans that might confuse sorting functionality on-load)
@johnnyporkchops Has a version of the JS which uses new logic to add footnotes on-click, instead of the current on-load(with hide/show)
Summary
Updating the Pre-Election and additional reporting date charts for more sortability.
On the current (or as of 2020 pre-election and 2021 special election) charts, the only way to filter the chart is to choose a state from a drop down menu. The goal was to see if there was a way to sort the table chronologically as well (Public Records produces a PDF demonstrating the alphabetical and chronological reporting dates (https://www.fec.gov/resources/cms-content/documents/2020pdates.pdf)). This applies to the Congressional pre-election report table, as well as the coordinated communication, electioneering communication, federal election activity, and independent expenditure reporting tables.
Completion criteria
The text was updated successfully, but these errors were encountered: