Edit on Github

Table Schema

A schema that is used to validate a part of Laboperator workflow templates.

Schema

Table Schema
datarequired
reference
Member Name

The unique identifier of a field that contains the source data.

If configuration for tabs or columns is not specified, the data source is expected to be an array of objects. Each object represents one row in the table. The order of rows in the table is defined by the array indices. The object properties define the cell values within that row. For example, the following source data would result in a table with three columns and two rows:

- name: acetic anhydride
  density: 1.08
  molar_mass: 102.09
- name: 2-Hydroxybenzoic acid
  density: 1.44
  molar_mass: 138.121

Configuration for tabs or columns can be provided for mapping a data source that is not an array of objects. With tabs you can split the source data into separate tables in separate tabs. Mapping on where to find the data for each tab must be defined in the tabs.rows setting. The columns setting enables fine-grained control over the structure of a table and the formatting of cell values. If columns is not specified, rows must be represented by objects in the source data.

Examples for when the source data is:

  1. Array of arrays:

  2. table configuration:

    columns:
      - label: Name
        value: '/name'
      - label: Density
        value: '/density'
    tabs:
      - rows: '/0'
      - rows: '/1'
  3. sample data:

    - - name: acetic anhydride
        density: 1.08
        molar_mass: 102.09
      - name: 2-Hydroxybenzoic acid
        density: 1.44
        molar_mass: 138.121
    - - name: salicylic acid
        density: 1.44
        molar_mass: 138.12
      - name: 2,4,6-Trichlorphenol
        density: 1,68
        molar_mass: 197,45
  4. Array of objects:

  5. table configuration:

    columns:
      - label: Name
        value: /name
      - label: Factor
        value: /factor
    tabs:
      - rows: /0/determinations
      - rows: /1/determinations
  6. sample data:

    - name: First Dilution
      determinations:
        - name: acetic anhydride
          factor: 2
          weight: 102.09
        - name: 2-Hydroxybenzoic acid
          factor: 2
          weight: 138.121
    - name: Second Dilution
      determinations:
        - name: acetic anhydride
          factor: 4
          weight: 80.25
        - name: 2-Hydroxybenzoic acid
          factor: 4
          weight: 108.457
Example 1:
my_table_data
tabs
Array of objects

A static array that defines the structure of tabs that contain separate tables.

Array
rowsrequired
reference
JSON Pointer

The pointer to the array that holds the rows data for each tab. The path is resolved relative to the table data field.

label
string
Default: Tab #

The display name of the tab. If no label is specified, the default Tab # label will be used, with # indicating the respective tab index.

Example 1:
Weighing Experiment
Example 2:
Dilution 1
selectable
Array of strings
One of One of: rows cells

Configures which table elements can be selected to trigger behaviors. It takes precedence over the table-wide selectable setting.

columns
caption
string

A caption functions like a heading for a table and provides information that can help users find and understand a table. It takes precedence over the table-wide caption setting.

dense
boolean

Toggles a condensed appearance of a table with reduced spacing. If textWrapping is not disabled, rows will still increase in width in order to display long cell content with line breaks to avoid horizontal scrolling.

textWrapping
boolean
Default: true

Toggles line breaks inside table cells. If enabled, text will break into multiple lines so that it will fit into the available space and can be read from top to bottom without any horizontal scrolling. Tables that are referenced in markdown with a flag to set the number of visible rows, i.e. {{table|my_table|rows=3}}, have text wrapping disabled by default.

borders
boolean

Toggles borders around each cell. The default appearance of a table is a border below every row.

alternatingRowColor
boolean

Toggles a background color on odd rows to improve readability.

caption
string

A caption functions like a heading for a table and provides information that can help users find and understand a table.

selectable
Array of strings
One of One of: rows cells

Configures which table elements can be selected to trigger behaviors.

columns
state
reference
Member Name

The unique identifier of a field.

The state field will be created implicitly. The field name pattern consists of the table identifier and the string _state, joined end-to-end.

A custom state field needs to conform to the following schema:

type: object
additionalProperties: false
properties:
  selectedRow:
    type: string
    description: The currently selected row.
  selectedCell:
    type: string
    description: The currently selected cell.
Example 1:
myTable_state
skipBehaviors
boolean

Toggles the automatic creation of behaviors for selecting table rows and cells

rules
reference
Table rules

Where is this used?

Other schemas that have a reference ($ref) to this schema.