Skip to content

Z-Index Mode

Decide how much of the stacking order the canvas manages. ZIndexMode Auto lifts the selection and keeps a child above its group, Basic only lifts the selection, and Manual leaves everything to the ZIndex you set; ElevateNodesOnSelect and ElevateEdgesOnSelect switch the lifting itself, and BringToFrontAsync and SendToBackAsync reorder the list.

Group
Red (z=1)
Blue (z=2)
Under
Over
A
B
C
D
Child
bit Blow

Try it

  • Switch between Auto, Basic and Manual. The Child node is listed before its Group: only Auto draws it on top, in the others the group covers it.
  • Click the Under card: in Auto and Basic it rises above the Over card while selected. Untick Elevate nodes on select, or pick Manual, and it stays underneath.
  • Drag the Under card across the Over card: a dragged node is lifted in Auto and Basic even with elevation off, but not in Manual.
  • Select the Under card and press Bring to front, then click the background: it now stays on top, because it moved to the end of the node list. Send to back moves it back to the start.
  • Swap explicit z-index trades the Red and Blue cards' ZIndex: an explicit value wins in every mode, so selecting either changes nothing.
  • Click the red edge where it crosses the green one: it turns the selection colour but stays under the green edge. Tick Elevate edges on select and the selected edge is drawn over it.

How it works

  • ZIndexMode is BlowZIndexMode.Auto (the default: selection and dragging lift, children drawn above their group), Basic (selection and dragging lift; nesting order is left to the list) or Manual (nothing is lifted, not even a dragged node).
  • ElevateNodesOnSelect (default true) lifts a selected node above its peers; dragging lifts a node whatever it says, except in Manual mode.
  • ElevateEdgesOnSelect (default false) draws a selected edge after the others. Edges share one SVG layer under all the nodes, so this, like an edge's ZIndex, orders edges only among themselves.
  • An explicit ZIndex on a node or an edge always wins, in every mode.
  • Without a ZIndex, nodes are drawn in list order. BringToFrontAsync() and SendToBackAsync() - on the selection when no nodes are passed - move nodes, with everything nested in them, to the end or the start of Nodes, as one undo step labelled "order". A child sent to the back goes to the back of its group, just after its parent.
An unhandled error has occurred. Reload 🗙