Accessing Tabulator API for Interaction History Feature

Hi,

So I would like to ask for some help in trying to access the Tabulator API for the ‘Interaction History’ feature detailed here. Within the Panel documentation I reviewed the following:

  • Panel/Widgets/Tabulator - Learned where I could pass the configuration setting
  • Panel/API/Links Module - Not sure if this is what I would need to use to access API
  • Panel/User Guide/Custom Components - I saw this was for more custom items which this necessarily isn’t since Tabulator already provides the wrapper
  • Panel/User Guide/Linking Objects in Panel - I tried this but ultimately it would not allow the page to render or I needed to run a live python kernel to see if it would work

Currently I have built this,

import panel as pn
import pandas as pd
pn.extension('tabulator')

# Part 1 - Table Generation
data = {
    'Name': ['Alice', 'Bob', 'Charlie'],
    'Progress': [25, 50, 75],
    'Gender': ['Female', 'Male', 'Male'],
    'Rating': [3, 4, 5],
    'Favourite Color': ['Red', 'Blue', 'Green'],
    'Date Of Birth': ['1990-01-01', '1995-02-15', '2000-03-20'],
    'Driver': [True, False, True],
}
df = pd.DataFrame(data)

tabulator_widget = pn.widgets.Tabulator(df, layout='fit_data', configuration={'history': True})

undo_button = pn.widgets.Button(name='Undo', width=100)
redo_button = pn.widgets.Button(name='Redo', width=100)


# Part 2 - Button Behavior and Tabulator API access

# create a script dictionary containing the JS code for undo and redo?

# link button events with JS script key value to get the right action executed? 


# Part 3 - Structure and Layout
undo_redo_panel = pn.Row(undo_button, redo_button)

layout = pn.Column(
    pn.pane.Markdown("## Tabulator with Undo/Redo History"),
    tabulator_widget,
    undo_redo_panel
)

layout.servable()

Any ideas or suggestions would be appreciated!

In case anyone is curious, I found my answer after doing some digging.

Apparently the Tabulator widget only has access to the features denoted in the Tabulator Options section which get passed through the configuration setting when instantiated. All other features are unfortunately unavailable directly through the widget.