Are there event listeners to detect mouse clicks on dot/SVG graph?

后端 未结 3 2030
孤街浪徒
孤街浪徒 2021-01-21 16:36

I am playing with generating dot files and then turned them into SVG graphs with a lot of nodes.

My question is that are there event listeners to detect mouse clicks on

3条回答
  •  广开言路
    2021-01-21 17:04

    Just another thought on this (realizing the question is old, but maybe it helps someone coming across).

    Depending on what you want to do, it may be easiest to decouple the event handling from the drawing. I mean, you can find out where graphviz positions the nodes (as well as edges, labels etc.), see, for example, this post on how to do it in python. Then you can paint the graph in the background of whatever GUI you're using, and use its native event handling to react on on_click by placing invisible clickable objects over the nodes.

提交回复
热议问题