Control panel

Explanation on the control panel.

Introduction

The ControlPanel allows you to change the values for inputs to a model. It is typically the main entity that the user interacts with to generate design options.

With the ControlPanel you can,

💡 By default, if a model subscribes to a control panel, then any changes to the inputs will trigger the model to solve. If you only want the model to solve when certain inputs are changed, then you can use the triggerSolveOn option in the model configuration.

💡 The order of controls in your control panel configuration directly relates to the order of text and inputs in the solution.

Below is the configuration example. (Note that some content has been omitted.) In the example we assume that my-sphere-radius is an input to the model, and my-sphere-volume is an output from the model.

my-control-panel:
  kind: ControlPanel
  controls:
    my-solution-title:
      kind: Text
      text: My solution title
      type: h2
    my-sphere-radius: # must match GH model input
      kind: Slider
      label: My label
      value: 50
      min: 10
      max: 100
      precision: 1
    my-sphere-volume: # must match GH model output
      kind: Text
      text: ""
  subscribe:
    - kind: Model
      frame: my-home-frame
      source: my-model
      setOutputs:
        my-sphere-volume: # must match GH model output
          type: setText

Schema

See the controlPanelConfig schema docs for more information.