Skip to main content

Controlled shapes

In order to change shapes configs dynamically, you first need to get the Stage object from <AnnotationViewer /> using getStage


{    methods: {         getStage: function (stage) {            this.stage = stage        }    }}

Then use utils function to change shape configs and trigger canvas redraw when it's needed using setShapeConfig, drawShape and drawLayer.

Full example#