Skip to content

Feat: District landing page #207

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

lalver1
Copy link
Member

@lalver1 lalver1 commented Aug 4, 2025

Closes #205, closes #202

This PR updates the District landing page, e.g. /districts/7, and uses a full-width (and height) design for the 5-min data visualization. It uses the method laid out in the full-width design spike (using the container-fluid class) and sets the Streamlit page configuration to a wide layout.

lalver1 added 3 commits August 4, 2025 15:44
as part of the district landing page feature, we set the default
station to None to show a summary for all stations in the district.
this requires not displaying the lane selector until a station is
selected.
reorganize map components to accomodate a new district summary view
pages in the Django app are set to use a full width layout. the
height of the div containing the streamlit app is also set to full
height. the streamlit app (page) is configured to use a wide layout.
@lalver1 lalver1 self-assigned this Aug 4, 2025
@lalver1 lalver1 force-pushed the feat/district-landing-page branch from 1b477d6 to 8bdd12b Compare August 4, 2025 15:49
Copy link

github-actions bot commented Aug 4, 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 August 4, 2025 22:52
@lalver1 lalver1 requested a review from a team as a code owner August 4, 2025 22:52
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.

Nice!!

The District-level metadata is a great addition, meaning the user sees something right away when they land on a district page 👍

Image

I was seeing a little strangeness when going from District > Station > back to District (e.g. deselecting all Stations). The "ghost" info was still visible from the prior station selection:

Image

Not sure if there is a way to avoid that with placeholders or otherwise?

if a station is selected and then de-selected, some information
associated with the station is not cleared, i.e., Absolute Post Mile
and Lanes stay greyed out, Streamlit's sign of "stale data". it turns
out that the st.empty() method sometimes needs some time to take effect
on the front-end. adding a small delay ensures that the DOM is ready
for st.empty().
@lalver1
Copy link
Member Author

lalver1 commented Aug 5, 2025

Thanks for catching that @thekaveman!

This behavior is strange because we are using the same strategy as error_placeholder and plot_placeholder but the info box to the right of the map is not clearing out. After some troubleshooting, it turns out that st.empty() sometimes takes some time to take effect. The solution in 529adbe is not very nice (st.empty() should work consistently) but it solves the issue and is just one line.

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.

Update District landing page for District-wide metadata Use a full-width design for the 5-min data visualization
2 participants