updating the docs, site mkdocs site on the way

This commit is contained in:
jean-emmanuel 2016-03-30 17:08:56 +02:00
parent df1c2d26f4
commit 0d5b1a0c0c
20 changed files with 619 additions and 247 deletions

View file

@ -0,0 +1,31 @@
## User interface
----
## Editor
The session editor can be enabled in the side panel. Once enabled, clicking on a widget or on a tab will make it the *selected object*, adding a fancy dashed blue border to it.
### Properties
All the selected object's properties are displayed and can be modified in the side panel. Any modification will redraw the object **and all its children** if the submitted data is valid. Please refer to the [widgets reference](widgets-generics.md) for the list of valid options.
Widgets containers such as tabs, strips and panels will also list their children here, which can be reordered using drag-and-drop.
### Size / Position
The selected object can be resized using its south, south-east and east handles. It can be dragged with its north handle.
### Context menu
Right clicking on a widget or on a tab will also display a context menu providing useful utilities :
- `copy`: copy widget's data
- `cut`: copy widget's data and delete selected widget
- `paste`: paste copied widget in selected container
- `Add widget`: create a new widget in selected container
- `Add tab`: create a new tab in selected container
- `Delete`: delete selected tab or widget

View file

@ -0,0 +1,74 @@
## Session file
A valid session file is a javascript file that returns, when eval'd, an array of tab objects. It can be written as a javascript object :
```js
[
{
label:"A tab containing widgets",
widgets: [
{
// widget properties
},
{
// etc
}
]
},
{
label:"A tab containing tabs",
tabs: [
{
// tab properties
},
{
// etc
}
]
},
{
// tab properties
}
]
```
It can also be a self invoking function that returns an array of tab objects :
```js
(function(){
var tabs = []
for (for i in [0,1,2,3]) {
tabs.push({
id:'tab'+i,
widgets: [
{
id:'tab'+i+'fader',
type:'fader'
}
// etc
]
})
}
return tabs
}()
```
----
## Tab object
### `label`
- type: `string`
- default: `Unnamed`
### `widgets`
- type: `array`
- default: `[]`
- usage: each element of the `array` must be a `widget` object. A tab cannot contain widgets and tabs simultaneously.
### `tabs`
- type: `array`
- default: `[]`
- usage: each element of the `array` must be a `tab` object. A tab cannot contain widgets and tabs simultaneously.

View file

@ -0,0 +1,29 @@
# Theming
Theming is as simple as writing a tiny css file that will override the default style variables defined in [_vars.scss](../../browser/scss/_vars.scss) :
```css
:root {
--color-accent:red;
}
```
This will change the default accent color to red. Variables can also be overridden for a specific subset of elements, for example :
```css
.panel-container {
--color-text:blue;
}
```
This will change the default text color to blue for all elements in panel widgets.
Of course, regular css is also allowed :
```css
.widget .input {
display: none;
}
```
This will hide the widgets' value inputs.

View file

@ -0,0 +1,101 @@
## Widgets generics
Widget objects share a set of generic properties described below. Each widget type comes with an additional set of specific properties which are documented in these pages:
- [Sliders](widgets-specifics/sliders.md)
- [Buttons](widgets-specifics/buttons.md)
- [Pads](widgets-specifics/pads.md)
- [Matrices](widgets-specifics/matrices.md)
- [Plots](widgets-specifics/plots.md)
- [Containers](widgets-specifics/containers.md)
----
## Basics
#### `type`
- type: `string`
- default: `fader`
#### `id`
- type: `string`
- default: generated unique 'widget_n'
- usage: widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages.
----
## Style
#### `label`
- type: `string|false`
- default: `auto`, which displays `id`
- usage: set to `false` to hide completely
#### `top` / `left`
- type: `number|percentage`
- default: `auto`
- usage:
- when both `top` and `left` are set to `auto`, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).
- otherwise, the widget will be absolutely positioned
#### `width` / `height`
- type: `number|percentage`
- default: `auto`
#### `color`
- type: `string`
- default: `auto`, inherited accent color
- usage: any valid `css` color code is valid, this will change the default accent color for the widget and all its children
#### `css`
- type: `string`
- default: *empty*
- usage: the `css` property can be used to override inherited [theming](theming.md) variables. Also, some widgets expose specific theming variables that allow a finer customization. Standard `css` properties can be applied to the widget's root element though this property.
----
## OSC
#### `precision`
- type: `integer`
- default: `2`
- usage: the `precision` property defines the number of decimals to display and to send. Set to `0` to send `integers` only.
#### `target`
- type: `array`
- default: `[]`
- usage:
- this defines the targets of the widget's osc messages
- each element of the `array` must be a string formatted as follows : `"ip:port"`
- multiple targets can be specified : `["ip1:port1","ip2:port2"]`
#### `path`
- type: `string`
- default: `/widgets_id`
- usage: this is the `path` of the osc messages sent by the widget
#### `preArgs`
- type: `array`
- default: `[]`
- usage:
- each element of the `array` defines a constant value that will be prepended to the osc message
- values can be defined as objects if the type needs to be specified (ie different from the default implied by the `precision`)
- example:
```js
[
"1", // this will always be sent as a string
0.5, // this will be sent as an integer if precision equals 0
1, // this will be sent as float if precision is different from 0
{
type:"float",
value:0.5
},
{
type:"integer",
value:1
}
]
```

View file

@ -0,0 +1,77 @@
## Buttons
Buttons are exactly what you think they are.
----
## Toggle
```js
{
type:'toggle',
// etc
}
```
### `on`
- type: `string|number|object`
- default: `1`
- usage: defines which value is sent on `on` position
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
### `off`
- type: `string|number|object`
- default: `0`
- usage: defines which value is sent on `off` position
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
----
## Push
```js
{
type:'push',
// etc
}
```
### `on`
- type: `string|number|object`
- default: `1`
- usage: defines which value is sent when pushing the button
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
### `off`
- type: `string|number|object`
- default: `0`
- usage: defines which value is sent when releasing the button
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
Setting the `push`'s value externally (via osc or widget linking/cloning) will toggle it's inner light.
----
## Switch
```js
{
type:'switch',
// etc
}
```
### `values`
- type: `array|object`
- default: `{"Value 1":1,"Value 2":2}`
- usage:
- `array` of possible values to switch between : `[1,2,3]`
- `object` of `"label":value` pairs

View file

@ -0,0 +1,24 @@
# Containers
Containers can contain any widgets
## strip :
Strips can contain any number of widgets, which can't be absolutely positioned and whose size can't overflow their parent's.
```js
type:'strip',
horizontal:false, // [bool] set to true to display widgets horizontally
widgets: [] // [array] of widget objects
```
## panel :
Panels can contains tabs or widgets. These can be absolutely positioned and can overflow their parent's size (which will then display scrollbars).
```js
type:'panel',
scroll:true, // [bool] set to false to disable scrollbars
widgets: [], // [array] of widget objects
tabs: [] // [array] of tab objects
```

View file

@ -0,0 +1,50 @@
# Matrices
Matrices are special containers that only contain one type of widget. All contained widgets will be traversed by single dragging gestures.
## multifader
```js
type:'multifader',
strips:2, // [integer] number of faders
range: {"min":0,"max":1}, // [object] defining the breakpoints of the fader
// keys can be percentages or 'min' / 'max'
logScale: false, // [bool] use logarithmic scale (log10)
unit: false, // [string] value suffix
absolute:false // [bool] set to true for absolute value on touch/click instead of relative dragging
```
*This creates a row of vertical faders that respond to the same gesture. Each of these faders will receive its parent's properties and the following (where X is the fader's index in the row) :*
```js
id:PARENT_ID_X,
label: X,
path: PARENT_PATH/X
```
## multitoggle
```js
type:'multitoggle',
matrix:[2,2], // [array] [number of columns, number of rows]
on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending )
off:0, // [string|number|false] value sent when toggle is off (false to prevent sending )
```
*This creates a matrix of toggles that respond to the same gesture. Each of these toggles will receive its parent's properties and the following (where X is the toggle's index in the row) :*
```js
id:PARENT_ID_X,
label: X,
path: PARENT_PATH/X
```
## multipush
```js
type:'multipush',
matrix:[2,2], // [array] [number of columns, number of rows]
on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending )
off:0, // [string|number|false] value sent when toggle is off (false to prevent sending )
```
*This creates a matrix of push buttons that respond to the same gesture. Each of these buttons will receive its parent's properties and the following (where X is the button's index in the row) :*
```js
id:PARENT_ID_X,
label: X,
path: PARENT_PATH/X
```

View file

@ -0,0 +1,75 @@
## Pads
Pads are multidimensional widgets that output multiple values.
----
## XY
```js
{
type:'xy',
// etc
}
```
#### `range`
- type: `object`
- default:
`{
x:{"min":0,"max":1},
y:{"min":0,"max":1}
}`
- usage: defines the `x` and `y` axis (no breakpoints, only `min` and `max`)
#### `logScaleX`
- type: `boolean`
- default: `false`
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
#### `logScaleY`
- type: `boolean`
- default: `false`
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
#### `snap`
- type: `boolean`
- default: `false`
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
#### `split`
- type: `boolean|object`
- default: `false`
- usage:
- set to `true` to send separate osc messages for `x` and `y` axis. The `path` will be the same as the widget's with `/x` or `/y` appended to it
- can be set as an object to specify a different `path` : `{x:'/osc_path_x', y:'/osc_path_y'}`
----
## RGB
RGB is a variant of XY, it outputs rgb values between 0 and 255.
```js
{
type:'rgb',
// etc
}
```
#### `precision`
- default:`0`
#### `snap`
- type: `boolean`
- default: `false`
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
#### `split`
- type: `boolean|object`
- default: `false`
- usage:
- set to `true` to send separate osc messages for `r` and `g` & `b`. The `path` will be the same as the widget's with `/r`, `/g` or `/b` appended to it
- can be set as an object to specify a different `path` : `{r:'/osc_path_r', g:'/osc_path_g',b:'/osc_path_b'}`

View file

@ -0,0 +1,49 @@
# Plots
Plots are tools that display other widgets' state or incomming osc messages. They are not sensitive to mouse and touch interactions.
## led
```js
type:'led',
range:x:{"min":0,"max":1} // [object] minimum and maximum values for X and Y axis
logScale: false, // [bool] use logarithmic scale
```
## plot
The plot receives an array of [x,y] coordinates and draws them on a chart with linear or logarithmic interpolation.
```js
type:'plot',
points:[], // [string|array]
// string : a single widget id, whose multiple values will be displayed,
// evenly spaced on the x-axis
// array : an array of [x,y] coordinates, which can be numbers
// or widget id strings, for example :
// [[0,0],[0.5,"some_widget_id"],["some_other_id","another_id"]]
range:{ // [object] minimum and maximum values for X and Y axis
x:{"min":0,"max":1},
y:{"min":0,"max":1}
},
logScaleX: false, // [bool] use logarithmic scale for X axis (log10)
logScaleY: false // [bool] use logarithmic scale for y axis (log10)
```
## visualizer
The visualizer displays the evolution in time of a received value (through osc) *or* another widget's value.
```js
type:'visualizer',
widgetId:'', // [string] widget id (its value will be displayed instead of the incoming osc)
duration:1, // [number] window size in seconds
range:{"min":0,"max":1}, // [object] minimum and maximum values the Y axis
logScale: false, // [bool] use logarithmic scale for Y axis (log10)
```
## text
```js
type:'text',
vertical:false, // [bool]
```

View file

@ -0,0 +1,137 @@
## Sliders
Sliders are unidimensional widgets that output one value at a time.
----
## Fader
```js
{
type:'fader',
// etc
}
```
#### `horizontal`
- type: `boolean`
- default: `false`
- usage: set to true to display the fader horizontally
#### `align`
- type: `string`
- default: `center`
- usage: set to `left` or `right` to display one scale instead of two
#### `noPip`
- type: `boolean`
- default: `false`
- usage: set to true to hide the scale
#### `range`
- type: `boolean`
- default: `object`
- usage: `range` defines the breakpoints of the fader's scale
- keys can be percentages and/or `min` / `max`
- values can be numbers or object if a custom label is needed
- example:
```js
range: {
"min":0,
"50%":1,
"max": {"inf":10} // "inf" will be used as a custom label on the scale
}
```
#### `horizontal`
- type: `boolean`
- default: `false`
- usage: set to true to display the fader horizontally
#### `logScale`
- type: `boolean`
- default: `false`
- usage: set to true use logarithmic scaling between breakpoints
#### `unit`
- type: `string`
- default: `empty`
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
#### `snap`
- type: `boolean`
- default: `false`
- usage: by default, dragging the widget will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
#### `meter`
- type: `boolean`
- default: `false`
- usage: set to true to display a vu-meter next in the fader
- the meter's `id` will be the same as the fader's with `#meter` appended to it
- the meter's `path `will be the same as the fader's with `/meter` appended to it
#### `css`
```
--color-gauge:color;
--color-knob:color;
--color-pips:color;
```
----
## Knob
```js
{
type:'knob',
// etc
}
```
#### `noPip`
- type: `boolean`
- default: `false`
- usage: set to true to hide the scale
#### `range`
- type: `boolean`
- default: `object`
- usage: `range` defines the breakpoints of the fader's scale
- keys can be percentages and/or `min` / `max`
- values can be numbers or object if a custom label is needed
- example:
```js
range: {
"min":0,
"50%":1,
"max": {"inf":10} // "inf" will be used as a custom label on the scale
}
```
#### `logScale`
- type: `boolean`
- default: `false`
- usage: set to true use logarithmic scaling between breakpoints
#### `unit`
- type: `string`
- default: `empty`
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
#### `snap`
- type: `boolean`
- default: `false`
- usage: by default, dragging the widget *vertically* will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
#### `css`
```
--color-gauge:color;
--color-knob:color;
--color-pips:color;
```