4

In JointJS, how can I add a cell to a graph without triggering any events? When I pass the optional arguments:

{
    silent: true
}

The cell is not rendered in the paper.

sidrakesh
  • 234
  • 2
  • 18
  • "When I pass the optional arguments: `{ silent: true }` The cell is not rendered in the paper." Sounds like JointJS relies on the events? Why are you then trying to disable the event? What is the side effect? Maybe there is a way to bypass it in your code while still triggering the events and not blocking the library...? Could you share more details? – T J Oct 19 '18 at 15:04
  • I'm trying to render the elements without the events for better performance. I have done this for changing the attributes of an element without events, which seriously improved the performance for changing the attributes. I was hoping the same for adding cells. – sidrakesh Oct 21 '18 at 09:42

1 Answers1

1

This is by design, checkout Selection Collection section of jointjs docs.

selection.collection.add(element, { silent: true}); // add element to the collection, but renders no selection box.

Dipen Shah
  • 25,562
  • 1
  • 32
  • 58