28

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.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Aviad Ben Dov
  • 6,351
  • 2
  • 34
  • 45
  • 1
    Do you want your application to dynamically generate these elements and display the graph to the user? Do the graphs need to be interactive? – Michael Mior Sep 11 '10 at 22:14
  • @Michael No idea about the OP, but I have the same question and "yes, maybe not". :) – Jakob Borg Sep 11 '10 at 22:27
  • @Michael: yep, the application allows for element creation and element interaction. However, the interaction is in a different "phase" of the workflow so they can be non-interactive while their location is determined. – Aviad Ben Dov Sep 12 '10 at 03:06
  • This question asked something similar a while ago, but we misinterpreted what he meant by graph visualization in this case: http://stackoverflow.com/questions/2960308/graph-visualization-libraries-on-iphone – Brad Larson Sep 12 '10 at 15:39
  • @Brad: I agree, you did misinterpret him. But how does this help me? I don't need Core Plot either :) – Aviad Ben Dov Sep 12 '10 at 16:58
  • @Aviad Ben Dov - Normally, you'd close the newer question as a duplicate of the old one, but you've asked a better question here so I just wanted to link the two in case someone answered the old one. – Brad Larson Sep 12 '10 at 19:44
  • @Brad: Ahh.. Okay! Understood! Hopefully someone will answer here... :-/ – Aviad Ben Dov Sep 12 '10 at 21:11
  • Also see: http://stackoverflow.com/questions/8824215/graph-plotting-framework-for-ios – petert Nov 27 '12 at 15:08

4 Answers4

10

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
  • 3,373
  • 29
  • 17
  • 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 Sep 17 '10 at 08:45
  • Okay, correcting my previous comment: I'll try the configure and the instructions there. If it works, great! – Aviad Ben Dov Sep 17 '10 at 08:51
  • @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 Sep 17 '10 at 12:04
  • Did you try adding `--disable-ltdl` to the configure? – spenthil Sep 17 '10 at 19:42
  • 1
    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 Sep 30 '10 at 02:05
  • *Extremely* sorry Glen - I have corrected it above. – spenthil Sep 30 '10 at 07:07
3

Below are some libraries which might help you:

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

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

3) https://github.com/duivesteyn-net/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)

oberbaum
  • 2,451
  • 7
  • 36
  • 52
Sagar
  • 3,159
  • 3
  • 29
  • 28
  • 9
    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 Sep 28 '10 at 20:55
1

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
  • 87,846
  • 14
  • 132
  • 192
  • 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 Sep 12 '10 at 03:08
  • In other words, how do you suggest approaching such a solution? :) – Aviad Ben Dov Sep 12 '10 at 03:13
  • 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 Sep 12 '10 at 18:20
  • 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 Sep 12 '10 at 22:53
0

How about using Google Chart in a webview:

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

Khurram Ali
  • 835
  • 12
  • 18