|
HowToUse
How to use Canviz
Featured IntroductionCanviz began as a proof of concept—is it possible to draw Graphviz graphs to a browser canvas? I thought a good place to start would be to try to write an example that could render all the sample graphs included with Graphviz. As of October 2008, Canviz can do this. You can see it in action on the demo page. This wiki page explains how to get this example working on your system. RequirementsThe example requires:
Setup
Alternate SetupIf you'd rather build from source:
|
► Sign in to add a comment
I'm trying to access canviz from a js file. When I make a call to myCanviz.load("test.dot")...
I'm getting an error on line 464
If I comment out that line I get an error at line 396 bb does not exist in this.Tracing through the parsing code, the graph seems to be getting parsed ok. Any clue on this bb attribute? And where is $('debug_output') supposed to get set? I don't see it defined anywhere in canviz.js
@Rockpsl76: canviz.js assumes there is a DOM element on the page that has the id "debug_output", and writes its debug output there. It's clearly wrong for canviz.js to assume this, but that's what it does, for now. Create a div with that id on your page if you'd like to see debug output, and if you don't, then commenting out those lines could be fine. Suggestions on how to fix this generally are appreciated, though the discussion group would be a better place than these wiki comments to have that discussion.
bb should exist ("bb" means "bounding box"). What kind of file are you passing to canviz -- is it a file that has been processed with "dot -Txdot" (or "neato -Txdot", etc.)? It needs to be.
Thanks. Running it through dot (and/or neato) did the trick. Works great :) I just popped in a debug_output div and hid it instead of mucking with your code.
Can not Run make to Setup demo. my OS is Ubuntu 10.04. no directory /usr/share/graphviz/graphs, and i have searched graphviz/graphs dirtory in whole file system. Help~
error msg: $ make find: `/usr/share/graphviz/graphs': this directory is not existed find /usr/share/graphviz/graphs -type f -name '.gif' -or -name '.jpg' -or -name '.png' -print0 | xargs -0 -t -n 1 -I % cp % ./graphs/images find: `/usr/share/graphviz/graphs': this directory is not existed
@oldratlee: A download of Canviz 0.1 has been posted, including pre-generated examples; it will be simpler to download that instead of using the Makefile. If you still want to use the Makefile: I expected the graphs directory to have been provided by your Graphviz distribution. If it's in a different location, you can edit the Makefile. If it's nowhere, you can download the Graphviz source code from the Graphviz web site and get the graphs from there.