Skip to content

NAD: Use single foreignObject for all text nodes #691

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

quinarygio
Copy link
Contributor

Please check if the PR fulfills these requirements

  • [x ] The commit message follows our guidelines
  • [x ] Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Fixes #684

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

@quinarygio quinarygio linked an issue Apr 3, 2025 that may be closed by this pull request
Comment on lines 680 to 681
<g class="nad-text-nodes">
<foreignObject id="0-textnode" y="-937.76" x="479.50" height="1" width="1">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the g tag and the foreignObject can be merged together

@@ -679,7 +679,7 @@ path.nad-arrow-in:not(.nad-state-in .nad-arrow-in) {visibility: hidden}
</g>
<g class="nad-text-nodes">
<foreignObject id="0-textnode" y="-937.76" x="479.50" height="1" width="1">
<div xmlns="http://www.w3.org/1999/xhtml" class="nad-label-box">
<div xmlns="http://www.w3.org/1999/xhtml" class="nad-label-box" style="position: absolute; top: 0px; left: 0px" id="0-textnode">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we avoid to repeat the name space in all the divs or is it required? Or is it allowed to put it in the foreignObject?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace is required and it is not possible to put it in foreignObject. I added a

after foreignObject with the declaration of the namespace to avoid repetition

@@ -679,7 +679,7 @@ path.nad-arrow-in:not(.nad-state-in .nad-arrow-in) {visibility: hidden}
</g>
<g class="nad-text-nodes">
<foreignObject id="0-textnode" y="-937.76" x="479.50" height="1" width="1">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make more sense to put the foreignObject in 0,0

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.

[nad] single foreignObject
2 participants