Skip to content

Feat: 5-min data visualization UI #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 1, 2025
Merged

Feat: 5-min data visualization UI #201

merged 9 commits into from
Aug 1, 2025

Conversation

lalver1
Copy link
Member

@lalver1 lalver1 commented Jul 29, 2025

Closes #183

This PR builds out the UI (mostly Streamlit components) for the 5-min data visualization for traffic stations. It adds "map and station summary" and "5-min traffic data visualization" modules that can be imported by a Streamlit app. A small map of the station's location along with its metadata is shown on the UI. Data can be selected by quantity (speed, volume, occupancy), day, and lane. One or two quantities can be visualized in a line graph.

Follow-ups

@lalver1 lalver1 self-assigned this Jul 29, 2025
Copy link

github-actions bot commented Jul 29, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pems_data/src/pems_data/services
  stations.py
Project Total  

This report was generated by python-coverage-comment-action

@lalver1 lalver1 marked this pull request as ready for review July 29, 2025 21:29
@lalver1 lalver1 requested a review from a team as a code owner July 29, 2025 21:29
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this is looking really good

  • The introduction of pems_streamlit/components is a nice organization!
  • Renaming stations/ to districts/ makes a lot of sense!

I left a comment about caching -- I had misunderstood the data previously, and added a ttl that doesn't make a lot of sense. Maybe we can increase that as part of this PR?

I think this is a good start and gets us some visualizations and new page elements to play with. I do believe there is more work to do to get these District landing pages working the way we ultimately want, so I filed #205 and added some comments to #202 as well.

In a follow-up / as we evolve more components, I might suggest a further organization into e.g.

  • components/maps/...
    • e.g. components/maps/station_summary.py
  • components/plots/...
    • e.g. components/plots/5m_traffic_data.py
  • etc.

@lalver1 lalver1 force-pushed the feat/5-min-ui branch 2 times, most recently from 3e7dab2 to 810f4dd Compare July 31, 2025 14:47
@lalver1
Copy link
Member Author

lalver1 commented Jul 31, 2025

Thanks for the review @thekaveman! I agree that there's more work to do, I'll work on the followups next 👍

I guess we can probably get the AWS Redis PR merged first, then I can rebase this PR and after that get it merged if all the comments in this PR have been addressed.

@lalver1
Copy link
Member Author

lalver1 commented Aug 1, 2025

This is ready for a re-review whenever you get a chance @thekaveman, thanks!

thekaveman
thekaveman previously approved these changes Aug 1, 2025
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

One comment, you can decide if you want to address or not.

lalver1 added 7 commits August 1, 2025 18:05
ensure that the required parameters are set before proceeding
with the visualization
the data table is not needed in the UI at this point
remove "greyed out" plot and error messages from the previous run. to
ensure only one plot or error message is shown, draw it inside a
dedicated placeholder.
place app_stations.py under districts to match pems_web and
to use the more accurate streamlit app name "districts--stations"
setting the cache to 1 hour seems like a good balance between
performance and data freshness.
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 📈 📊

@lalver1 lalver1 merged commit adfbab0 into main Aug 1, 2025
9 checks passed
@lalver1 lalver1 deleted the feat/5-min-ui branch August 1, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build User Interface for 5-min data visualization
2 participants