Skip to content
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

Custom EPA CSS conflicts with usability of leaflet, plotly #52

Closed
ehinman opened this issue May 8, 2023 · 3 comments · Fixed by #96
Closed

Custom EPA CSS conflicts with usability of leaflet, plotly #52

ehinman opened this issue May 8, 2023 · 3 comments · Fixed by #96
Assignees
Labels
bug Something isn't working

Comments

@ehinman
Copy link
Contributor

ehinman commented May 8, 2023

Describe the bug
The leaflet map in the overview page is hard to drag and zoom in to. The points appear to move in a delayed fashion when zooming in/out panning. Additionally, in plotly plots, the hover info flies in from the left of the plot, and the text becomes separated from the bubble, flying to varying heights above the bubble itself.

To Reproduce
Steps to reproduce the behavior:

  1. Start Shiny app
  2. Upload example data
  3. Go to overview map and try zooming or grabbing the map and dragging, go to Explore page and build some plotly figures and try hovering over a point or box.

Expected behavior
Map should update more quickly.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
This is a problem with some of the styling contained here: https://www.epa.gov/themes/epa_theme/css/styles.css?r6lsex
This css info is contained on line 94 of the epa_markup.R file: https://github.com/USEPA/TADAShiny/blob/develop/R/epa_markup.R

@ehinman ehinman changed the title Map in overview page is slow and hard to work with Custom EPA CSS conflicts with usability of leaflet, plotly Aug 18, 2023
@ehinman
Copy link
Contributor Author

ehinman commented Aug 24, 2023

From Brad and Kiki - https://www.epa.gov/themes/epa_theme/pattern-lab/?p=pages-standalone-template This is the theme template we should use. I tried substituting it into shiny and was having issues. I'm sure someone could handily make this change!

@cristinamullin cristinamullin assigned triphook and unassigned triphook Aug 28, 2023
@cristinamullin
Copy link
Collaborator

cristinamullin commented Sep 7, 2023

Commenting out following line in epa_markup.R file (for now):

# commenting out because of plotly conflicts. for future debugging, note that js files also tend to cause issues - Hui discussion)
# tags$link(rel = "stylesheet", media = "all", href = "https://www.epa.gov/themes/epa_theme/css/styles.css?r6lsex"),

Updating following lines with new template Brad provided:

# tags$meta(property = "og:url", content = "https://www.epa.gov/themes/epa_theme/pattern-lab/.markup-only.html"),
# tags$link(rel = "canonical", href = "https://www.epa.gov/themes/epa_theme/pattern-lab/.markup-only.html"),
# tags$link(rel = "shortlink", href = "https://www.epa.gov/themes/epa_theme/pattern-lab/.markup-only.html"),
# tags$meta(property = "og:url", content = "https://www.epa.gov/themes/epa_theme/pattern-lab/.markup-only.html"),
tags$meta(property = "og:url", content = "https://www.epa.gov/themes/epa_theme/pattern-lab/?p=pages-standalone-template"),
tags$link(rel = "canonical", href = "https://www.epa.gov/themes/epa_theme/pattern-lab/?p=pages-standalone-template"),
tags$link(rel = "shortlink", href = "https://www.epa.gov/themes/epa_theme/pattern-lab/?p=pages-standalone-template"),
tags$meta(property = "og:url", content = "https://www.epa.gov/themes/epa_theme/pattern-lab/?p=pages-standalone-template"),

cristinamullin added a commit that referenced this issue Sep 7, 2023
comment out issue line and update pattern lab theme, see: #52
@cristinamullin cristinamullin added the bug Something isn't working label Sep 7, 2023
@cristinamullin cristinamullin self-assigned this Sep 7, 2023
@cristinamullin cristinamullin linked a pull request Sep 7, 2023 that will close this issue
@cristinamullin
Copy link
Collaborator

cristinamullin commented Oct 16, 2023

Here is the current state of this issue:

This issue is related to the EPA banner. I have tried to fix on my own but it requires CSS/HTML and R Shiny experience to troubleshoot.
fix-epa-style uses the current styles.css file downloaded from here: https://www.epa.gov/themes/epa_theme/pattern-lab/patterns/pages-standalone-template/pages-standalone-template.rendered.html.
o In this version, plotly and leaflet maps and plots do not work correctly unless I remove the .css file completely. Because this is the case even on my laptop, I think we can rule-out any buildtime or containerization issues. The culprit may be the sequencing of when the overall page styles are computed on page load versus when the styles invoked by leaflet and plotly are computed.

  • We may be able to edit the css file to fix this issue. ... or We might be able to sidestep this issue by having ERG create a basic HTML page, apply the EPA header/footer/etc to that page, and then embed the app's UI within an HTML element within that page. Doing so would separate the two sources of styles (I think).

triphook pushed a commit that referenced this issue May 16, 2024
comment out issue line and update pattern lab theme, see: #52
triphook pushed a commit that referenced this issue May 16, 2024
comment out issue line and update pattern lab theme, see: #52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants