views:

295

answers:

5

For an iOS application I'm making I need to show groups of elements grouped together according to their type, and different groups of types separated from each other in a nicely done layout.

I thought of using an undirected graph, with the grouped nodes all pointing to each other in a sort of circular reference, and then each group as another "meta-graph" with their nodes point at each other in a circular reference as well, hoping that together with a good graph layout framework this could be displayed nicely.

Unfortunately, the only framework I keep hearing of is graphviz, but that doesn't seem to have an available port for iOS.

So my question is either:

  1. Other ideas for how to implement what I need?
  2. A good implementation of graph layout for the iOS?
  3. An available port of graphviz for the iOS?

Update: Please note, I am not looking for graph plotting frameworks, which are the frameworks used to draw graphs and charts (such as pie charts etc). I am looking for a layout framework which determines the optimal location for arbitrary nodes in an abstract graph...

Thanks!

A: 

graphviz is C source and has been ported to OSX/Xcode already. I would try to build a library in Xcode from source -- not a dylib (because that's not allowed on iOS devices), but a .a library. I bet the code is pretty close to portable to iOS already if not fully so.

Lou Franco
Thought of that and even tried playing with it for a bit. Things weren't as simple though, but perhaps I'm not proficient in how to do it: should sources be added before or after a call to ./configure for example?
Aviad Ben Dov
In other words, how do you suggest approaching such a solution? :)
Aviad Ben Dov
I'm not really sure. The purpose of configure is to make you a makefile. Here's what I would do (1) figure out how to call configure in a way that targets iPhone target, starting with simulator (2) Call make to get a .a (3) use the .a in my project.
Lou Franco
That's where I am extremely lacking knowledge: make and configure. I've been trying to play with configure for a few days now with no major success. I don't even know how to make gcc to compile for the armv7 architecture (even though Xcode seems to support it!). It's all quite fascinatingly new, and I have little time to study it properly.. Help would be appreciated :-)
Aviad Ben Dov
+1  A: 

According to a post on the graphviz development mailing list, Glen Low of pixelglow has already managed to port graphviz and uses it in Instaviz.

He also has some hints on the configure script.

spenthil
I read about pixelglow. I tried contacting Glen Low, and if he'll open source the port I'll post it back here.
Aviad Ben Dov
Okay, correcting my previous comment: I'll try the configure and the instructions there. If it works, great!
Aviad Ben Dov
@spenthil: the instructions won't work. I couldn't figure it out though; after I try the build, it would shout "error: conditional "INSTALL_LTDL" was never defined". That is expected, as the instructions say not to install LTDL. Have any idea why this breaks the build?
Aviad Ben Dov
Did you try adding `--disable-ltdl` to the configure?
spenthil
BTW, I'm a he and not a she, says Glen. I have a suitable configure script embedded within an Xcode project that will build a libgraphviz.a, but currently it only works for Graphviz 2.24. Haven't updated it for the latest release yet.
Glen Low
*Extremely* sorry Glen - I have corrected it above.
spenthil
A: 

mxGraph does work on iOS out of the box

David
for 6000 euros I sure hope so :)
clearbrian
A: 

How about using Google Chart in a webview:

http://code.google.com/apis/chart/

Khurram Ali
I'm looking for an more-or-less abstract layout engine, not a powerpoint-like chart engine. Thanks anyway! :)
Aviad Ben Dov
+1  A: 

Below are some libraries which might help you:

1) http://code.google.com/p/core-plot/

2) http://code.google.com/p/s7graphview/

3) http://github.com/duivesteyn-enterprises/deSimpleChart

4) http://www.rgraph.net/ (Will work on UIWebView only)

5) http://sebkade.wordpress.com/2010/05/06/basic-graph-class-for-iphone/ (a blog where demo is given to create a graph)

Sagar
Thanks for your help but these are graph plotting frameworks, and not graph layout frameworks. I'll add a note stating that this is NOT what I need specifically, since it seems a lot of people are confused about this.
Aviad Ben Dov