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

Various improvements #4

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Various improvements #4

merged 5 commits into from
Aug 6, 2024

Conversation

Thierry61
Copy link
Contributor

Patroon regexp was enhanced to handle optional port name in edge name. Previously this kind of edge was not highlighted.

Another change is when an url is attached to the node: the click command was opening the url but for consistency with nodes without url, we just want to highlight the node instead. I have added a preventDefault call in click handler to correct this. Note that the url remains accessible with the browser contextual menu (right-click).

I have also added some cosmetic modifications:

  • removed "font-size: 20px;" in ".text-highlight-nodes text" and ".text-highlight-edges text" styles to not change shapes footprint (otherwise they tend to collide with neighboring shapes)
  • changed "stroke-width: 10;" to "stroke-width: 2;" in all highlight styles (previously width was way too large)

Lastly I have added a bash script that can modify a svg file to automatically incorporate the needed modifications (add onload handler to svg tag and append svg-script content inside svg body). Note that this script was only tested in a git-bash prompt on Windows.

- change patroon regexp to handle optional port name in edge name
- remove "font-size: 20px;" in ".text-highlight-nodes text" and ".text-highlight-edges text" styles to not change shapes footprint
- change "stroke-width: 10;" to "stroke-width: 2;" in all highlight styles (previous width was too large)
Note that the URL can still be opened with browser contextual menu (right-click)
@Thierry61
Copy link
Contributor Author

Thierry61 commented Jul 10, 2024

Note that the modification mentioned above about patroon regexp partially corrected issue #3: some (but not all) connected edges are highlighted when we click on a node.

I have improved it in my latest commit to allow more ‘:’ separators in edge names. I have tested it on several @martinrieder's examples and it seems to work now.

@martinrieder
Copy link

martinrieder commented Jul 13, 2024

Many thanks for this contribution! 🚀 🌟

Note that there is a draft PR wireviz/WireViz#369 which will add edge drawing inside of the wire boxes.
These are currently part of the HTML table, which is the reason why they do not fully get highlighted.

EDIT: See the following example file generated using the above mentioned PR. I renamed it to .txt, because GH strips the dynamic content on .svg files: demo02.svg.txt
@Thierry61 What needs to be changed on these additional edges for getting them highlighted as well?

@Thierry61
Copy link
Contributor Author

I am not sure of what an edge drawing inside a wire box is and I don’t think that your demo02.svg.txt contains any of them.

But I guess that ex15.svg in @tobiasfalk WireVizin fork has such edges (the pink and red vertical lines inside X1 node)

In fact my correction did animate these inner edges but the problem is that they have multiple paths and svg-script only animated the first one.

So I have added a new commit in my PR that corrects this problem.

@tobiasfalk
Copy link

Currently, the wires inside the table are done by a series of rows where the background color is made so that it looks like the wire(the edge for the wire).
In my fork, the gvpr file gives the option to straighten lines, and with this, it is possible to make straight lines through a table. This is then also used to draw the wires inside the table instead of the coloring of the rows.

@BartBrood BartBrood merged commit d499b09 into BartBrood:main Aug 6, 2024
@BartBrood
Copy link
Owner

BartBrood commented Aug 6, 2024

Hi @Thierry61 thanks for the contributions, i merged the pull request now.

I also added a new way of doing dynamics using a local WASM library of graphviz, which allows more complex redrawings when e.g. collapsing and expanding clusters.

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.

4 participants