-
Notifications
You must be signed in to change notification settings - Fork 0
Reference Dynamic Outputs
Dynamic outputs let an html5 module declare one output group and create a bounded set of output instances at runtime. This is for executables that do not know the exact number of reports or plots until the job runs.
The first supported dynamic output types are html and plotly.
Declare a normal output field and add:
-
dynamicoutput: set totrue -
idprefix: required prefix for generated instance ids -
max: required positive integer cap on generated instances
Example:
{
"role" : "output",
"id" : "dynamic_plot",
"label" : "Dynamic Plot",
"type" : "plotly",
"dynamicoutput" : "true",
"idprefix" : "dyn_plot",
"max" : "4"
}
Return an object or array under the declared dynamic group id. Each item may include:
-
label: label shown next to the generated instance -
valueordata: value passed to the underlying output renderer -
id: optional explicit instance id; it must be a safe GenApp-style id
Example:
{
"dynamic_plot": {
"items": [
{
"label": "Residuals",
"value": {
"data": [
{ "x": [1, 2, 3], "y": [2, 1, 2], "type": "scatter" }
],
"layout": { "title": "Residuals" }
}
},
{
"id": "dyn_plot_summary",
"label": "Summary",
"value": {
"data": [
{ "x": ["ok", "warn"], "y": [8, 1], "type": "bar" }
]
}
}
]
}
}
By default, a new dynamic update replaces previously generated instances for that group. Use "replace": false in the group object when a partial update should leave existing instances in place.
- Dynamic outputs are html5-only.
- The field must have
role: output. - The first implementation supports
type: htmlandtype: plotly. -
maxis required and limits the number of items rendered. -
idprefixis required and must be a valid safe identifier. - If an item omits
id, GenApp generates ids asidprefix_1,idprefix_2, and so on.
GenApp generates only the dynamic group container statically. Runtime data creates child output fields inside that group, then routes each child value through the existing output renderer for the declared type.
Resetting the module output removes generated dynamic instances and clears their saved last/default value state.