lindbrook / cholera

R Package for Analyzing John Snow's 1854 Cholera Map
135 stars 14 forks source link

Zooming, with tool tips: address-name data? #681

Open friendly opened 2 weeks ago

friendly commented 2 weeks ago

In this Twitter/X post, Kylw Walker illustrates zooming on a map using mapgl.

It made me wonder what that could do for exploring Snow's map & data.

To be useful with tool tips, that would depend on having some details about the individuals listed in fatalities. Is there anything like this available?

lindbrook commented 1 week ago

Acknowledging the value and familiarity of an interactive map and tool tips, the ability to explore (and validate) the data has always been top of mind for me. So in a way, I've tried to incorporate these ideas. I just use functions and graphical annotations rather than the "mouse" and a GUI as the "interface".

'zoom = TRUE' is the default argument in many plot methods (via xlim and ylim): caseLocator(), euclideanPath(), walkingPath(), streetNameLocator(), etc. For example, the two path functions allow you visualize the walking or Euclidean path from case to pump, case to case, or pump to pump. I've even included some landmarks (e.g., Soho Square, the residences of John Snow and Karl Marx) as cases.

plot(walkingPath(origin = "john snow", destination = "broad street"), type = "case-pump"), zoom = TRUE) john snow

You can even combine graphical elements with the add*() functions so you can do things like highlight streets and then overlay the walking neighborhoods:

streetNameLocator(c("marshall street", "broad street"), zoom = TRUE) addNeighborhoodWalking() marshall broad

For what it's worth, in lieu of tool tips information about cases, pumps and landmarks is annotated in the graph (and in the function call). Full fledged tool tips would be nice addition here, though.

That said, I do appreciate what a more interactive maps can offer. I looked at them a while back and may return to them at some point. What worried me then and now is that do something along those lines would probably require a lot of customization (possibly to the extent that those packages and services may not be helpful - not to mention the potential need for a commercial license).

The main problem (I think) is that only "today's" maps are available. This is an issue because some Soho streets and street names have changed since 1854. As a result, the maps may not look right. Moreover, the routing software, which computes directions from A to B, might not give the appropriate result. So I'd need a way to translate my solutions onto their maps.

By the way, some time ago I discovered another apparent error in Dodson and Tobler's map: part of Clifford Street (1 line segment) seems to be missing. I have an eye-balled solution if you want to include it in 'HistData'.