stateObject = State({
instructions: State.Raw(h =>
h(
'p',
null,
`
Hello! This is just a prototype of a controls widget I've been
iterating on for a while. Modify the values and observe the
effect it has on the output!`
)
),
name: 'controls-state + controls-gui Prototype',
color: '#4499ff',
'say hi': () => console.log('Hello!'),
simulation: {
running: false,
method: State.Select('RK2', { options: ['Euler', 'RK2', 'RK4', 'RK45'] }),
iterations: State.Slider(10, { min: 0, max: 20, step: 1 }),
shape: { width: 640, height: 480 }
},
jsonOutput: State.Section(
{
output: State.Raw((h, { state }) =>
h('pre', null, JSON.stringify(state, null, 2))
)
},
{ enumerable: false, label: 'JSON Output' }
)
})