-
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
Fixes #25 #26
base: master
Are you sure you want to change the base?
Fixes #25 #26
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,26 @@ val renderer = Renderer( | |
) | ||
``` | ||
|
||
**For SVG rendering (JVM, Scala.js):** | ||
|
||
It is possible to specify for each `RefTree.Ref` | ||
a hyperlink URL and a tooltip text | ||
by providing associating to the `RefTree.Ref.id` a URL string | ||
or a tooltip string respectively. | ||
|
||
```scala | ||
import reftree.render._ | ||
import reftree.diagram._ | ||
|
||
val renderer = Renderer( | ||
renderingOptions = RenderingOptions( | ||
density = 75, | ||
nodeURLs = Map("1" -> "http://www.example.org", "2" -> "http://www.foobar.org"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you give a real-life example of the URL you would use? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another thing, I am not sure I like the idea of attaching this to internal ids, because those ids are not guessable or even deterministic. Is it important to you to specify the tip explicitly? What if reftree generated tips automatically using |
||
nodeTips = Map("1" -> "example", "2" -> "foobar")), | ||
format = "svg" | ||
) | ||
``` | ||
|
||
There are two ways to use renderers: | ||
|
||
**JVM** | ||
|
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.
Would this create extra anchors as a side effect and therefore affect alignment? Maybe if “pretty” tooltips are important, it would be better to use some other mechanism for anchors.