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

Suggestions for graph visualization #73

Open
nvaytet opened this issue Nov 17, 2023 · 3 comments
Open

Suggestions for graph visualization #73

nvaytet opened this issue Nov 17, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@nvaytet
Copy link
Member

nvaytet commented Nov 17, 2023

After using sciline for a bit while developing the SANS direct beam, I've come accross a couple of things that are slightly annoying when trying to visualize the pipeline.

  1. In Jupyter, since we moved to representing the graph as an SVG where we can copy/paste the names in the boxes, it now always fits the graph to the width of the page, meaning that a full workflow graph will always be small and unreadable, while the old png repr was an large image you could navigate with a scrollbar. I think it would be nice to at least have the option of requesting a different output format for the graph visualization, e.g. format='svg' by default, with 'png' available.

  2. Another thing that would be really neat, before going to a full-blown interactive visualization of graphs, would be to make inspecting intermediate steps even easier. Instead of having to copy/paste the name of the quantity you want to inspect, then having to type pipeline.compute(MaskedDirectBeam), if we could somehow make the boxes clickable which would then copy into the clipboard that pipeline.compute(...) code, so that you only need to paste in a cell?

I suspect this copy on click cannot be done without some javascript, which we might not want to have. Maybe an alternative would be to make them into links, where the link url wouldn't be a url, but pipeline.compute(MaskedDirectBeam) instead, and one could right click and do 'copy link address'?

@nvaytet nvaytet added the enhancement New feature or request label Nov 17, 2023
@jl-wynen
Copy link
Member

About point 2:

You would need to get the name of the pipeline from somewhere. We could of course simply use pipeline but that won't always work. Or we inspect the source code of the call to visualize and extract it from there. But that is can easily go wrong.

@SimonHeybrock
Copy link
Member

I agree, I don't really see 2.) happening, too little utility for too much work and things that can go wrong.

@jokasimr
Copy link
Contributor

jokasimr commented Dec 14, 2023

About point 1:

I agree it's important that the graphs are easy to view. However, in the docs the opposite effect happens. That is, previously the graphs were fit to the container and became small and unreadable, but now they overflow and are scrollable. Preferably we want the later behavior in both environments. It would also be nice to be able to open the image in a new tab as was possible previously when the svgs were rendered in <img> tags.
I'm not sure what the solution is, perhaps we can change the html in the repr to fix the behavior in notebooks and make the images easy to open in a new tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants