Looking for a graph layout framework for iOS [closed]
Asked Answered
F

4

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.

Forceps answered 11/9, 2010 at 22:6 Comment(8)
Do you want your application to dynamically generate these elements and display the graph to the user? Do the graphs need to be interactive?Vassalage
@Michael No idea about the OP, but I have the same question and "yes, maybe not". :)Mcrae
@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.Forceps
This question asked something similar a while ago, but we misinterpreted what he meant by graph visualization in this case: #2960808Matherly
@Brad: I agree, you did misinterpret him. But how does this help me? I don't need Core Plot either :)Forceps
@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.Matherly
@Brad: Ahh.. Okay! Understood! Hopefully someone will answer here... :-/Forceps
Also see: #8824715Floro
D
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.

Diversification answered 15/9, 2010 at 20:34 Comment(6)
I read about pixelglow. I tried contacting Glen Low, and if he'll open source the port I'll post it back here.Forceps
Okay, correcting my previous comment: I'll try the configure and the instructions there. If it works, great!Forceps
@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?Forceps
Did you try adding --disable-ltdl to the configure?Diversification
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.Radferd
Extremely sorry Glen - I have corrected it above.Diversification
L
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)

Lefthanded answered 28/9, 2010 at 7:23 Comment(1)
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.Forceps
S
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.

Selfrestraint answered 11/9, 2010 at 23:35 Comment(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?Forceps
In other words, how do you suggest approaching such a solution? :)Forceps
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.Selfrestraint
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 :-)Forceps
C
0

How about using Google Chart in a webview:

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

Catharine answered 22/9, 2010 at 7:42 Comment(1)
I'm looking for an more-or-less abstract layout engine, not a powerpoint-like chart engine. Thanks anyway! :)Forceps

© 2022 - 2024 — McMap. All rights reserved.