Re: [graphviz-interest] graphviz on iphone ?
Glen Low <glen.low <at> pixelglow.com>
2009-06-19 14:27:45 GMT
> is there a way to embed graphviz in iphone apps ? instaviz does a
> great job, but sometimes graphiz functionality is needed as part of
> an application, i. e. to display workflows in a worklflow application.
> best regards
> oliver bruening
Yes you can indeed embed Graphviz in iPhone apps. I've generally
contributed all iPhone-related changes due to Instaviz back to the
mainline, so at the very least you can compile a minimal Graphviz that
supports output to Quartz, the native rendering system on OS X.
First though a little diversion into the different ways you could
incorporate Graphviz graphs into your iPhone app:
1. Instaviz has a URL scheme so you can simply just open an Instaviz
URL with your graph to get it to display. See
(at the bottom).
This is probably easiest but means you have a dependency on the user
having Instaviz, and no nice way to get back to your app. (Although
I'm hoping to get two-way URL handling working in Instaviz 2.0, so
users can click on nodes and be sent back to the program. Nice to
simulate HTML maps for example.)
E.g. Nocsos DBR and IdeaTree have successfully implemented the
2. You could try any of the wrappers/modules I wrote around the
Graphviz guts. I haven't yet decided whether to license them or just
open-source them... they are:
a. GraphKit is a simple wrapper around Graphviz, so that each
Graphviz component becomes an Objective-C object. You can then use
Objective-C to do rendering etc.
b. GraphKitDraw is another layer which provides a persistent,
rendered object model, this would be useful for things like displaying
selections, displaying part of a graph, hit-testing etc.
3. You could use Graphviz embedded as-is:
Here's the configure I use for iPhoneOS 3.0 and Graphviz 2.22:
CPPFLAGS="-arch armv6 -isysroot /Developer/Platforms/
CXXCPPFLAGS="-arch armv6 -isysroot /Developer/Platforms/
iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -miphoneos- version-
These are the Graphviz modules I build:
At the end of the build process you should get a bunch of static libs
that you can "just" link into your iPhone executable. The libs will
allow you to output PDF's, CGImage's or directly onto a CGContext.
Hope that helps.
Cheers, Glen Low
pixelglow software | simply brilliant stuff
graphviz-interest <at> research.att.com