Custom widgets can be extended with:
- properties, which define configurable settings stored with the story,
- methods, which can be called from scripts to control the widget.
Properties and methods enable configuration and script-driven control of the custom widget.
Exercise
In this exercise, you will add a new property and expose a method that allows you to change the chart type dynamically from a story script.
You will:
- define a custom property in the widget metadata
- expose a method for script-based interaction
- control the widget behavior using a button in a story
After modifying the custom widget files locally, you will:
- add a button and assign a script to it
- click the button
- observe that the chart changes from a line chart to a bar chart.
Result
The widget can be controlled via scripting, allowing the chart type to be changed dynamically.