kiln / flourish-sdk

The SDK for developing Flourish templates
Other
80 stars 16 forks source link

Feature request: default values for settings via template.yml #70

Open aendra-rininsland opened 2 years ago

aendra-rininsland commented 2 years ago

Is there any way to specify a default value for settings in template.yml? It doesn't seem so via the docs here

robinhouston commented 2 years ago

Hi @aendrew; yes, you are correct that there is not. The usual idiom is to define the default values as part of the state definition in the template code.

Can you say a bit more about why this would be useful to you?

aendra-rininsland commented 2 years ago

Hi @robinhouston — boolean toggles are a good example of this, often you want one enabled by default. Setting boolean toggles in the Settings pane is really confusing if done via template code, I find; what's the usual idiom? Do you call update before draw to update the Flourish UI with those settings or something?