Custom Editors: Autogenerate UI from Any Function
Extend Mito with custom dataframe transformations, like proprietary algorithms, calculations, and domain-specific knowledge.
Last updated
Was this helpful?
Extend Mito with custom dataframe transformations, like proprietary algorithms, calculations, and domain-specific knowledge.
Last updated
Was this helpful?
The Mito spreadsheet is built to be extensible for your team's use case. Mito users or infrastructure administrators can extend Mito with custom dataframe editing capabilities, like proprietary algorithms, calculations, and domain-specific knowledge.
Stop your internal Python code from rotting on the shelf, and get it to end users in the most intuitive interface -- a spreadsheet.
Adding custom editing functionality to the Mito spreadsheet is very simple:
Define a Python function that takes a pd.DataFrame
and returns a pd.DataFrame
.
Pass this function to the editors
parameter when creating the Mito sheet.
Use the Custom Edits
dropdown in the Mito sheet to access this functionality - with an auto-generated UI!
Imagine we're a financial institution that has implemented the following Python function, and we want to expose it to our users:
First, we must add types to the parameters of the function. This ensures that Mito can correctly generate a UI for each of these parameters. In this case, we type this function in the following way:
editors
parameterThen, pass this function to the editors
parameter.
Pass this custom editor with:
Pass the following data to the Mito spreadsheet, so that we can test our new custom editor:
Custom Edits
dropdownIn the toolbar, a Custom Edits
tab option will appear, with the Calculate Moving Average function beneath it:
Selecting this option will open a taskpane that allows you to configure this function, and calculate the moving average!
To see all the valid parameter types, check out the section of the custom importers page.