There and Back Again competition entry https://shiny.petras.space/commute/
rstats
rshiny
census
competition
leaflet
javascript
stats-nz

extras.R 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. extracss <- "
  2. html, body {
  3. width:100%;
  4. height:100%
  5. }
  6. #map {
  7. height: 100% !important;
  8. position: absolute !important;
  9. top: 0;
  10. left: 0;
  11. }
  12. #loading {
  13. cursor: progress !important;
  14. }
  15. #loading p {
  16. border-radius: 5px;
  17. background-color: rgba(255, 255, 255, 0.8);
  18. padding: 6px 8px;
  19. box-shadow: 0 0 15px rgba(0,0,0,0.2);
  20. font-size: 1.5em;
  21. font-weight: bold;
  22. }
  23. #mapcontrol, #infobuttoncontainer, #infopanel {
  24. background-color: rgba(255, 255, 255, 0.8);
  25. border-radius: 5px;
  26. box-shadow: 0 0 15px rgba(0,0,0,0.2);
  27. padding: 6px 8px;
  28. font: 14px/16px Arial, Helvetica, sans-serif;
  29. }
  30. #infopanel {
  31. display: none;
  32. padding: 30px;
  33. z-index: 1001;
  34. }
  35. #lochtml ul {
  36. padding-left: 15px;
  37. }
  38. .radio label span p {
  39. margin-top: 3px;
  40. margin-bottom: 0px;
  41. }
  42. .leaflet-container {
  43. background-color: #84e1e1;
  44. }
  45. #infobuttoncontainer {
  46. margin-bottom: 16px;
  47. z-index: 1002;
  48. }
  49. #infobuttoncontainer .shiny-input-container,
  50. #infobuttoncontainer div div {
  51. margin-right: 0px !important;
  52. margin-bottom: 0px !important;
  53. }
  54. "
  55. attribhtml <- '
  56. <a href="http://leafletjs.com"
  57. title="A JS library for interactive maps">Leaflet</a> | <a
  58. href="http://datafinder.stats.govt.nz/data/category/census/2018/commuter-view/"
  59. title="Source data">
  60. StatsNZ</a> | <a href="http://petras.space/page/cv/" title="Hire me!">
  61. Petra Lamborn</a> | Numbers subject to <a
  62. href="http://archive.stats.govt.nz/about_us/legisln-policies-protocols/
  63. confidentiality-of-info-supplied-to-snz/safeguarding-confidentiality.aspx"
  64. title="A method of preserving confidentiality and anonymity">
  65. random rounding</a>
  66. '