Change minimum lane dimensions

The minimum dimensions for lanes is defined in https://github.com/bpmn-io/bpmn-js/blob/v7.3.1/lib/features/modeling/behavior/ResizeBehavior.js:

export var LANE_MIN_DIMENSIONS = { width: 300, height: 60 };

How can I adjust these dimensions?

I know that I can’t import and change LANE_MIN_DIMENSIONS, since it is read only when imported.

Thanks!

In the meantime, I figured out that I can create a Custom Modeler and then create custom components until I end up in ResizeBehavior:
CustomModeler --> custom ModelingModule --> custom BehaviorModule --> custom ResizeBehavior + ResizeUtil

Please let me know if there is way to directly change behavior in the Modeler without recursively adapting all the components.

Hi,

LANE_MIN_DIMENSIONS is used in two places:

  1. ResizeBehavior via ResizeUtil
  2. SpaceToolBehavior

Regarding the first component, you could overwrite values written to the context via a listener with lower priority:

export default function CustomResizeBehavior(eventBus) {
  eventBus.on('resize.start', /* any priority lower than 1500 */ 1400 , function(event) {
    var context = event.context,
        shape = context.shape,
        direction = context.direction,
        balanced = context.balanced;

    if (is(shape, 'bpmn:Lane') || is(shape, 'bpmn:Participant')) {
      context.resizeConstraints = /* custom implementation based on function exported by ResizeUtil*/ {};
    }
  });
}

For the second component, as it is expected to return the value, you would have to set priority to a higher value than in the original component:

export default function CustomSpaceToolBehavior(eventBus) {
  eventBus.on('spaceTool.getMinDimensions', /* higher than 1000 */ 1100, function(context) {
    /* custom implementation based on SpaceToolBehavior */
  });
}