Move connections behind shapes

Hi everyone,
I’m using diagram.js in one of my projects. Whenever I connect two objects to each other using modeling.connect(source, target) method. The connection line appears on top of shapes. ex:
image
How can I move these elements to the top?

In a nutshell, there is two things you can do:

Integrate cropping connection docking like this:

const layoutModule = { 
  connectionDocking: CroppingConnectionDocking
};

const diagram = new Diagram({
  modules: [
    ...,
    layoutModule
  ]
});

Checkout this test case for reference, too.

1 Like

Thank you, Nico. The Ordering Provider solution works for me. :+1: