Row layout
Explanation on how to configure row-based layouts.
The Frame
has two properties: layout
and contents
.
layout
defines different areas in the user interface.contents
defines various entities to be placed on the frame.The contents are a dictionary of key-value pairs, where the keys may match one of the areas defined in the layout. The contents of a frame can contain various types of entities:
Model
and Viewer
. These components cannot contain other entities.ControlPanel
, a NavPanel
, and a TextPanel
. These components can contain other entities.Model
or a DataStore
.The diagram below shows an example of a home page defined using a single frame:
Below is the configuration code for this frame. (Note that some of the code has been omitted.)
kind: Solution
version: v0
router:
kind: Router
routes:
- frame: home
frames:
# ====== HOME FRAME ======
home:
kind: Frame
layout:
kind: ColumnLayout
widths: [auto, 300px]
areas: [model_viewer, model_params]
contents:
gh-model:
kind: Model
modelFile: trimbox.gh
# more...
model-params:
kind: ControlPanel
controls: {}
# more...
model-viewer:
kind: Viewer
# more...
In the example, these work together as follows:
layout
defines two named areas, model-viewer
and model-params
.contents
defines three entities, with the keys gh-model
, model-params
, and model-viewer
.
gh-model
defines a Grasshopper model that generates a simple box. This entity has no visual representation in the user interface. So in this case, the key does not appear in the list of areas defined by the layout.model-params
entity is a ControlPanel
that contains some sliders for controlling the Grasshopper model, and a text output for showing the volume of the box. This entity is shown in the right-hand column in the user interface.model-viewer
entity is a Viewer
for viewing the 3D geometry generated by the Grasshopper model. This entity is shown in the left-hand column in the user interface.See the layout schema docs for more information.
Explanation on how to configure row-based layouts.
Explanation on how to configure column-based layouts.
Explanation on how to configure grid-based layouts.
Explanation on how to define grid sizes.