⚠️ This is a highly experimental feature! Do NOT use this in production!
A utility that detects elements at a point or in a rectangular area.
To verify the usefulness of such a feature this project also implements ExpandSubProcessBehavior solving a common issue in bpmn-js.
const elementDetection = bpmnModeler.get('elementDetection');
// works with points
const point = {
x: 100,
y: 100
};
let detectedElements = elementDetection.detectAt(point);
// works with rects
const rect = {
x: 100,
y: 100,
width: 100,
height: 100
};
detectedElements = elementDetection.detectAt(rect);
const trbl = {
top: 100,
right: 200,
bottom: 200,
left: 100
};
detectedElements = elementDetection.detectAt(trbl);
Install:
npm install
Run an example featuring ExpandSubProcessBehavior:
npm start
Test:
npm test
or
npm run dev
MIT