Hack the Survey

As always, the 80:20 rule was proved true when I got the map up with the basic info the following day, but being a perfectionist (with a small child and a few other project on the go), it has taken me quite a bit longer to show it off but here it is:
2017 Australian Marriage Law Postal Survey - Results Map
(The site is hosted on shinyapps.io so hopefully it doesn't run out of server time)
(The site is hosted on shinyapps.io so hopefully it doesn't run out of server time)
So I'm actually hoping it isn't finished, there are a number of other thing I would like to continue adding:
- More census data sets
- Improved mobile/touch device support
- Change the layout
- Improved loading speed
- Plot formatting and grouping to improve readability
Just very briefly, I know that a lot of people have been hurt or angered by the survey so I hope this isn't seen as taking side or bringing up bad memories, my intention was to build a tool for examining the data and inspiring people to do more with their data. So along those same lines, if people are commenting, it would be great if you could keep it about the tech, the data and the analysis. Thanks!
Technical Details
For those who that are here for the technical details and challenges, here's what you need to know...The site is built with Shiny, a web app language based on R developed by RStudio which can run R code in the background to generate an html page a browsers can view. The actual layout code is like a cross between R, html and javascript but it is relatively easy to learn, particularly if you have some experience in R and html.
The map is powered by leaflet, a javascript plugin for R and Shiny which allows you to display map tiles, both hosted from an external wms server (including a number of built in base maps), or rendered from your own spatial data. Leaflet is really easy to use in Shiny but I ran into a few issues along the way.
- Leaflet can be very slow to load files, particularly complicated polygons.
- To get around this I simplified my polygon layers as much as possible (you will see the don't perfectly match up in places).
- Even with this the suburb layer was very slow to load so I set up a button to load it separately for those that wanted to use it.
- Census data can be hard to wrangle into a useful format for plotting
- The help files for Leaflet are not always easy to understand when you don't have a background in coding, like how to read button clicks and switch layers on and off.
- There are some limitations in Leaflet that I'm still hoping to overcome.
Comments
Post a Comment