Skip to content

Commit e79d855

Browse files
authored
refactor: simplify overlay management in JS bridge code
Call the new `getModelElementsByIds` method introduced in bpmn-visualization@0.39.0
1 parent cfd60d9 commit e79d855

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

inst/htmlwidgets/bpmnVisualizationR.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ HTMLWidgets.widget({
6464
const overlayConfig = {...rest};
6565

6666
if(enableDefaultOverlayStyle && !(overlayConfig.style && overlayConfig.position)) {
67-
const elementsByIds = bpmnVisualization.bpmnElementsRegistry.getElementsByIds(elementId);
68-
if (elementsByIds.length) {
69-
const isShape = elementsByIds[0].bpmnSemantic.isShape;
67+
const elements = bpmnVisualization.bpmnElementsRegistry.getModelElementsByIds(elementId);
68+
if (elements.length) {
69+
const isShape = elements[0].isShape;
7070
overlayConfig.style ??= buildDefaultOverlayStyle(isShape);
7171
overlayConfig.position ??= buildDefaultOverlayPosition(isShape);
7272
}
@@ -80,7 +80,7 @@ HTMLWidgets.widget({
8080
},
8181

8282
// Make the bpmnVisualization object available as a property on the widget instance we're returning from factory().
83-
// This is generally a good idea for extensibility--it helps users of this widget interact directly with bpmnVisualization, if needed.
83+
// This is generally a good idea for extensibility: it helps users of this widget to interact directly with bpmnVisualization, if required.
8484
s: bpmnVisualization
8585
};
8686
}

0 commit comments

Comments
 (0)