JetBrains / lets-plot

Multiplatform plotting library based on the Grammar of Graphics
https://lets-plot.org
MIT License
1.55k stars 49 forks source link

Suboptimal tooltip positioning in facets #1187

Open orausch opened 1 week ago

orausch commented 1 week ago

I often have plots with many tooltips, and the current overflowing behavior makes these a bit tricky to use. Example:

from lets_plot import *

LetsPlot.setup_html()

d = {
    l: [i]*3 for i, l in enumerate(string.ascii_lowercase)

} | {'facet': [0, 1, 2]}
ggplot(d, aes(x='a', y='b')) + geom_point(tooltips=layer_tooltips(list(string.ascii_lowercase))) + ggsize(300, 1000) + facet_wrap('facet')

The lower tooltips have enough space to display:

Screenshot 2024-09-16 at 8 24 28 AM

The upper ones overflow even though there is space for them:

Screenshot 2024-09-16 at 8 24 37 AM