Column Definitions
Setting the column_definitions
parameter to preconfigure the formatting of your data requires a Mito Enterprise License.
Why use the column_definitions parameter?
The column_definitions
parameter allows you to preconfigure the format of columns displayed in the Mito Spreadsheet. They're particularly useful when you need to apply conditional formatting to columns so your app users can instantly see informative data immedietly after loading your app.
Column Definitions Usage
The column_conditions
parameter allows users to define conditional formatting rules for specific columns in specific dataframes displayed spreadsheet.
The column_conditions
is a list of formatting configurations applied to each sheet.
columns: Specifies the columns names to apply the conditional formatting rule to.
conditional_formats: Specifies the conditional formatting rules for the specified columns.
filters: Each filter is a pair of
condition
andvalue
. For example, if thecondition
is 'greater' and the value is 5, the applied font_color and background_color will be applied to all cells in the specific column with a value greater than 5. See a full list available conditions here.font_color: The Hex string representation the font should be displayed in if the cell meets the required condition. A valid conditional format must have at least a font_color and/or background_color.
backgrond_color: The Hex string representation the cell background should be colored in if the cell meets the required condition. A valid conditional format must have at least a font_color and/or background_color.
Example Usage
The below column_definitions
displays applies conditional formatting to columns "A" and "B" in the first dataframe inside the spreadsheet.
Filter Conditions Reference List
Below is the complete list of conditions
available to be used in a conditional format filter. Take note that most filter conditions are only valid if applied to a column with the correct data type, except for the filter conditions labelled with Any Data Type
at the bottom of the table.
Column Data Type | Filter Conditions |
---|---|
Number |
|
| |
| |
| |
| |
| |
| |
| |
String |
|
| |
| |
| |
| |
| |
| |
Dates |
|
| |
| |
| |
| |
| |
Boolean |
|
| |
Any Data Type |
|
| |
| |
|
More Examples
Applying conditional formatting to a single dataframe
Applying multiple conditional formatting rules to a single dataframe
Applying conditional formatting to multiple dataframes
Last updated