disable_splitting()
¶This new function consolidates all "side" tooltips (if any) to the general tooltip.
You can farther customize content of the general tooltip using the line()
function and other Tooltip Customization API.
import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
mpg_df = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv')
mpg_df.head(3)
Unnamed: 0 | manufacturer | model | displ | year | cyl | trans | drv | cty | hwy | fl | class | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | audi | a4 | 1.8 | 1999 | 4 | auto(l5) | f | 18 | 29 | p | compact |
1 | 2 | audi | a4 | 1.8 | 1999 | 4 | manual(m5) | f | 21 | 29 | p | compact |
2 | 3 | audi | a4 | 2.0 | 2008 | 4 | manual(m6) | f | 20 | 31 | p | compact |
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot()
disable_splitting()
¶The function moves all side tooltips to the general tooltip.
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot(tooltips=layer_tooltips().disable_splitting())
disable_splitting()
with Specified Tooltip Lines¶All side tooltips are hidden, the general tooltip gets the specified lines.
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot(tooltips=layer_tooltips()
.line("@|^middle")
.disable_splitting())