Autor da secção: Jonathon Love
User-interface definition (.u.yaml-files)
Overview
The UI definition is a YAML-file in the
jamovi/directory, with the extension.u.yaml. The UI definition is pretty straightforward. It follows a tree structure that defines the child/parent-relationship between the controls. The top level or root control is the first thing that is described by the UI YAML. The file is named to match the name of the analysis it describes, but converted to lowercase. An example isttestis.u.yaml.
Properties
Property
Description
Form
nameThe name of the analysis.
Unique string
titleSets the title to be displayed at the top of the option panel.
string
jusDefines the syntax version used by the
u.yaml-file.string of form ‘number.number’
stageSets the stage display filter.
0 - Released1 - In development2 - Proposed
compilerModeSets the compiler interaction mode.
enum: tame, aggressive
childrenSets the child control definitions.
Array of valid control definitions.
Example
name: descriptives title: Descriptives jus: '2.0' stage: 0 compilerMode: tame children: # array of child definitions
Further Detail
The root control is a
ParentControland as the name suggests serves as a parent to child controls. All parent controls contain the propertychildrenwhich defines an array of control definitions to be embedded. All UI design happens within thechildrennode of the root control. Control definitions are added here in the form we design.When controls are added to the root control they are added in a list form, from top to bottom of the options panel.
Controls
There are many different controls that can be used within the jamovi options UI panel. Each control has been designed for a specific option type(s). For example, a
CheckBoxis designed around aBooloption type, where as aComboBoxdisplays and writes data to aListoption. jamovi provides a solid array of basic controls to cover all the current option types. Controls will continue to be developed as jamovi grows but the current list covers most use cases.When adding child controls to any
ParentControl, at the very least thetypeproperty needs to be specified (as well as the minimum requirements for that control).name: descriptives title: Descriptives jus: '2.0' stage: 0 compilerMode: tame children: - type: LayoutBox margin: large children: - type: Label label: jamovi is great? - type: Label label: Of cause it is!Now we can add, move or adjust any control to meet our needs. Here is a list of controls that can make that possible: