Edit on GitHub

Table Schema

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

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'
  • 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
  1. Array of objects:

  2. table configuration:

columns:
  - label: Name
    value: /name
  - label: Factor
    value: /factor
tabs:
  - rows: /0/determinations
  - rows: /1/determinations
  • 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
Examples:
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.

Examples:
Weighing Experiment
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
reference
Table column mapping schema

A static array that defines the structure of a table by mapping keys from the source data to 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
default: false

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
default: false

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

alternatingRowColor
boolean
default: false

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.

transpose
boolean
default: false

Display table in a transposed position, flipping the position of rows and columns. This is especially useful for tables with many columns, but only a single row.

columns
reference
Table column mapping schema

A static array that defines the structure of a table by mapping keys from the source data to 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.
Examples:
myTable_state
skipBehaviors
boolean
default: false

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

rules
reference
Table rules

Rules can be leveraged to dynamically change both the behavior and appearance of a table.

Where is this used?
Other schemas that have a reference ($ref) to this schema.