Skip to content

Instantly share code, notes, and snippets.

@PatrickStotz
PatrickStotz / TomTom Congestion-Index
Created March 25, 2020 10:54
Scraping TomTom Congestion data
needs(tidyverse, jsonlite, lubridate)
cities = c("frankfurt-am-main", "cologne", "berlin", "hamburg", "munich")
for (city in cities){
url = paste0("https://api.midway.tomtom.com/ranking/live/DEU%2FCircle%2F", city)
data = fromJSON(url)
table = data$data %>%
select(TrafficIndexLive, TrafficIndexHistoric, UpdateTime) %>%
mutate(time = as_datetime(UpdateTime / 1000)) %>%
@PatrickStotz
PatrickStotz / README.md
Last active February 11, 2023 00:40
Spinning globe with glowing city markers in D3

A Spinning globe with glowing city markers in D3.

Note: This visualization constantly recalculates and reprojects the position of over 4000 markers and thus needs a lot of computation power. Older computer and mobile devices might struggle with the rendering process. Furthermore the visualization is only optimized for Chrome browsers and might look different than expected when opened in other browsers.

Inspired by Curran Kelleher's idea to plot a world map in D3 by using the GeoNames database as seen in his great Introdction to D3 video.