是否有事件侦听器可检测点/SVG图形上的鼠标单击? [英] Are there event listeners to detect mouse clicks on dot/SVG graph?
问题描述
我正在玩生成点文件,然后将它们转换为具有很多节点的SVG图.
I am playing with generating dot files and then turned them into SVG graphs with a lot of nodes.
我的问题是,是否存在事件侦听器来检测在点/SVG图形节点上的鼠标单击?
My question is that are there event listeners to detect mouse clicks on dot/SVG graph nodes?
例如,右键单击SVG图中的一个节点,我做某事(也许从该节点获取相关信息,然后再做某事),
For example, right click on a node in the SVG graph, I do something(maybe get the related information from the node and then do something),
然后如何生成点文件或SVG文件来实现此目的?
Then how to generate dot file or SVG file to achieve this?
推荐答案
有几种创建交互式SVG图的方法:
There are several ways to create an interactive SVG graph:
- 使用SMIL(svg的扩展名)(示例教程 http://apike.ca/prog_svg_smil.html)
- JavaScript( Raphael 库非常好)
- CSS动画
- Use SMIL, an extension to svg (Example tutorial http://apike.ca/prog_svg_smil.html)
- Javascript (the Raphael library is excellent)
- CSS animations
无论如何,您都必须在支持任何这些技术(浏览器)的客户端中显示svg图,并且除了graphviz创建的svg输出之外,还必须对其进行编码.
In any case, you'll have to display the svg graphs in a client which supports any of those technologies (browser), and you will have to code it in addition to the svg output graphviz creates.
这篇关于是否有事件侦听器可检测点/SVG图形上的鼠标单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!