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

Graphviz needflow links are broken #1279

Closed
Rubyfi opened this issue Sep 5, 2024 · 5 comments · Fixed by #1339
Closed

Graphviz needflow links are broken #1279

Rubyfi opened this issue Sep 5, 2024 · 5 comments · Fixed by #1339

Comments

@Rubyfi
Copy link
Contributor

Rubyfi commented Sep 5, 2024

Hi all,

I noticed that the links in needflows seem to be broken when they are generated using the new graphviz engine.
See, e.g,, https://sphinx-needs.readthedocs.io/en/latest/directives/needflow.html#needflow Example 1
The need links are always based on the current page.

Furthermore, you can no longer directly click the elements (tested on Firefox and MS Edge, Chrome likely behaves the same).
When you click the image, the svg is first opened separately.
After that, you are able to click the objects which will result in a 404 due to the broken links.

@Rubyfi
Copy link
Contributor Author

Rubyfi commented Sep 5, 2024

I've done some digging and this line seems to be the problem:

lambda n: calculate_link(app, n, fromdocname, relative="."),

Removing the relative argument fixes the issue for me when using graphviz_output_format = "svg".

@chrisjsewell
Copy link
Member

ah yeh I see, I tested this on needs within the same page, and it was working, but apparently not for needs on different pages.

Furthermore, you can no longer directly click the elements

you could never directly click on the elements with svg, and can't do that also for plantuml.
you can actually now though if you output png

as I mention at the bottom of #1235 (comment),
it seems not possible with SVG to have both transparent backgrounds and directly clickable links 🤔

@Rubyfi
Copy link
Contributor Author

Rubyfi commented Sep 5, 2024

ah yeh I see, I tested this on needs within the same page, and it was working, but apparently not for needs on different pages.

Furthermore, you can no longer directly click the elements

you could never directly click on the elements with svg, and can't do that also for plantuml. you can actually now though if you output png

as I mention at the bottom of #1235 (comment), it seems not possible with SVG to have both transparent backgrounds and directly clickable links 🤔

Thanks for the explanation.
TBH, even as an advocate for dark themes, I'd prefer clickable links over dark/transparent backgrounds.

I also did some further testing.
The path/link thing seems to be dependent on the chosen output format, what a nightmare...

@chrisjsewell
Copy link
Member

You mean if you set graphviz_output_format="png" the link is different?

@Rubyfi
Copy link
Contributor Author

Rubyfi commented Sep 12, 2024

You mean if you set graphviz_output_format="png" the link is different?

Yes, it appears to be the case.
I'll see that I create a minimal example and provide it here.

@chrisjsewell chrisjsewell linked a pull request Oct 28, 2024 that will close this issue
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 a pull request may close this issue.

2 participants