Drawing a sub-graph

Apr 3, 2011 at 8:58 PM

Hi,

I have a relatively large network and I want to select a set of nodes that I don't want to be processed in the layout algorithm.

I tried setting vertex visibility to hide/show accordingly, but it seems that layout algorithm still considers all edges, and removes those edges visually only. The resulting graph drawing includes regions that are not occupied.

How can I select (filter) a set of nodes that directly affect the layout algorithm?

Thanks,

Apr 4, 2011 at 10:17 PM

If you want NodeXL to completely ignore a set of vertices and their incident edges, set their Visibility to "Skip."  They won't appear in the graph pane and they won't be used by the layout algorithm.  It will be as if those rows don't even exist in the workbook.

When you set the Visibility to "Hide," in contrast, NodeXL still reads the rows and uses them in the layout algorithm, but it hides them in the graph pane.  In other words, the hidden vertices and edges exist in the graph pane; you just can't see them.

-- Tony

Apr 6, 2011 at 11:25 PM

Thank you Tony. I knew it had something to do with vertex visibility :) Also, selecting a group and re-running the layout algorithm on a selected group also helps in some cases. Thanks again

Mar 5, 2012 at 2:46 AM

I am trying to layout a subgraph as noted above using the API

Using version 1.0,.196 of the source code the only values I see for Visibility are Filtered,Hidden and visible

I am using code like this...

vertex.setvalue(ReservedMetadataKeys.Visibility, VisibilityKeyValue.Hidden)

Is ts possible to keep a subset of vertices from not being used by the layout in a way similar to this

Thanks

 

Mar 5, 2012 at 4:07 AM
Edited Mar 5, 2012 at 4:07 AM

The previous question was about the NodeXL Excel Template, which skips rows marked with "Skip" when reading the Excel workbook before the rows ever make it into the NodeXL API.  That explains the lack of a VisibilityKeyValue.Skip enumeration value.

However, you can still accomplish what you want when laying out the graph.  Just add a ReservedMetadataKeys.LayOutTheseVerticesOnly key to the graph before you pass the graph to the layout class.  The value is a Collection<IVertex> of the vertices you want to lay out.  When this key is present on the graph, the layout completely ignores the graph's vertices that are not in the specified collection.

See the "ReservedMetadataKeys.LayOutTheseVerticesOnly Field" topic in the NodeXLApi.chm help file for more information.  Also see the "ReservedMetadataKeys.LayOutTheseVerticesWithinBounds Field" topic.

-- Tony