DataFrame#

pydantic model zero_true.DataFrame#

DataFrame component for displaying tabluar data

Show JSON schema
{
   "title": "DataFrame",
   "description": "DataFrame component for displaying tabluar data",
   "type": "object",
   "properties": {
      "id": {
         "description": "Unique id for a component",
         "title": "Id",
         "type": "string"
      },
      "variable_name": {
         "default": "",
         "description": "Optional variable name associated with a component",
         "title": "Variable Name",
         "type": "string"
      },
      "component": {
         "default": "v-data-table",
         "description": "Vue component name.",
         "title": "Component",
         "type": "string"
      },
      "headers": {
         "default": [],
         "description": "List of column headers for the DataFrame",
         "items": {
            "$ref": "#/$defs/Header"
         },
         "title": "Headers",
         "type": "array"
      },
      "items": {
         "default": [],
         "description": "List of items to be displayed in the DataFrame",
         "items": {
            "type": "object"
         },
         "title": "Items",
         "type": "array"
      }
   },
   "$defs": {
      "Header": {
         "description": "Header class for the columns of a DataFrame component",
         "properties": {
            "title": {
               "default": "",
               "description": "Title of the column",
               "title": "Title",
               "type": "string"
            },
            "align": {
               "default": "start",
               "description": "Alignment of values in the column",
               "title": "Align",
               "type": "string"
            },
            "key": {
               "default": "name",
               "description": "Key of the column, must match the key in the items list",
               "title": "Key",
               "type": "string"
            }
         },
         "title": "Header",
         "type": "object"
      }
   },
   "required": [
      "id"
   ]
}

field component: str = 'v-data-table'#

Vue component name.

field headers: List[Header] = []#

List of column headers for the DataFrame

field items: List[Dict[str, Any]] = []#

List of items to be displayed in the DataFrame

classmethod from_dataframe(df: DataFrame, id: str)#

Create a DataFrame component from a pandas DataFrame

pydantic model zero_true.Header#

Header class for the columns of a DataFrame component

Show JSON schema
{
   "title": "Header",
   "description": "Header class for the columns of a DataFrame component",
   "type": "object",
   "properties": {
      "title": {
         "default": "",
         "description": "Title of the column",
         "title": "Title",
         "type": "string"
      },
      "align": {
         "default": "start",
         "description": "Alignment of values in the column",
         "title": "Align",
         "type": "string"
      },
      "key": {
         "default": "name",
         "description": "Key of the column, must match the key in the items list",
         "title": "Key",
         "type": "string"
      }
   }
}

field align: str = 'start'#

Alignment of values in the column

field key: str = 'name'#

Key of the column, must match the key in the items list

field title: str = ''#

Title of the column