javascriptrappid

Using RappidJS how can I dynamically add new elements to a rendered stencil


I'm using the kitchen sink demo (https://resources.jointjs.com/demos/kitchensink)

And looking at the docs

https://resources.jointjs.com/docs/rappid/v2.4/ui.html#ui.Stencil

What I can't understand is how can I can take the already rendered stencil as part of the demo add a new element to it dynamically?

I'm thinking something like

var stencil = joint.ui.stencil(App.config.stencil);

Solution

  • Inside of stencil-service.ts add a new item in the object that is returned by getStencilShapes