是否有事件侦听器可检测点/SVG图形上的鼠标单击? [英] Are there event listeners to detect mouse clicks on dot/SVG graph?

查看:69
本文介绍了是否有事件侦听器可检测点/SVG图形上的鼠标单击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩生成点文件,然后将它们转换为具有很多节点的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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆