Tooltip Customization API: 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.

In [1]:
import pandas as pd

from lets_plot import *
In [2]:
LetsPlot.setup_html()
In [3]:
mpg_df = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/mpg.csv')
mpg_df.head(3)
Out[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

1. Default Tooltips

In [4]:
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot()
Out[4]:

2. disable_splitting()

The function moves all side tooltips to the general tooltip.

In [5]:
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot(tooltips=layer_tooltips().disable_splitting())
Out[5]:

3. disable_splitting() with Specified Tooltip Lines

All side tooltips are hidden, the general tooltip gets the specified lines.

In [6]:
ggplot(mpg_df, aes(x="class", y="hwy")) + geom_boxplot(tooltips=layer_tooltips()
                                                                   .line("@|^middle")
                                                                   .disable_splitting())
Out[6]: