4

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?

CubeJockey
  • 2,209
  • 8
  • 24
  • 31

1 Answers1

3

Try this function:

rect.resize(200, 60);

You read more about it here.

Andrey Tretyak
  • 3,043
  • 2
  • 20
  • 33