-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_ui-definition.Rmd
96 lines (72 loc) · 3.3 KB
/
api_ui-definition.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: "User-interface Definition"
---
The UI YAML is pretty straight forward. 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.
##Properties
Property | Description | Form |
------------- | ------------------------------------------| -------------------- |
`name` | The name of the analysis. | Unique string
`title` | Sets the title to be displayed at the top of the option panel. | string
`jus` | Defines the syntax version used by the u.yaml file. | string of form 'number.number'
`stage` | Sets the stage display filter. | 0 - Released\
1 - In development\
2 - Proposed
`compilerMode` | Sets the compiler interaction mode. | *enum*: tame, aggressive
`children` | Sets the child control definitions. | Array of valid control definitions.
###Example
```YAML
name: descriptives
title: Descriptives
jus: '2.0'
stage: 0
compilerMode: tame
children:
#array of child definitions
```
###Further Detail
The root control is a [`ParentControl`](ui-parentcontrol.html) and as the name suggests serves as a parent to child controls. All parent controls contain the property `children` which defines an array of control definitions to be embedded. All UI design happens within the `children` node 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 `CheckBox` is designed around a `Bool` option type, where as a `ComboBox` displays and writes data to a `List` option. 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 the `type` property needs to be specified (as well as the minimum requirements for that control).
```YAML
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:
###Base Control
- [BaseControl (abstract)](ui-basecontrol.html)
###Layout Controls
- [ParentControl (abstract)](ui-parentcontrol.html)
- [LayoutBox](ui-layoutbox.html)
- [CollapseBox](ui-collapsebox.html)
- [Supplier](ui-supplier.html)
- [VariableSupplier](ui-variablesupplier.html)
- [TargetLayoutBox](ui-targetlayoutbox.html)
####Parent Controls
- [CheckBox](ui-checkbox.html)
- [RadioButton](ui-radiobutton.html)
- [Label](ui-label.html)
###Option Controls
- [TextBox](ui-textbox.html)
- [CheckBox](ui-checkbox.html)
- [RadioButton](ui-radiobutton.html)
- [ComboBox](ui-combobox.html)
- [Label](ui-label.html)
- [ListBox](ui-listbox.html)
- [VariableLabel](ui-variablelabel.html)
- [TermLabel](ui-termlabel.html)
### Display Controls
- [Label](ui-label.html)