you should have a look at the following project http://kylescholz.com/projects/wordnet/
Hope it helps
Eric
Welcome!
Canviz supports all the usual browser mouse events (e.g. onclick), so you can put an onclick attribute into your node or edge in your Graphviz file and it will pass through to Canviz. In that onclick event, you could use any JavaScript command you can think of, for example to show another div that has more information in it.
> On Wed, Jun 16, 2010 at 4:29 PM, Ryan Schmidt wrote:
>
>> Canviz supports all the usual browser mouse events (e.g. onclick), so you can put an onclick attribute into your node or edge in your Graphviz file and it will pass through to Canviz. In that onclick event, you could use any JavaScript command you can think of, for example to show another div that has more information in it.
>
> Sorry to bother you again. As I told you earlier, I am new with javascript, I am having a very basic problem. I will be honest with you, I didn't spend too much time; but it seems to me it will be very easy, so thought it might be better to email you.
>
> For example, I want to open a new window onMouseOver to a node. I would do this in html in this way:
> <a href="#" onMouseOver="open_new_window()" onMouseOut="close_window()">Hover </a>
> where open_new_window function creates and opens a new window with some text, when mouse is over the text "Hover", and close_window closes the new window.
>
> What I am not sure is, how I put this href properties in Canviz nodes (in dot files), similar to your example:
> node [href="javascript:void(click_node('\N'))"]
>
> I am sure, it will be very easy answer, that's why probably couldn't find any Canviz documentation to explain it.
>
> Your answer with some explanation will be highly appreciated. I guess others should know about it already. In case you feel some other novice like me might think its useful, feel free to reply in the group.
It's no bother!
If you want to achieve the same effect as this:
<a href="#" onMouseOver="open_new_window()" onMouseOut="close_window()">Hover</a>
Simply write your Graphviz file like this:
digraph G {
somenode [href="#" onMouseOver="open_new_window()" onMouseOut="close_window()"]
}
Of course if you want to pass the node ID to the functions (for example if there is a specific window associated with each node), then it's simply:
digraph G {
somenode [href="#" onMouseOver="open_new_window('\N')" onMouseOut="close_window('\N')"]
}