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

Make diagram elements clickable #80

Merged
merged 8 commits into from
Nov 11, 2022
Merged

Conversation

jp7677
Copy link
Contributor

@jp7677 jp7677 commented Nov 2, 2022

Creating as a draft since embedding the svg images directly into the html (esp. for markdown) is not that clean.

Please also note that the diagrams are no longer scaled, thus they are always shown with 100% size. I think this is a good thing, but may be not everyone agrees.

@jp7677 jp7677 force-pushed the diagram-links branch 2 times, most recently from 480d611 to 7d6f748 Compare November 7, 2022 11:40
@jp7677 jp7677 marked this pull request as ready for review November 7, 2022 11:41
@jp7677 jp7677 mentioned this pull request Nov 11, 2022
Copy link
Collaborator

@dirkgroot dirkgroot left a comment

Choose a reason for hiding this comment

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

Really cool! Being able to click on elements on diagrams makes navigating the site very smooth and intuitive!

Besides a few minor remarks, the code looks good to me, except for the svgFactory thing. I understand why it's there, but I'd prefer a simpler solution, if possible, but I can't think of one right now. I'm going to give it some thought.

We need the URL later for our own links.
Furthermore the URL's will appear that way in the UI.
Introduce our own exporter which adds relative URL's in the generated C4-plantUml diagrams. Those URL's wil also appear in the generated SVG images.
Doing so makes the links inside the svg image clickable.
This includes adding jsoup as dependency for html document processing.
This removes duplication and allows us to make the generatorContext in PageViewModel protected again.
This makes viewing larger diagrams much more fun.
@jp7677
Copy link
Contributor Author

jp7677 commented Nov 11, 2022

Both nits are addressed.

Yeah, I've struggled as well with the svgFactory, this is what I came up with after several attempts :). Other solutions for combining the generated and generating world where imho even uglier, like putting more properties in the context and then doing the file loading in the view models.

@dirkgroot
Copy link
Collaborator

@jp7677 I see. I'm okay with merging this. I'll create an issue to remind myself to think about a better design for this, but it's good enough as it is, I think.

@dirkgroot dirkgroot merged commit b6433e1 into avisi-cloud:main Nov 11, 2022
@jp7677 jp7677 deleted the diagram-links branch November 28, 2022 12:48
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.

2 participants