tooltip with other htmlwidgets

35 views
Skip to first unread message

ArjunaCap

unread,
May 29, 2015, 1:04:06 AM5/29/15
to gg...@googlegroups.com

This question may be a little out of place here, but here goes:

It has also been posted to stack overflow.

I'm using the wonderful leaflet package in R and I'm wondering if there is a way to have a tooltip such that:

1- the user could draw a rectangle and

2- the code could estimate the actual physical size of the rectangle (in, say, feet) given the zoom level of the map and legs of the tooltip rect

## This doesn't work and mixes metaphors from leaflet and ggvis
## It's just pseudocode to give intuition 
library(leaflet)
library(ggvis)

lb <- linked_brush()
map <- leaflet() %>% addTiles() %>% addCircleMarkers() %>% lb()

size <- lb()$rect_width * lb()$rect_height * map$zoom_factor

Peter Ellis

unread,
May 29, 2015, 7:54:52 PM5/29/15
to gg...@googlegroups.com
This is off topic. This group is for ggvis, not leaflet.

ArjunaCap

unread,
May 29, 2015, 8:12:25 PM5/29/15
to gg...@googlegroups.com
Peter- It's true. That's why I led off with "This question may be a little out of place here".

Quoting the ggvis page at rstudio, "The graphics produced by ggvis are fundamentally web graphics".  More generally, it seems to be the future all-purpose package at the head of a family of web based plotting tools within htmlwidgets.  Another one of those is leaflet.  For now, there isn't a google group for either of those, and I'm interested in a specific ggvis function - linked_brush - and I'm wondering about it's potential portability to its brothers and sisters, in this case, leaflet.

Some people reading this may know both packages.

Cheers and apologies.
Reply all
Reply to author
Forward
0 new messages