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.

8
  • 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? Sep 11, 2010 at 22:14
  • @Michael No idea about the OP, but I have the same question and "yes, maybe not". :)
    – Jakob Borg
    Sep 11, 2010 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. Sep 12, 2010 at 3:06
  • This question asked something similar a while ago, but we misinterpreted what he meant by graph visualization in this case: stackoverflow.com/questions/2960308/…
    – Brad Larson
    Sep 12, 2010 at 15:39
  • @Brad: I agree, you did misinterpret him. But how does this help me? I don't need Core Plot either :) Sep 12, 2010 at 16:58

4 Answers 4

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.

6
  • I read about pixelglow. I tried contacting Glen Low, and if he'll open source the port I'll post it back here. Sep 17, 2010 at 8:45
  • Okay, correcting my previous comment: I'll try the configure and the instructions there. If it works, great! Sep 17, 2010 at 8: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? Sep 17, 2010 at 12:04
  • Did you try adding --disable-ltdl to the configure?
    – spenthil
    Sep 17, 2010 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, 2010 at 2:05
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)

1
  • 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. Sep 28, 2010 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.

4
  • 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? Sep 12, 2010 at 3:08
  • In other words, how do you suggest approaching such a solution? :) Sep 12, 2010 at 3: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, 2010 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 :-) Sep 12, 2010 at 22:53
0

How about using Google Chart in a webview:

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

1
  • I'm looking for an more-or-less abstract layout engine, not a powerpoint-like chart engine. Thanks anyway! :) Sep 25, 2010 at 15:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.