Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-03

New control TLvlGraphControl and new IDE package graph

10 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

I added a new control TLvlGraphControl to package LazControls. It is a LCL control showing a graph as "level graph". Another name is "layered graph".

See the screenshot and see here:
http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TLvlGraphControl

Level graphs can visualize hundreds of nodes and thousands of edges on a single screen, reducing the need to scroll. This control has the ability to highlight the edges under the mouse, so that even complex graphs with thousands of edges can be explored.
And it highlights back edges so you can quickly find cycles.

The screenshot is from the IDE's Package Graph.

Mattias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: packagegraph1.png
Type: image/png
Size: 29234 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130324/aaa5fa88/attachment-0001.png>

Reply by email

Reinier Olislagers
to Mattias Gaertner
Mattias Gaertner wrote 18 lines
Hi, I added a new control TLvlGraphControl to package LazControls. It is a LCL control showing a graph as "level graph". Another name is "layered graph". See the screenshot and see here: http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TLvlGraphControl Level graphs can visualize hundreds of nodes and thousands of edges on a single screen, reducing the need to scroll. This control has the ability to highlight the edges under the mouse, so that even complex graphs with thousands of edges can be explored. And it highlights back edges so you can quickly find cycles. The screenshot is from the IDE's Package Graph.

Yep, had noticed that - very handy!

Thanks a lot,
Reinier

Reply by email

Sven Barth
to Mattias Gaertner: I added a new control TLvlGraphControl to package LazControls. It is a LCL control…
Mattias Gaertner wrote 17 lines
Hi, I added a new control TLvlGraphControl to package LazControls. It is a LCL control showing a graph as "level graph". Another name is "layered graph". See the screenshot and see here: http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TLvlGraphControl Level graphs can visualize hundreds of nodes and thousands of edges on a single screen, reducing the need to scroll. This control has the ability to highlight the edges under the mouse, so that even complex graphs with thousands of edges can be explored. And it highlights back edges so you can quickly find cycles. The screenshot is from the IDE's Package Graph.

Oooohhhh... nice. It will be interesting to see how this component copes with the dependency graph of the compiler units... hehe ^^

Regards,
Sven

Reply by email

Hans-Peter Diettrich
to Mattias Gaertner: I added a new control TLvlGraphControl to package LazControls. It is a LCL control…
Show quoted text 8 lines
Hi, I added a new control TLvlGraphControl to package LazControls. It is a LCL control showing a graph as "level graph". Another name is "layered graph". See the screenshot and see here: http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TLvlGraphControl

Nice :-)

Show quoted text 8 lines
Level graphs can visualize hundreds of nodes and thousands of edges on a single screen, reducing the need to scroll. This control has the ability to highlight the edges under the mouse, so that even complex graphs with thousands of edges can be explored. And it highlights back edges so you can quickly find cycles. The screenshot is from the IDE's Package Graph.

Did you already consider to analyze the graph using methods known from the theory of graphs, like splitting the graph into "components"?

Graph components can help to structure the display of the entire graph, so that e.g. a component can be represented as a single node on the screen, which then can be expanded on demand into a more detailed representation.

DoDi

Reply by email

Mattias Gaertner
to Hans-Peter Diettrich
Show quoted text 11 lines
Mattias Gaertner schrieb: > Hi, > > I added a new control TLvlGraphControl to package LazControls. It is a > LCL control showing a graph as "level graph". Another name is "layered > graph". > > See the screenshot and see here: > http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes#TLvlGraphControl Nice :-)

Thanks.

Show quoted text 11 lines
> Level graphs can visualize hundreds of nodes and thousands of > edges on a single screen, reducing the need to scroll. > This control has the ability to highlight the edges under > the mouse, so that even complex graphs with thousands of edges can be > explored. > And it highlights back edges so you can quickly find cycles. > > The screenshot is from the IDE's Package Graph. Did you already consider to analyze the graph using methods known from the theory of graphs, like splitting the graph into "components"?

TLvlGraph has a property Graph: TLvlGraph, that consists of nodes and edges. The nodes have arrays of InEdges and OutEdges. So implementing the normal graph algorithms should be pretty straightforward.

Graph components can help to structure the display of the entire graph, so that e.g. a component can be represented as a single node on the screen, which then can be expanded on demand into a more detailed representation.

Yes, that was my first idea too for packages and units. But it seems it is more helpful to simply use another lvlgraph
for the details.

Mattias

Reply by email

Juha Manninen
to Mattias Gaertner

This is close to the reverse engineered class diagram tool that was discussed already a long time ago.
I thought the most difficult part is automatic layout calculation and this component implements it quite perfectly. Cool!

Still, it cannot be directly used for a class diagram because there not only nodes connect to each other but a connection can be from a property inside a node.
It could be extended with special nodes having connection points, and edges (lines) having graphs at the ends.
At least a diamond and a circle graph is needed for class diagram lines.

Juha

Reply by email

Mattias Gaertner
to Sven Barth: Oooohhhh... nice. It will be interesting to see how this component copes with the…
[...] Oooohhhh... nice. It will be interesting to see how this component copes with the dependency graph of the compiler units... hehe ^^

Here is are two screenshots of the compiler units. The first shows the compiler/x86 directory, the second the compiler/systems directory.
For the units of the compiler directory you need a 4k screen and it's very messy.
This needs some specials. Like filtering or something like the "components" suggested by DoDi.

Mattias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler_x86.png
Type: image/png
Size: 10089 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130324/e8126e98/attachment.png> -------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler_systems.png
Type: image/png
Size: 1994 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130324/e8126e98/attachment-0001.png>

Reply by email

Sven Barth
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Sun, 24 Mar 2013 13:56:31 +0100 Sven Barth wrote: > [...] > Oooohhhh... nice. It will be interesting to see how this component copes > with the dependency graph of the compiler units... hehe ^^ Here is are two screenshots of the compiler units. The first shows the compiler/x86 directory, the second the compiler/systems directory. For the units of the compiler directory you need a 4k screen and it's very messy. This needs some specials. Like filtering or something like the "components" suggested by DoDi.

Components won't help here as the compiler is too interconnected (though the CPU directories look rather nice ^^).

I've written a little tool some weeks ago which uses fcl-passrc to extract the unit dependencies and prints a dot file which can be processed by Graphviz. With this I wanted to check where we might have cycles and if we could fix their detection, but for now I've given up, because the graph is to messy. As a next step I planned to implement a Circos (see http://circos.ca/images/ ) backend for that tool...

Regards,
Sven

Reply by email

Joao Morais
to Sven Barth

2013/3/24 Sven Barth :

Show quoted text 6 lines
I've written a little tool some weeks ago which uses fcl-passrc to extract the unit dependencies and prints a dot file which can be processed by Graphviz. With this I wanted to check where we might have cycles and if we could fix their detection, but for now I've given up, because the graph is to messy. As a next step I planned to implement a Circos (see http://circos.ca/images/ ) backend for that tool...

Did you try a DSM? I've successfuly used this approach to find cycles as well as helping me to elaborate a migration strategy of a little messy project =)

http://en.wikipedia.org/wiki/Design_structure_matrix

Joao Morais

Reply by email

Sven Barth
to Joao Morais
Joao Morais wrote 13 lines
2013/3/24 Sven Barth : > I've written a little tool some weeks ago which uses fcl-passrc to extract > the unit dependencies and prints a dot file which can be processed by > Graphviz. With this I wanted to check where we might have cycles and if we > could fix their detection, but for now I've given up, because the graph is > to messy. As a next step I planned to implement a Circos (see > http://circos.ca/images/ ) backend for that tool... Did you try a DSM? I've successfuly used this approach to find cycles as well as helping me to elaborate a migration strategy of a little messy project =) http://en.wikipedia.org/wiki/Design_structure_matrix

A design structure matrix aka adjency matrix is just a graph in matrix form... And I personally prefer visual approaches here :) [even if it should mean that I'll need a 4k beamer or a DIN A0 printer to view this correctly :P ]

Regards,
Sven

Reply by email