Visualization widget syntax in Decision Optimization experiments

The widget syntax can be useful for customizing widgets beyond the functionality that is provided by the Widget Editor in the Visualization view.

The basic widget syntax is as follows:

{
  "name": "Widget Title",
  "type": "WidgetType",
  "props": {}
}
Table 1. Basic widget syntax
  Description

name

Defines the widget title, which is displayed in the widget header.

type

Defines the widget type.

props

Defines the properties of the widget. The properties vary depending on the type of widget.

The basic widget syntax for widgets that are connected to data, such as tables and charts, is as follows:

{
  "name": "Table Cars",
  "type": "Table",
  "props": {
    "container": "",
    "data": "cars",
    "spec": {},
    "search": ""
  }
}
Table 2. Basic syntax for widgets connected to data
  Description

data

You usually specify data. data refers to the table from which you want to extract data.

spec

You usually leave spec empty. The Visualization generates a default spec as a starting point.

container

Optionally specify container. If container equals "" or "$current-scenario", it references the current scenario. The latter is useful when you have multiple scenarios.

container can reference another scenario in the same Decision Optimization experiment by its name: "container":"Scenario 1". It can also reference a list of different scenarios: "container":["Scenario April","Scenario June"].

To aggregate all the scenarios contained in a Decision Optimization experiment, use "container":"*". container also supports the following syntax: "container":"/regex/" where all the scenarios with names that contain regex will be referenced. Add i after the forward slash to ignore case differences, for example "container":"/april/i" will reference all scenarios with names that contain april or April.

The rows of the listed scenarios are concatenated in a single table, with an extra column $scenario containing the name of the scenario.

search

Saves the content of the search-text field.