Skip to content

feat(dia.Paper): add cellView show/hide API #2902

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

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

zbynekstara
Copy link
Contributor

@zbynekstara zbynekstara commented Mar 11, 2025

Description

Adds requestCellViewVisibility(cell, toggle) and isCellViewExplicitlyHidden(cell) functions:

  • To request the cellView of a given cell to be shown, call requestCellViewVisibility(cell, true).
  • To request the cellView of a given cell to be hidden, call requestCellViewVisibility(cell, false).
  • To check whether the cellView of a given cell is currently explicitly hidden, call isCellViewExplicitlyHidden(cell).

Link visibility automatically responds to explicit element visibility:

  • Any link that depends on an element (i.e. an element is its source/target, or the link is connected to a link that has an element as its ultimate source/target) gets hidden when the end element in question is explicitly hidden.
  • Similarly, if an explicitly hidden element was the only thing that previously prevented any links from being shown, those links get shown when the element in question is explicitly shown.

Note that requestCellViewVisibility(cell, toggle) triggers an asynchronous request - the change happens on next animation frame. If the change is needed immediately, use requestAnimationFrame() or trigger paper update manually via paper.checkViewport(); paper.updateViews();.

Motivation and Context

Allows specific models to be set which should always be hidden no matter what the viewport paper option says.

@zbynekstara zbynekstara marked this pull request as ready for review March 31, 2025 07:53
@zbynekstara zbynekstara changed the title feat(dia.Paper): add view show / hide API feat(dia.Paper): add cellView show / hide API Apr 3, 2025
@zbynekstara zbynekstara changed the title feat(dia.Paper): add cellView show / hide API feat(dia.Paper): add cellView show/hide API Apr 3, 2025
@zbynekstara zbynekstara marked this pull request as draft April 22, 2025 13:07
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.

1 participant