Download
as PDF

Properties of Graph Elements

The yEd graph editor provides two ways for presenting the properties of nodes or edges: the Tabular View and the Property Dialog.

The tabular view is shown in a docked window and located in the lower left area of the main window by default. The property dialog can be opened for example via the context menu for graph elements or using F6 [Mac OS: Command-I], if there is a non-empty set of graph elements selected. Both kinds of presentation show consistent information and can be used side by side.

Graphical Properties

The graphical properties that are common to nodes and edges include color and line type (nodes: line type of border). Furthermore, all properties that are used for the labels of nodes and edges, respectively. This includes, e. g., font type and size, font color, etc., but also options for alignment and positioning.

Enhanced Labels

yEd offers two possibilities to enhance your labels. You can apply some text styles using a subset of HTML and you can let yEd wrap your labels automatically. However, you cannot combine these possibilities.

HTML Labels

If label text starts with '<html>', it is automatically interpreted as HTML markup, which, for example, allows you to style individual parts of the label differently. Try the following example.
<html><i>italics</i>, <b>bold</b>, <span style="color:red;">red</span></html>
Presentation of label text that uses HTML markup differs between the tabular view and the property dialog: in the tabular view, (part of) the rendered HTML is shown while the property dialog shows the actual HTML markup.

Wrapping Labels

In order to let yEd wrap the lines of a node label automatically such that they fit into the bounds of the owning node you can do the following. In this case HTML markup is ignored.

  • Select the node.
  • In the "Label" section in the Properties View use "Internal: Center" for the "Placement".
  • Select "Cropping" in the "Configuration" field.
  • Select "Fit Node Size" or "Fit Node Width" in the "Size" field.

Icons in Labels

A label can contain an icon together with or instead of the label text. The properties for the label icon as for example the icon itself or its relative position to the text can be edited using an extra dialog. This dialog opens if you click on Icon Properties. For an example have a look at the graph Help >> Example Graphs >> Visual Features >> Multiple_Node_Labels_with_Icons.graphml.

Convert Node to Label

An easy way to create a new label with an icon is to drag a node from the palette and to drop it onto a target node and then to use the entry "Convert to Label" from the context menu of the dropped node. Icons as edge labels can be created similarly. If the node to be converted to a label cannot be assigned to a unique target node or edge then the action "Convert to Label" is not possible. In this case move the dropped node until it covers just one target object.

Convert Label to Node

It is also possible to convert a label to a node. Select the label and choose the action "Convert to Node" from its context menu. The label does not have to be created using "Convert to Label".

URL and Description

The yEd graph editor allows you to easily bind a URL and a description to nodes and edges. A description can be used to store additional text besides the label texts. Typically, it is presented as tooltip when the mouse hovers above a graph element. Descriptions can be specified using either plain text or HTML markup. By means of the URL, it is possible to open a file from within yEd using the file's predefined standard application for the respective platform.

When exporting the graph to HTML image maps or SVG/compressed SVG file format, both URL and description can be incorporated.

URL

In order to work properly, absolute URLs should start with a valid protocol prefix, for example 'file://' or 'http://'. URLs may be relative, too, e. g., another_graph.graphml or images/image3.png and are interpreted relative to the storage location of the current graph.

Within yEd, the URL of a selected graph element can be opened using 'Go to URL' from the context menu or the 'View' menu.

  • URLs that point to another graph will be opened in yEd itself.
  • URLs that start with a proper protocol prefix, will be opened using the available standard application that is predefined for the respective platform.

In exported HTML image maps or SVG files which are viewed in a browser, nodes and edges that have an URL specified can be clicked. The browser then executes the action that is predefined for the URL's protocol.

For SVG files to be viewed, the browser has to support the SVG file format.

Custom Properties

A custom property can be used to associate arbitrary additional data with graph elements. Its domain of definition, called scope, is either all nodes, all edges or the graph itself. Furthermore, it has a name, a type for the associated values, and, optionally, a default value which is used for elements without explicitly set value. Each custom property holds only for one graph, not for all opened graphs.

Custom properties can be saved to and loaded from GraphML files. Technically, each custom property is mapped to a GraphML attribute. For the support of other formats like GML or TGF, please see the section on file formats.

Configuration

Use the menu item Edit >> Manage Custom Properties... to open a dialog which lets you add, delete and update custom properties for the current graph.

The scope of a property cannot be changed after its creation since all element values would be lost. To change the name, the type of the values or the default value, click on the corresponding table cell in the appropriate table. Changing an attribute of a custom property takes effect immediately. You do not have to commit your changes or leave the dialog.

The name of a custom property has to be unique in its scope, e. g., you can have a property foo for the nodes and a property foo for the edges, but you cannot have two properties named foo for the nodes, even if their value types are different. If you change the type of a custom property, the existing values are retained as close as possible. For example, a number can always be converted into a text. In the reverse direction, textual representations of numbers are converted to the respective numerical values but other text results in an undefined value. Please note, that this is not an error though, since undefined values are perfectly fine. If you change the default value, this affects all elements for which you did not enter a value before.

Editing Values

The values of the custom properties of the current selection are displayed in the "Data" section of the properties views. They can be edited in the properties views, too. All changes of the attributes of custom properties and their values are undoable just as any other change of a graph. To undo a change use the menu item Edit >> Undo.

Mapping Properties

By default, custom properties are not visible in the diagram. However, the properties mapper lets you map custom properties to visual properties.

Simultaneously Displaying and Changing the Properties of Multiple Graph Elements

If multiple graph elements are selected, then both the tabular view and the property dialog display only those values of attributes that match for all selected elements. Instead of the values that do not match a gray area is shown.

Both values that do match and values that do not can be changed simultaneously for all selected graph elements.

Use a Graph Element as a Sample

The representation of a graph element (i.e., all settings for its properties) can be used as a sample for newly created graph elements. To this end, the graph element can be added to a user-defined section in the Palette tool window by means of the 'Add to Palette' menu entry from the editor's context menu.
More information on working with the palette is found in 'Palette' Tool Window.