[Kde-extra-gear] KGraphViewer ideas ...

Kleag kleag at free.fr
Fri Jun 12 22:31:46 CEST 2009


Hi Sandro,

Le vendredi 12 juin 2009 06:55:03 Sandro Andrade, vous avez écrit :
> Hi everyone (in particular, Gaël)
>
> As I've mentioned before I'm implementing the KDevelop features for
> software visualization. I've been told about the KGraphViewer kpart
> and I think is a good idea to working on it, so that both applications
> get improved.
>
> Basically, what we need is a kpart for digraph visualization with the
> following features:
>
> - Rendering of nodes as rounded rectangles with particular labels
> - Response to mouse events identifying the target node
>
> Browsing the kpart source code I've noticed that it supports most of
> node and edge attributes specified in the DOT language. It seems to
> provide more features than I actually need, so some questions arise:
>
> 1) Is this kpart intended to be a graph editor ? Wouldn't it be
> interesting to provide just exhibition features and shift interaction
> responsibilities to the application or another higher level kpart ? In
> KDevelop we aren't going to use edit, export or print features.
At the beginning, it was only a pure visualization tool, but it appeared that 
interactions were needed (to support actions, changes during graph life time, 
etc). And then I started to add editing features. But, you're right view and 
edit features could be separated.

>
> 2) Can I implement, in the application, the code to be executed when a
> graph node is clicked or has a mouse over event ? Again, wouldn't the
> kpart have its reuse improved if such interaction features were not
> pre-defined ?
They aren't! They are just signals that you can connect to to handle actions. 
Also, when you want to act on a graph element, you use slots to send it 
messages.
When you click on a node, the selectionIs signal is sent.
The part is missing hovering signals, though.

>
> 3) Why haven't you used Graphviz as a library (as indicated in
> http://www.graphviz.org/pdf/libguide.pdf) instead of relying in
> QProcess invocation of dot, twopi and output processing (I know, this
> is the KCachegrind approach) ?
You said it: it's the kcachegrind approach and in fact, when I started 
kgraphviewer I reused the kcachegrind code :-) Well, there is not much 
remaining up to now.
I think it is still a good solution. The xdot format is easy to parse. But I 
already thinked to have a look at the graphviz library.

Regards,

Gaël
-- 
KsirK - a world domination strategy game 
http://techbase.kde.org/Projects/Games/Tactic_and_Strategy/KsirK

KGraphViewer - a GraphViz dot graphs viewer
http://extragear.kde.org/apps/kgraphviewer



More information about the Kde-extra-gear mailing list