Reputation: 71
I am new to Joint JS and I am not able to dynamically set width and height properties of below element:
var rect = new joint.shapes.basic.Rect({
position: { x: 100, y: 30 },
size: { width: 100, height: 30 },
attrs: { rect: { fill: 'blue' }, text: { text: 'my box', fill: 'white' } }
});
Is there any way to set those properties dynamically?
Upvotes: 4
Views: 2504
Reputation: 3231
Try this function:
rect.resize(200, 60);
You read more about it here.
Upvotes: 3