7/10/24
This work-in-progress repo develops the Jacksonville Tributary's interactive legislative dashboard based on my revised data pipeline.
Here's the development version of the web app, as described in this repo.
The app consists of the following visualizations:
Tab | Intended Audience | Description |
---|---|---|
District Context | voters in Florida's August primary | Compare each representative's partisan voting patterns against their demographic and electoral context. |
Voting Patterns | data-savvy journalists at Florida partner outlets | heatmap of voting patterns on contested bills by party, chamber, and session year |
The app consists of the following R components:
- app.R: Orchestrates the Shiny app by setting up the user interface, server logic, and handling reactive expressions for the Shiny web app.
- server1_partisanship.R: Application logic for voting patterns app.
- server3_district_context.R: Application logic for district context app.
- ui.R: Defines the Shiny app user interface.
See data pipeline repo for a detailed overview of data used in these apps.
In June & July, I re-architected the data pipeline in order to speed up development and improve maintainability of this web app. The updated data source eliminates record duplicates, handles historically-changing data, and facilitates filtering and sorting.
- Read data from data pipeline directly from Postgres
- Added stylesheet to ensure consistent formatting across tabs
- Modularized code (previously all in app.R) into separate app servers and ui.R
This is a new app, incorporating some partisanship data from the Voting Patterns dashboard in addition to newly integrated census and electoral data.
See development notes for info on work in progress on this app.
Adapted from pantazi's Voting Patterns Analysis, with the following improvements:
- Hyperlinks to legislators' Ballotpedia pages and bills' LegiScan pages.
- Sorting options added for legislators (by partisanship, name, district number) and roll calls (by bill number, partisanship).
- Legend displays heatmap color samples, more detail on methodology, and adds count of legislators and roll-call votes in filtered views.
- Legislators (including district #) are now displayed on Y-axis
- Tooltips displays vote by party and improved formatting.
- Filter added for bill category. Note that this currently includeds only a placeholder "education" category with a small number of bills. More work is required to populate a cross-reference table assigning bills to categories.
See development notes for info on work in progress on this app.
├── app.R
├── data
│ └── all_data.rds
├── read_data.R
├── save_data.R
├── servers
│ ├── server1_partisanship.R
│ ├── server2_leg_activity.R
│ └── server3_district_context.R
├── ui.R
└── www
│ └── styles.css
fl-legislation-app-postgres
├─ .git
│ ├─ COMMIT_EDITMSG
│ ├─ config
│ ├─ description
│ ├─ FETCH_HEAD
│ ├─ HEAD
│ ├─ hooks
│ │ ├─ applypatch-msg.sample
│ │ ├─ commit-msg.sample
│ │ ├─ fsmonitor-watchman.sample
│ │ ├─ post-update.sample
│ │ ├─ pre-applypatch.sample
│ │ ├─ pre-commit.sample
│ │ ├─ pre-merge-commit.sample
│ │ ├─ pre-push.sample
│ │ ├─ pre-rebase.sample
│ │ ├─ pre-receive.sample
│ │ ├─ prepare-commit-msg.sample
│ │ ├─ push-to-checkout.sample
│ │ └─ update.sample
│ ├─ index
│ ├─ info
│ │ └─ exclude
│ ├─ logs
│ │ ├─ HEAD
│ │ └─ refs
│ │ ├─ heads
│ │ │ ├─ master
│ │ │ └─ pants-update
│ │ └─ remotes
│ │ └─ origin
│ │ ├─ ap
│ │ ├─ backup
│ │ │ └─ app1-3cols
│ │ ├─ develop
│ │ ├─ feature
│ │ │ └─ weight-elec
│ │ ├─ HEAD
│ │ ├─ master
│ │ ├─ pants-update
│ │ └─ staging
│ ├─ objects
├─ .gitattributes
├─ .github
│ └─ workflows
│ └─ azure-deploy.yml
├─ .gitignore
├─ .Rbuildignore
├─ app.json
├─ app.R
├─ config.yml
├─ Dockerfile
├─ fl-legislation-app-postgres.Rproj
├─ init.R
├─ README.md
├─ read_data.R
├─ rsconnect
│ └─ shinyapps.io
│ └─ mockingbird
│ └─ fl-leg-app-postgres.dcf
├─ run.R
├─ save_data.R
├─ servers
│ ├─ server1_vote_patterns.R
│ ├─ server2_leg_activity.R
│ ├─ server3_district_context.R
│ ├─ server4_partisanship_scatterplot.R
│ ├─ server5_legislator_lookup.R
│ └─ voting_history_module.R
├─ ui.R
└─ www
└─ styles.css