layout: true --- class: center, bottom background-image: url(img/title-cover.png) background-size: cover # Crash Data Visualization Using Leaflet .large[Ashirwad Barnwal | ISU Graphics Group | 2020-09-03 (updated: 2020-09-19)] --- # Who am I? ~~No one cared who I was until I put on the mask.~~ 😉 .pull-left[ Brief background: - 3rd year PhD student in Civil Engineering (Transportation Data Analytics) - 2nd year MS student in Statistics (concurrent degree) - I took Stat 579 (Intro to R) with Dr. Hofmann in Fall 2018 Connect with me at: - [<svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 448 512"><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/></svg> @ashirwad1992](www.linkedin.com/in/ashirwad1992) - [<svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 512 512"><path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"/></svg> ashirwad1992@gmail.com](mailto:ashirwad1992@gmail.com) - [<svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg> @ashirwad](http://github.com/ashirwad) ] .pull-right[ <img src="img/covid-profile-pic.png" width="1523" /> Added mask to my photo using [Kapwing](https://www.kapwing.com/) 😄 ] --- # What's the goal of this presentation? .pull-left[ Start here: ![classic+animation+choices](https://media0.giphy.com/media/Jyx7xUsUtHSjm/giphy.gif) <div style='font-size:50%'>(Available at [http://gph.is/1bbZpie](http://gph.is/1bbZpie), Sep 02, 2020)</div> ] .pull-right[ End here: ![which+one+choices](https://media2.giphy.com/media/Uni2jYCihB3fG/giphy.gif) <div style='font-size:50%'>(Available at [http://gph.is/2alF2tv](http://gph.is/2alF2tv), Sep 02, 2020)</div> ] --- class: center, inverse, middle # Enough of humor... # Let's get started with some serious data visualization! ![serious](https://media4.giphy.com/media/Fr51PdEf2NxOE/giphy.gif) <div style='font-size:50%'>(Available at [http://gph.is/1qKXewI](http://gph.is/1qKXewI), Sep 02, 2020)</div> --- # What is Leaflet? <iframe src="https://leafletjs.com/" width="100%" height="475px"></iframe> --- # Leaflet for R <iframe src="https://rstudio.github.io/leaflet/" width="100%" height="475px"></iframe> --- # What open data am I using? <iframe src="https://public-iowadot.opendata.arcgis.com/" width="100%" height="475px"></iframe> --- # Some notes about the data processing - **Step 1**: Downloaded [crash data](https://data.iowadot.gov/datasets/crash-data-1) from the open data portal. The data has records of all crashes that occurred within Iowa over the last 10 years. - **Step 2**: Processed data and extracted 5 years (2015--2019) worth of fatal crashes Here's a glimpse of the extracted data set:
--- # Map with circles **Note**: Unless stated otherwise, this and subsequent data visualizations uses 2019 fatal crash data to improve leaflet rendering performance.
--- # Map with circles and a minimap
--- # Map with marker clusters
--- # Map with a heatmap layer
--- # Map with a hexbin-based heatmap layer
--- # Map with layers control
--- # Map with base and overlay layers control
--- # Map with synced heatmap layers Summer (L) vs. Winter (R) fatal crashes
--- # Map with desynced heatmap layers Same heatmap on both left & right panes
--- # Map with a choropleth layer
--- # Map with a choropleth layer (normalized) **VMT**: Vehicle Miles Traveled; **Crash rate**: Number of crashes per million VMT
--- # Map with side-by-side choropleth layers
--- # Map with mini circle charts
--- # Map with mini pie charts
--- # Map with mini bar charts
--- # Animated map with mini circle charts
--- # Animated map with mini pie charts Weekday (purple) vs. Weekend (orange) fatal crashes
--- # Animated map with side-by-side mini circle charts Same mini circle charts on both panes .pull-left[
] .pull-right[
] --- # Animated map with side-by-side circle & pie minicharts .pull-left[
] .pull-right[
] --- class: center, inverse, middle # Life outside R & Leaflet... --- # Kepler.gl <iframe src="https://kepler.gl/" width="100%" height="475px"></iframe> --- # Deck.gl <iframe src="https://deck.gl/" width="100%" height="475px"></iframe> --- # Datawrapper <iframe src="https://www.datawrapper.de/" width="100%" height="475px"></iframe> --- # QGIS <iframe src="https://qgis.org/en/site/" width="100%" height="475px"></iframe> --- # ArcGIS Online <iframe src="https://learn.arcgis.com/en/paths/mapping-and-visualization/" width="100%" height="475px"></iframe> --- # Thank you. Stay safe, healthy, & responsible! .pull-left[ Labor day, s/he is 👀 at you! ![covid+graph](https://media3.giphy.com/media/Qu1fT51CG14ksIkASL/giphy.gif) <div style='font-size:50%'>(Available at [https://gph.is/g/Z7gwmOm](https://gph.is/g/Z7gwmOm), Sep 03, 2020)</div> ] .pull-right[ **Acknowledgements** - [Yihui Xie](https://yihui.org/) for his [`xaringan`](https://CRAN.R-project.org/package=xaringan) package - Harry Zhu for his awesome leaflet ideas on his [GitHub repo](https://github.com/harryprince/awesome-leaflet) - [Ganesh Krishnan](https://www.linkedin.com/in/ganeshkrishnann/) & [ISU Graphics Group](https://isu-graphics.rbind.io/) for inviting me to give this talk **Closing remarks...** - Check out the [GitHub repo](https://github.com/ashirwad/isu-graphics_crash-data-viz) that powers these slides - License: [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) ]