Shiny Contest Submission: Interactive Mapping of US Strikes

Here is my entry to the Shiny contest. Using data from the Bureau of Labor Statistics, I mapped US strike data from 1993-2017. This app is partially designed to show how different htmlwidgets can interact with each other in a Shiny application. I used Dean Attali's 'timevis' package, 'Leaflet', and a 'Echarts4R'

You can interact with the timeline by zooming in and out and dragging, and when you select an item in the timeline, the map will zoom to the location of the strike. You can also select on a marker on the map and the map will zoom as well, and the timeline will adjust to show the corresponding strike event.

NOTE: For some reason it doesn't seem to run well in Chrome, but it works in Microsoft Edge and may work in other browsers.

You can see the app here:

You can see the code on RStudio cloud here:

The files I used are also available here - I did some pre-loading as I needed to geocode the areas and I didn't want that to be in the script of the Shiny app.




The map looks really nice - however, the scale is not clearly visible if you choose a far-east location (e.g. Central New Jersey, NJ). In such cases, the scale appears on top of the ocean which is black because of which it cannot be read clearly. Is it possible to change the color of the ocean?

Good point! I should have mentioned that I made the scale draggable so you can move it as needed.

Good idea.

It'd be nice to have the dates of each strike in the tooltips. You're probably still working on the timeline, but that doesn't really give a sense of when each strike occurred, either.

What do the colors of the dots signify?

The app doesn't work in Firefox, as well, though my Firefox settings differ greatly from the defaults. Someone else should confirm. Works fine in Edge. Doesn't work in Chrome.

1 Like

Thanks for the suggestion! I added a tooltip showing the start and end date of each strike. I am confused on why it works in Edge but not others - perhaps the code could be written more efficiently.


This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.