BpmnAutoPlace.js 458 B

123456789101112131415161718192021
  1. import { getNewShapePosition } from './BpmnAutoPlaceUtil';
  2. /**
  3. * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus
  4. */
  5. /**
  6. * BPMN auto-place behavior.
  7. *
  8. * @param {EventBus} eventBus
  9. */
  10. export default function AutoPlace(eventBus) {
  11. eventBus.on('autoPlace', function(context) {
  12. var shape = context.shape,
  13. source = context.source;
  14. return getNewShapePosition(source, shape);
  15. });
  16. }
  17. AutoPlace.$inject = [ 'eventBus' ];