-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/DiagramViewModel.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/PageViewModel.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/views/Markdown.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/views/Markdown.kt
Outdated
Show resolved
Hide resolved
480d611
to
7d6f748
Compare
There was a problem hiding this 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.
src/main/kotlin/nl/avisi/structurizr/site/generatr/CreateStructurizrWorkspace.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/C4PlantUmlExporterWithElementLinks.kt
Outdated
Show resolved
Hide resolved
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.
05e0281
to
b73f937
Compare
Both nits are addressed. Yeah, I've struggled as well with the |
@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. |
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.