kind: Solution
version: v0

router:
  kind: Router
  routes:
    - frame: home-frame

frames:
  home-frame:
    kind: Frame
    layout:
      kind: ColumnLayout
      widths: [auto, 300px]
      areas: [viewer, params]
    contents:
      # === MODEL ===
      model:
        kind: Model
        modelFile: set-text-output-example.gh
        subscribe:
          - kind: ControlPanel
            frame: home-frame
            source: params
      # === VIEWER ===
      viewer:
        kind: Viewer
        materials:
          blue:
            kind: StandardMaterial
            color: [42, 75, 240]
          light-blue:
            kind: StandardMaterial
            color: [119, 173, 238]
        subscribe:
          - kind: Model
            frame: home-frame
            source: model
            assignMaterials:
              box: blue
              sphere: light-blue
      # === CONTROL PANEL ===
      params:
        kind: ControlPanel
        controls:
          # --- Parameters ---
          header1:
            kind: Text
            type: h1
            text: Parameters
          box-width: # match GH model input
            kind: Slider
            label: Box width
            min: 1
            max: 10
            precision: 1
            value: 5
          box-depth: # match GH model input
            kind: Slider
            label: Box depth
            min: 1
            max: 10
            precision: 1
            value: 5
          box-height: # match GH model input
            kind: Slider
            label: Box height
            min: 1
            max: 10
            precision: 1
            value: 5
          sphere-radius: # match GH model input
            kind: Slider
            label: Sphere radius
            min: 1
            max: 10
            precision: 1
            value: 6
          # --- Results ---
          header2:
            kind: Text
            type: h1
            text: Results
          sphere-volume-label:
            kind: Text
            text: "Sphere volume:"
          sphere-volume:
            kind: Text
            text: ""
          box-volume-label:
            kind: Text
            text: "Box volume:"
          box-volume:
            kind: Text
            text: ""
        subscribe:
          - kind: Model
            frame: home-frame
            source: model
            setOutputs:
              sphere-volume: # must match GH model output
                type: setText
              box-volume: # must match GH model output
                type: setText
