Skip to content

Instantly share code, notes, and snippets.

@mathisonian
Last active August 13, 2017 08:18
Show Gist options
  • Save mathisonian/2b2d69c734ce73479cbf4a345f3b8d3d to your computer and use it in GitHub Desktop.
Save mathisonian/2b2d69c734ce73479cbf4a345f3b8d3d to your computer and use it in GitHub Desktop.
idyll vars

Setting value on a variable just defines its initial value, if you want a variable that updates derived variables are available:

[var name:"x" value:1 /]
[derived name:"dataToBeCharted" value:`[ {x: 0, y: 0.5}, {x: 3.5, y: 0.5}, {x: 4, y: x}, {x: 4.5, y: 2}, {x: 5, y: 0.5}, {x: 8, y: 0.5} ]` /]

[Range value:x min:0 max:100 step:5/]
[Display value:x /]

[Chart type:"line" data:`dataToBeCharted` /]

or you can just put the expression directly on the chart:

[var name:"x" value:1 /]

[Range value:x min:0 max:100 step:5/]
[Display value:x /]

[Chart type:"line" data:`[ {x: 0, y: 0.5}, {x: 3.5, y: 0.5}, {x: 4, y: x}, {x: 4.5, y: 2}, {x: 5, y: 0.5}, {x: 8, y: 0.5} ]` /]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment