projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.45k stars 1.16k forks source link

How to re-order nodes by z-index? #974

Closed Marshall200900 closed 1 year ago

Marshall200900 commented 1 year ago

I could not find any way to push a node to foreground and background, so I had to do this:

const background = document.querySelector('[data-nodeid="nodeid"]') as HTMLDivElement;
if (background) {
    background.style.zIndex = '-1';
}

Do not see this as an elegant solution, so question arised: Is there some function in the library to push a node to foreground/background?

Marshall200900 commented 1 year ago

solved by using layers