Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dia.HighlighterView): enable positioning of highlighter based on opt.z #2866

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MartinKanera
Copy link
Contributor

@MartinKanera MartinKanera commented Jan 29, 2025

Description

This change introduces the ability to set the stacking order (z-index) for highlighters within the stacking context of dia.CellView. The opt.z controls whether a highlighter is inserted before or after other elements in the DOM hierarchy.

Documentation

Update layer and z sections of the documentation to reflect the changes.

https://docs.jointjs.com/api/dia/HighlighterView/#options

layer

layer - the stacking context of the highlighter. Applicable for mountable highlighters only.

nullRender the highlighter within the dia.CellView, with its position determined by the provided z value. By default, the highlighter is rendered above the cell.
backRender the highlighter behind all the cells.
frontRender the highlighter in front of all the cells.

z

z - determines the stacking order (z-index) of the highlighter within the specified layer or directly within dia.CellView.

  • If layer is defined, the highlighter is inserted into the specified layer at the correct position based on z.
  • If layer is not defined, z represents the index within dia.CellView. If z is a valid number and corresponds to an existing child index, the highlighter is inserted before that child (e.g., if z: 0, the highlighter will be inserted before the first child element of the dia.CellView - effectively resulting in prepending it under everything else); otherwise, it is appended as the last child.

Applicable for mountable highlighters only.

@MartinKanera MartinKanera changed the title feat(dia.HighlighterView): add opt.prepend feat(dia.HighlighterView): enable positioning of highlighter based on opt.z Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants