diff --git a/src/browser/js/app/widgets/plots/plot.js b/src/browser/js/app/widgets/plots/plot.js index 9fd671c9..00fb7942 100644 --- a/src/browser/js/app/widgets/plots/plot.js +++ b/src/browser/js/app/widgets/plots/plot.js @@ -9,17 +9,26 @@ module.exports = class Plot extends _plots_base { _plot:'plot', - rangeX: {min:0,max:1}, - rangeY: {min:0,max:1}, - origin: 'auto', - dots: true, - bars: false, - logScaleX: false, - logScaleY: false, - smooth: false, - pips:true, + rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'}, + rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'}, + logScaleX: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (log10)'}, + logScaleY: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (log10)'}, + origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it.'}, + dots: {type: 'boolean', value: true, help: ''}, + bars: {type: 'boolean', value: false, help: 'Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing)'}, + smooth: {type: 'boolean|number', value: false, help: 'Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`)'}, + pips:{type: 'boolean', value: true, help: 'Set to `false` to hide the scale'}, - }, ['target', 'precision', 'bypass'], {}) + }, ['target', 'precision', 'bypass'], { + + value: {type: 'array|string', help: [ + '- `Array` of `y` values', + '- `Array` of `[x, y]` `array` values', + '- `String` `array`', + '- `String` `object` to update specific coordinates only: `{0:1, 4:0}` will change the 1st and 5th points\' coordinates', + ]} + + }) } diff --git a/src/browser/js/app/widgets/plots/rgbled.js b/src/browser/js/app/widgets/plots/rgbled.js index 76e957c5..fbf06441 100644 --- a/src/browser/js/app/widgets/plots/rgbled.js +++ b/src/browser/js/app/widgets/plots/rgbled.js @@ -5,7 +5,15 @@ module.exports = class Rbgled extends Widget { static defaults() { - return super.defaults({}, ['color', 'target', 'precision', 'bypass'], {}) + return super.defaults({}, ['color', 'target', 'precision', 'bypass'], { + + value: {type: 'array|string', help: [ + '- `Array`: `[r, g, b]` (`r`, `g` and `b` between `0` and `255`)', + '- `Array`: `[r, g, b, alpha]` (`alpha` between `0` and `255`)', + '- `String`: CSS color', + ]} + + }) } diff --git a/src/browser/js/app/widgets/plots/svg.js b/src/browser/js/app/widgets/plots/svg.js index 4056e2b1..dd3d836e 100644 --- a/src/browser/js/app/widgets/plots/svg.js +++ b/src/browser/js/app/widgets/plots/svg.js @@ -9,7 +9,11 @@ class Svg extends Widget { _svg:'svg', - svg:'', + svg: {type: 'string', value: '', help: [ + 'Svg xml definition:', + '- will be wrapped in a `` element', + '- `` commands support a special percent notation (`%x` and `%y`)' + ]} }, ['color', 'target', 'precision', 'bypass'], {}) diff --git a/src/browser/js/app/widgets/plots/text.js b/src/browser/js/app/widgets/plots/text.js index 0808868e..4282d37a 100644 --- a/src/browser/js/app/widgets/plots/text.js +++ b/src/browser/js/app/widgets/plots/text.js @@ -9,9 +9,12 @@ module.exports = class Text extends Widget { _text: 'text', - vertical:false, - wrap:false, - align:'', + vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'}, + wrap: {type: 'boolean', value: false, help: [ + 'Set to `true` to wrap long lines automatically.', + 'This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property'}, + ]}, + align: {type: 'string', value: '', help: 'Set to `left` or `right` to change text alignment (otherwise center)'}, }, ['color', 'target', 'precision', 'bypass'], {}) diff --git a/src/browser/js/app/widgets/plots/visualizer.js b/src/browser/js/app/widgets/plots/visualizer.js index 21653556..4dc94b52 100644 --- a/src/browser/js/app/widgets/plots/visualizer.js +++ b/src/browser/js/app/widgets/plots/visualizer.js @@ -9,12 +9,12 @@ module.exports = class Visualizer extends _plots_base { _visualizer:'visualizer', - duration:1, - range: {min:0,max:1}, - origin: 'auto', - logScale: false, - smooth: false, - pips:true, + duration: {type: 'number', value: 1, help: 'Defines visualization duration in seconds'}, + range: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'}, + origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it'}, + logScale: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis'}, + smooth: {type: 'boolean|number', value: false, help: 'Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`)'}, + pips:{type: 'boolean', value: true, help: 'Set to `false` to hide the scale'}, }, ['target', 'precision', 'bypass'], {})