Habr
1
Hi, is there another way how to update element properties than by
this.modeling.updateProperties(element, {
opacity: 0.18
});
? I am trying to change opacity to all not currently selected elements and it is very very slow if the diagram contains a lot of elements.
Iād avoid using commands for that kind of thing. CSS should do the trick.
.djs-element:not(.selected) {
opacity: 0.5;
}
Habr
3
Ok, and what if I need to change opacity also to the directly connected tasks and links to the selected one?
You can use canvas.addMarker
and canvas.removeMarker
for this:
2 Likes
Habr
5
That is exactly what I was looking for! Thank you sooo much!
1 Like
Habr
6
However this also cause that I drag all of the tasks at once
Sorry 'bout that. My code accidentally mutated the selected elements.
This should work: https://codesandbox.io/s/bpmn-js-sandbox-k0zz8