Home » Eclipse Projects » GEF » [Zest] Graph not pretty
[Zest] Graph not pretty [message #246905] |
Mon, 19 January 2009 06:20  |
Eclipse User |
|
|
|
Hi,
I’m using Zest to visualize a graph in our network-management software.
The graph is a network topology and the nodes in the graph are network
devices like switches and PCs.
This is what a graph looks like:
http://docs.google.com/Doc?id=df37tr6f_6hgv4h2dj
As you can see from the pic, its not very pretty and it has the
following issues:
1. Node Overlapping. I’ve tried using a composite
layout(radial+horizontal_shift) but then the graph looks horrible. Is
there any way to remove node overlapping?
2. The images in the nodes are transparent gifs but, they are displayed
in the node with a white background. I want the background color of the
images to take on whatever background color the node has. How would I do
this?
This is what the relevant code looks like:
Graph graph = new Graph(shell, SWT.NONE);
GraphNode a1 = new GraphNode(graph, SWT.NONE, "SMC 8624T",
ImageRegistry.getImage("switch"));
GraphNode a2 = new GraphNode(graph, SWT.NONE, "Access2",
ImageRegistry.getImage("switch"));
GraphNode a3 = new GraphNode(graph, SWT.NONE, "sphere-21.dxb.sphere.ae",
ImageRegistry.getImage("node"));
....
GraphConnection c1 = new GraphConnection(graph, SWT.NONE, a28, a59);
GraphConnection c2 = new GraphConnection(graph, SWT.NONE, a27, a54);
GraphConnection c3 = new GraphConnection(graph, SWT.NONE, a61, a26);
....
graph.setLayoutAlgorithm(new
RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
|
|
|
Re: [Zest] Graph not pretty [message #247293 is a reply to message #246905] |
Fri, 13 February 2009 11:50  |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Node overlap removal is something we looked at a long time ago. It turns
out this is very computationally expensive, and grows the graphs to
arbitrary sizes.
Have you tried a tree layout?
As for the transparency issue. I don't know how hard this would be. I
guess it would depend on how well SWT + Draw2D handle this. If you can
open a bug with some snippets that show how to implement transparency in
Draw2D, I can get them included.
cheers,
ian
Joseph George Variam wrote:
> Hi,
> I’m using Zest to visualize a graph in our network-management software.
> The graph is a network topology and the nodes in the graph are network
> devices like switches and PCs.
>
> This is what a graph looks like:
> http://docs.google.com/Doc?id=df37tr6f_6hgv4h2dj
>
> As you can see from the pic, its not very pretty and it has the
> following issues:
> 1. Node Overlapping. I’ve tried using a composite
> layout(radial+horizontal_shift) but then the graph looks horrible. Is
> there any way to remove node overlapping?
>
> 2. The images in the nodes are transparent gifs but, they are displayed
> in the node with a white background. I want the background color of the
> images to take on whatever background color the node has. How would I do
> this?
>
>
> This is what the relevant code looks like:
>
> Graph graph = new Graph(shell, SWT.NONE);
>
> GraphNode a1 = new GraphNode(graph, SWT.NONE, "SMC 8624T",
> ImageRegistry.getImage("switch"));
> GraphNode a2 = new GraphNode(graph, SWT.NONE, "Access2",
> ImageRegistry.getImage("switch"));
> GraphNode a3 = new GraphNode(graph, SWT.NONE, "sphere-21.dxb.sphere.ae",
> ImageRegistry.getImage("node"));
> ...
>
> GraphConnection c1 = new GraphConnection(graph, SWT.NONE, a28, a59);
> GraphConnection c2 = new GraphConnection(graph, SWT.NONE, a27, a54);
> GraphConnection c3 = new GraphConnection(graph, SWT.NONE, a61, a26);
> ...
>
> graph.setLayoutAlgorithm(new
> RadialLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
|
|
|
Goto Forum:
Current Time: Mon May 12 18:42:56 EDT 2025
Powered by FUDForum. Page generated in 0.02627 seconds
|