Linking tables and plots

There is a cool example bokeh/examples/glyphs/data_tables_server.py. It is a plot and a table and links them in such a way that when you select a horizontal region of the plot it highlights those rows in the table in a yellowish color. I’m a little unclear how it manages that. It seems like there is some implicit default behavior driven by the fact that both use the same data source.

I’m trying to do something similar but slightly different where the data table is empty until you select points and then only shows you what you have selected. Another useful behavior would be show all the data unless the use selects something and then just show the selected data. Either way i’d like to use the plot selection to control which rows are visible rather than which rows are yellowish. Is this possible to do?

This would be really useful in scatter plots to investigate outliers, for instance.

–Tom