SnaglML

The primary format for SnagL™ is known as SnaglML.  SnagML is a form of GraphML that has been customized to support specific SnagL™ features.  This article will provide most of the specifics related to the format of this file but you should refer to the main GraphML site for further details on the format itself.  You can find an example file here.

All custom properties, represented by data elements, should have a corresponding key element.  These key elements are defined under the root graphml element.  SnagML has two types of keys that it expects.  These are property and attribute keys.  Property keys directly effect the Node or Edge that is generated while Attribute keys provide custom data that is attached to edges or nodes.  Property keys are specific while attribute keys can be anything, as long as they follow a naming convention.

Properties

All node properties begin with node-prop- while all edge properties begin with edge-prop-.

The table below lists all supported node properties:

Name (not including prefix)

Description

Description A description of the node.  This isn’t currently used by the application itself but can be used to indicate the mechanism by which a node was created.
DisplayValue The value to be displayed under the node
SelectionColor The color, in hex form, used to show a node is selected
ImageSource The image resource to use for the node
Height The Height of the node (this could effect how the node appears on the graph)
Width The Width of the node (this could effect how the node appears on the graph)
Position The X and Y position (separated by a comma) for the location of the node.  If all nodes have no position or the same position, the graph will be layed out initially.
IsHidden This boolean indicates whether the node is visible on the graph or not.
BackgroundColor The color, in hex form, of the background of the node.  This can be used to highlight a node.

The table below lists all supported edge properties:

Name (not including prefix)

Description

DisplayValue The value to be displayed on the edge
Thickness A number indicating the thickness of the edge
Color The color, in hex form, of the actual edge
LabelBackgroundColor This is a hex value that indicates the label’s background color.  If not specified, the default is white.
LabelForegroundColor This is a hex value that indicates the label’s foreground color.  If not specified, the default is black.
LabelFontStyle This can be either Italic or Normal.  The default is Normal.
LabelFontWeight

This can be one of the following values:

  • Black
  • Bold
  • ExtraBlack
  • ExtraBold
  • ExtraLight
  • Light
  • Medium
  • Normal
  • SemiBold
  • Thin
LabelTextUnderline Set this to true if the text on the label should be underlined
LabelFont The name of the font used for the edge’s label.  This can be any font that exists on the client machine.

Attributes

(This information is forthcoming)

Additional Customizations

The graph element supports a new attribute, part of the berico namespace, called nodeType.  Currently, this attribute should be set to “Icon”.

Last edited Apr 1, 2011 at 4:03 PM by TAHerman, version 9

Comments

No comments yet.