Closed Robinlovelace closed 1 year ago
Probably solvable with https://leafletjs.com/reference.html#popup-maxheight
Surely minWidth?
A combination of any of these should work, can't remember which exactly
This could help on the R side:
> x = "here's a verrrry long sentence of excessive length lllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaa"
> gsub('(.{1,90})(\\s|$)', '\\1\n', x)
[1] "here's a verrrry long sentence of excessive length lllllllllllllllllllllll\nbllllllllllllllaaaaaaaaaaaaa\n"
> x = paste0(x, x, x, collapse = " ")
> x
[1] "here's a verrrry long sentence of excessive length lllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaahere's a verrrry long sentence of excessive length lllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaahere's a verrrry long sentence of excessive length lllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaa"
> gsub('(.{1,90})(\\s|$)', '\\1\n', x)
[1] "here's a verrrry long sentence of excessive length lllllllllllllllllllllll\nbllllllllllllllaaaaaaaaaaaaahere's a verrrry long sentence of excessive length\nlllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaahere's a verrrry long sentence of\nexcessive length lllllllllllllllllllllll bllllllllllllllaaaaaaaaaaaaa\n"
Update: neither \n
nor <br>
in the text worked. So just going to use str_sub()
for now is plan.
My hunch is that this should really be controlled via CSS
This has appeared many times before in my workflow and imagine others have reported it so apologies if this is a duplicate. Real usability issue: when textboxes are way bigger than the screen size, as shown below.
Imagine a function to detect n. chars and auto break, not sure how and may involve an additional package/complexity so may be a won't fix, asking as question: worth fixing this on tmap side?