Skip to main content
A component to display Pandas DataFrames.

Fields

NameTypeDescriptionOptions
DataTextMust be a state reference to a Pandas dataframe or PyArrow table. Alternatively, a URL for an Arrow IPC file.-
Show indexBooleanShows the dataframe’s index. If an Arrow table is used, shows the zero-based integer index.-
Enable searchBoolean--
Enable adding a recordBoolean--
Enable updating a recordBoolean--
Enable downloadBooleanAllows the user to download the data as CSV.-
ActionsKey-ValueDefine rows actions-
Enable markdownBooleanIf active, the output will be sanitized; unsafe elements will be removed.-
Display row countNumberSpecifies how many rows to show simultaneously.-
Wrap textBooleanNot wrapping text allows for an uniform grid, but may be inconvenient if your data contains longer text fields.-
Primary textColor--
Secondary textColor--
AccentColor--
SeparatorColor--
BackgroundColor--
Font styleText-
  1. normal
  2. monospace
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.-

Events

Capture adding a row.
# Subscribe this event handler to the `wf-dataframe-add` event
#
# more on : https://dev.writer.com/framework/dataframe
def on_record_add(state, payload):
payload['record']['sales'] = 0 # default value inside the dataframe
state['mydf'].record_add(payload) # should contain an EditableDataFrame instance
Capture a cell change.
# Subscribe this event handler to the `wf-dataframe-update` event
#
# more on : https://dev.writer.com/framework/dataframe
def on_record_change(state, payload):
state['mydf'].record_update(payload) # should contain an EditableDataFrame instance
Remove or open a row.
# Subscribe this event handler to the `wf-dataframe-action` event
#
# more on : https://dev.writer.com/framework/dataframe
def on_record_action(state, payload):
# state['mydf'] should contains an EditableDataFrame instance
record_index = payload['record_index']
if payload['action'] == 'remove':
	state['mydf'].record_remove(payload) # should contain an EditableDataFrame instance
if payload['action'] == 'open':
	state['record'] = state['mydf'].record(record_index) # dict representation of record
I