set_table_display
Set table-display annotations to control row name patterns, page size, and row ordering. Changes are staged locally and applied with apply_annotations().
Instructions
Set the table-display annotation on a table.
Controls table-level display options like row naming patterns, page size, and row ordering.
Changes are staged locally until apply_annotations() is called.
Args: table_name: Name of the table. annotation: The table-display annotation value. Set to null/None to remove.
Table-Display Annotation Schema (tag:isrd.isi.edu,2016:table-display):
{
"row_name": { // How to display row identifiers
"row_markdown_pattern": "{{{Name}}}", // Template for row display
"template_engine": "handlebars" // or "mustache"
},
"detailed": { // Options for detailed view
"hide_column_headers": true, // Hide column headers
"collapse_toc_panel": true // Collapse table of contents
},
"compact": { // Options for compact/list view
"page_size": 25, // Rows per page
"row_order": [ // Default sort order
{"column": "RCT", "descending": true},
"Name"
]
},
"*": { // Default for all contexts
"page_size": 10,
"row_order": ["Name"]
}
}Context-specific options:
row_name: Special context for row identifier displaydetailed: Detailed/record viewcompact,compact/select,compact/brief: List views*: Default for unspecified contexts
Available options per context:
row_order: Array of sort keys (column name or {column, descending})page_size: Number of rows per pagecollapse_toc_panel: Boolean to collapse TOC (detailed only)hide_column_headers: Boolean to hide headers (detailed only)row_markdown_pattern: Template string using {{{column}}} syntaxpage_markdown_pattern: Template for entire pageseparator_markdown: Separator between rowsprefix_markdown: Content before rowssuffix_markdown: Content after rowstemplate_engine: "handlebars" or "mustache"
Returns: JSON with status and the table name.
Examples: # Set row name pattern set_table_display("Subject", { "row_name": { "row_markdown_pattern": "{{{Name}}} ({{{Species}}})" } })
# Set default sort order and page size
set_table_display("Image", {
"compact": {
"row_order": [{"column": "RCT", "descending": true}],
"page_size": 50
}
})
# Configure detailed view
set_table_display("Page", {
"detailed": {
"hide_column_headers": true,
"collapse_toc_panel": true
}
})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| annotation | No | ||
| table_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |