1

I have a d3.js tree that looks like this:

What I want to do is, if the user hovers over a node, a pop-up will appear at that node. How can I achieve this?

H3AR7B3A7
  • 4,366
  • 2
  • 14
  • 37
hpy
  • 41
  • 4
  • CSS `:hover`. Or find the correct D3 docs, since I doubt it's not builtin. – Shilly Jul 08 '22 at 14:08
  • 1
    I want to display node-specific information on the popup, so I don't think CSS alone will work – hpy Jul 08 '22 at 14:09
  • 1
    @Shilly it's not build in. The only thing D3 draws are the axes (for SVG, but not canvas), other than that the user has to create every single element by themselves. – Gerardo Furtado Jul 09 '22 at 04:34
  • Thanks for the edit @H3AR7B3A7. I couldn't get the image to show because I'm a new user. – hpy Jul 09 '22 at 06:53
  • @hpy you'll have to create the tooltips yourself. It's not complicated, this is a simplified explanation I wrote some time ago: https://stackoverflow.com/a/40720100/5768908 – Gerardo Furtado Jul 09 '22 at 07:16
  • @GerardoFurtado I'll try that soon and let you know – hpy Jul 09 '22 at 17:40

1 Answers1

0

I found this demo to be very close to what I want, so I used what it used exactly to create tooltips. Thank you to everyone who contributed.

hpy
  • 41
  • 4
  • A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](https://meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it is there, then quote the most relevant part of the page you are linking to in case the target page is unavailable. – cursorrux Jul 12 '22 at 06:06