magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.68k stars 103 forks source link

Labeltooltip draw issue #59

Closed JonNeat closed 6 years ago

JonNeat commented 6 years ago

Hi everyone,

Try render this dot:

digraph X { rankdir=LR; "X" [label=Bob, shape=square, URL="Y", style=filled, fillcolor="#dd4477"]; "Y" [label=Bob2, shape=square, URL="Y", style=filled, fillcolor="#ff9900"]; "X" -> "Y" [label=Danser, labeltooltip=asdada]; }

When hovering the X -> Y edge, the tooltip is not displayed. Looking at the HTML it seems to be an order issue.

Move the g-tag for the label above all others in the rendered html and it works.

magjac commented 6 years ago

You've used labeltooltip which works as expected:

image

If you want a tooltip for just the non-label part, use edgetooltip. If you want a tooltip for the whole edge, including the label part, use tooltip.

Thanks for submitting this issue. If you are using this library, don't forget to Watch it to stay tuned for updates or even Star it if you like it.

You can also use Stack Overflow tags d3.js & graphviz or the d3-graphviz Slack to ask for help. Although I make an effort to assist everyone that asks, I am not always available to provide help promptly or directly.

JonNeat commented 6 years ago

Hi @magjac

Thanks for taking your time to reply.

I cannot reproduce what you just said. The tooltip does not show on either: labeltooltip, edgetooltip or tooltip. Tested in both chrome and firefox.

JonNeat commented 6 years ago

untitled

See attached file. Hovering "danser" gives me the graph-label. I'm using labeltooltip here. The other edge's labeltooltip works fine.

magjac commented 6 years ago

I don't understand your last comment. Please provide an example on https://jsfiddle.net/

This one works as expected: https://jsfiddle.net/b4phbmjd/1/

JonNeat commented 6 years ago

@magjac

Thanks for the example. There must be a CSS bug at my end I assume. Very strange.

Edit: Yes, I had a css bug. Be careful of removing pointer-events with css.