Hi,
I like the Perspective Pane a lot because of its very good filter functionality.
Now I want to link its value to a selection (for example from a tabulator table, maybe also from a plot).
Unfortunately I can not achieve this. I tried different methods, here is a version where the selection update/callback works for tabulator but not perspective. Is there any chance or way to get this functionality? Thank you!
import pandas as pd
import panel as pn
pn.extension('tabulator','perspective')
mixed_df = pd._testing.makeMixedDataFrame()
tabulator_table = pn.widgets.Tabulator(mixed_df, selection=[])
tabulator_table_selection = pn.widgets.Tabulator(mixed_df.head(2), selection=[])
perspective_df_selection = pn.pane.Perspective(mixed_df.head(2), plugin = 'datagrid', width=1000,height = 700,toggle_config = True)
def update_selection(*events):
tabulator_table_selection.value = tabulator_table.selected_dataframe
perspective_df_selection.value = tabulator_table.selected_dataframe
#Or something like this: perspective_df_selection.object = tabulator_table.selected_dataframe
tabulator_table.param.watch(update_selection,'selection')
pn.Column('##Select row from table:',
tabulator_table,
'###Tabulator table with selected values:',
tabulator_table_selection,
'###Perspective table with selected values (not working):',
perspective_df_selection,
)