How to make classes and packages clickable in HTML pages?

0 votes
asked Sep 23, 2016 in To be sorted by anonymous
I am using PlantUML to generate diagrams from Java source code.

One feature that I do not know how to do in PlantUML that I find very easy to do in Gaphviz is the ability to go to a URL when I click on a class in a diagram. I would love to have this for packages as well.

Another feature is the ability to have a mouse-tip appear when hovering over a class in Graphviz. Would love to have this for packages as well.

Any way to do this in PlantUML?

1 Answer

+1 vote
answered Sep 23, 2016 by plantuml (295,760 points)
This is not very documented (we should probably write a page on this), but you can use hyperlink in your diagram.

See http://plantuml.sourceforge.net/qa/?qa=2682/hyperlink-in-component-diagram

or http://plantuml.sourceforge.net/qa/?qa=90/web-links-in-generated-images-e-g-using-image-maps

svg generated file are clickable. For png, a cmapx file is generated that you have to include in your HTML line.

Does it help you ?
commented Sep 23, 2016 by anonymous
Yes, perfect. Thank you!

In the links you sent me, I do not see any URLs for packages. Does it work for packages as well?
commented Mar 5, 2017 by mnlipp (240 points)
This does not work for nested packages

```
package org.jgrapes {
    package org.jgrapes.core [[org/jgrapes/core/package-summary.html#package.description]] {
    }

    package org.jgrapes.io {
    }

    package org.jgrapes.http {
    }
}
```

No link generated here.
commented Mar 7, 2017 by plantuml (295,760 points)
Thanks for the report!
This should be fixed in last beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
Tell us if it's not working for you.
Regards,
commented Mar 7, 2017 by mnlipp (240 points)
Oh, great! Been too impatient, opened a [github issue](https://github.com/plantuml/plantuml/issues/37) an hour ago (just seen your comment, now I know for the future).

Thanks for your excellent work. Would it be possible to provide such betas as maven snapshots? Getting a jar that is usually taken from a repository in your project configuration is always a bit of a nuisance...
commented Mar 7, 2017 by plantuml (295,760 points)
Unfortunatly, we've got sometimes several beta per day, so we cannot push them to maven.
Anyway, we're going to publish a maven version this week-end.
...