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.
ControlPanel you can,
- Use different types of controls as inputs.
- Change model inputs by subscribing the
- Change material colours in the solution by subscribing the
- Display model output results as text or in a table by subscribing the
- Display headers and descriptions to provide more information about your solution.
💡 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
See the controlPanelConfig schema docs for more information.