Overview

About XDI Graph Editor

The XDI Graph Editor is a visualization tool that facilitates exploring and editing XDI graphs. Following the XDI notation, graphs are represented using circles and lines for XDI nodes and links. In this document, we'll refer to node and link as element in general.

Quick Start

The following steps allow you to explore some of the tool's main capabilities by creating a small XDI graph.

Step 1 - Creating a minimal graph by importing an XDI statement
  1. To do so, click on File and then Import XDI button and enter the following line: [=]!:uuid:1111/$is$ref/=alice
  2. Click the Graph It button and you will see a graph with 4 nodes and 4 links.
  3. Some things worth noting on the generated graph:
    • The white node is the common root.
    • The dashed red line is a relational statement while the gray lines are contextual statements.
    • Edges are labeled in light gray while nodes are labeled in black.
  4. Note that you may enter several XDI single display line statements at once.
Step 2 - Selecting and Moving nodes around
  1. Select a node by clicking on it or drag from an empty space on the screen to select multiple nodes
  2. Drag the selected nodes to move them around
Step 3 - Add a few contextual nodes
  1. Click Node and then New Node....
  2. A window appears to enter the node's label. Enter =bob (or another context node label).
  3. Create another node labeled =bob<#email>.
Step 4 - Link 2 nodes
  1. Click Link and then New Link... to start creating a new link.
  2. Drag from the =bob node to the =bob<#email> node.
  3. After releasing it, a new link appears between the 2 nodes. Notice that the label of the link is automatically inferred from the nodes labels.
  4. For consistency, link the common root node to the =bob node.
Step 5 - Add a literal statement
  1. Create a new node labeled "bob@email.biz".
  2. Link the =bob<#email> node to this node.
  3. You'll see an intermediary node is automatically created and both links with proper & labels added. Also note that the "bob@email.biz" node is now a literal node (green stroke).
Step 6 - Add a relational statement
  1. Link the =alice node to the =bob> node.
  2. Click on the link you just created to select it. Then click Link and then Set as Relation.
  3. You'll see the link turn to a red dashed line: this is a relational arc.

Graph Management

Import a graph from XDI statements

Click File, and then click Import XDI.... In the popup window, paste the XDI statements in the text input area.

There are three checkboxes:

  • Delete Current Graph: if checked, the current graph will be cleared before the new graph is created.
  • Combine with current graph: if checked, the statements imported will be added to the current graph. This assumes there are common nodes between the existing graph and the imported statements.
  • Fold Root: if checked, the nodes under the Common Root Node of the imported graph will be folded.

Tip: The Fold Root option helps avoid overwhelming elements when importing large graphs. The Unfold Level 1 function can then be used to unfold only the direct descendants of the common root node.

See: Unfold only the direct descendant of a folded node

Export a graph to XDI statements

Click File and then click Export to XDI.... A new window will pop up that contains the statements representing the current XDI graph.

Note: The popup window may be blocked by the browser.

Export a graph to a PNG image

Click File and then click Export to PNG.... A new window will popup that contains a screenshot of the current graph as a PNG picture. The graph will be exported as displayed on the screen. Therefore, elements that have been folded or hidden will not be included.

Note: This function is only supported on the Chrome browser. On other browsers, an SVG export is performed instead.

Clear the current graph on screen

To clear the graph on screen, click File and then click Clear Graph. All the elements of the current graph will be deleted.

Note: This operation can be undone.

Local storage of a graph

Click File and then click Store Graph. A window will popup asking for a graph name. Enter a graph name and click OK.

The graph will be stored in the browser's local storage (HTML5) and will not be deleted when the page is refreshed or the browser is closed.

Load a graph from local storage

Click File and then click Load Graph. A window will popup prompting for the name of the graph that is to be loaded. The names of the graphs currently stored will be listed in that window. Type the name of the desired graph and click OK.

Note: The new graph will overwrite the current graph on screen.

Clear all graph stored in browser storage

Click File and then click Clear Storage. A window will popup. Type "YES" and click OK to confirm and the local storage will be cleared of any graphs.

Note: This operation CANNOT be undone.

Graph Editing

Select an element

Left Click once on the element. For iPad, Tap once with one finger on the element.

Select multiple elements by clicking

Press and hold Shift and Left Click once on each element to select.

Note: This function is not available on iPad.

Select multiple elements by dragging

Press and hold the Left Mouse Button at any empty space on screen. Then move the cursor and a rectangle will appear. Release the Left Mouse Button and the elements within the rectangle area will be selected.

For iPad, Tap and hold with one finger at any empty space on screen. Then move finger and a rectangle will appear. Release touch and elements within the rectangle area will be selected.

Move elements

First select the elements to move, then press & hold the Left Mouse Button and drag.

For iPad, Tap and hold with one finger on one of the selected elements and move finger.

If multiple elements are selected, they will be moved together.

Cut/Copy/Paste/Duplicate elements

First select the elements. Then click Edit and click the operation to perform.

For the Paste and Duplicate operation, the new elements will be placed near the original elements.

Rename elements / Change labels

First select the elements to rename. Click Edit and then click Rename Element.... A new window will popup with a text area to type the new names. The current label will be displayed in the text area.

If multiple objects are selected, then multiple windows will popup for each element one by one.

Delete elements

First select the elements to be deleted. Click Edit and then click Delete Element.

Note: This operation can be undone.

Copy the labels of elements

First select the elements, click Edit and then click Copy Label.... A new window will popup with all the labels listed in a text area. The text area is selectable as normal text editor.

To close the window, click the X icon or Done.

Undo/Redo operations

Click Edit and then click Undo or Redo.

All the past operations are recorded. You can undo all the way to the first operation or redo to the last operation.

Node Operations

Create a new node at the center of screen

Click Node and then New Node... or press N. A new window will popup with a text area to enter the label for new node. Enter the label in the text area and click OK. The new node will appear at the center of the screen.

Create a new node at a specific position on screen

Press and hold the Shift and click on the position to create node. A new window will popup with a text area asking for the label for the new node. Enter the label in the text area and click OK. The new node will appear at the clicked position.

Note: you must click on an empty space, rather than elements or windows, to perform the operation.

Fold a subgraph

Select the root node of the subgraph to be folded. Click Node and then Fold/Unfold or Double Click on the root node.

This operation may be applied to several subgraphs at the same time.

Note: the stroke of the root node of a folded subgraph will be red, indicating that a subgraph is hidden.

Unfold a subgraph

Select the root node of the subgraph to be unfolded. Click Node and then Fold/Unfold or Double Click on the root node.

This is the reverse operation of Folding subgraphs. It will display the folded subgraph.

Note: If the unfolded subgraph contains previously folded subgraphs, those will remain folded.

Unfold 1 level

Click Node and then Unfold Level 1 or press and hold Shift and Double Click on the root node of the subgraph to be unfolded.

This operation will only display the direct descendants of the selected root node. The subgraphs under those descendants will remain folded.

Several subgraphs may be unfolded at the same time.

Tip: this operation can be used to explore large graph after Import a graph from XDI statements with Fold Root checked.

Unfold the entire graph

Click Node and then Unfold All.

This operation will unfold all folded subgraphs in the entire graph.

Fix/Unfix the position of specific nodes under Force layout

Select the nodes to fix. Click Node and click Fix/Unfix or press the F.

The Force Layout constantly distributes the nodes with a force-based simulation. This operation will stop the layout from moving the fixed nodes as if they are pinned on the screen.

Note: This is a toggle operation. If a node is already fixed, it will be unfixed and vice versa.

Set a node as a Common Root Node

Select the node, click Node and then Set as Root or press R.

This operation will change the node type to Common Root. The shape of the node will change indicating the change of node type. The syntax validator will check the syntax and report at the top left corner of screen.

Note: This is a toggle operation. If the node is already a Common Root Node, it will be changed back to context node and its type will be determined based on its name.

Set a node as a Literal Node

Select the node, click Node and then Set as Literal or press L.

This operation will change the node type to Literal. The shape of nodes will change indicating the change of node type. The syntax validator will check the syntax and report at the top left corner of screen.

Note: This is a toggle operation. If the node is already a Literal Node, it will be changed back to context node and its type will be determined based on its name.

Link Operations

Create a new link from one node to another

Click Link and then New Link or press and hold Shift. Then move the cursor onto the source node, press and hold Left Mouse Button, move the cursor to the target node and release the Left Mouse Button.

If the target node is a Literal Node and the source node is not a value node, a value node will be automatically created and inserted between the source and the target nodes.

The syntax validator will check the syntax and report at the top left corner of screen.

Invert the direction of a link

Select the link to invert. Click Link and then Invert Direction or press L.

The syntax validator will check the syntax and report at the top left corner of screen.

Set a link as a Relational Link

Select the link to set. Click Link and then Set as Relation or press R ke.

The syntax validator will check the syntax and report at the top left corner of screen.

Note: This is a toggle operation. If the link is already a Relational Link, it will be changed back to a Contextual Link.

Graph Layouts

Switch graph layout

Click View and then select Force Layout or Tree Layout.

These are the two layouts to display the XDI Graph. The graph will transform to the new layout.

Reset the nodes to default positions under current layout

Click View and then Reset Layout

This operation will re-layout the graph and move nodes back to the default position after layout.

Tip: This operation is more useful when the tree layout is used.

Change the properties of a layout

The Layout Control panel is located as the top left corner of the screen. It allows for fine-tuning the parameters that control the layout of the nodes. Drag the sliders to change the property values.

Each layout has specific properties that can be controlled:

  • Force layout:
    • Link Distance: The length of links between nodes.
    • Link Strength: The hardness of links, which act like springs. The more rigid, the harder to stretch or squeeze and vice versa.
    • Node Repulsion: The force of nodes pushing against each other.
  • Tree layout:
    • Horizontal Margin: the horizontal margin between different levels in the tree.
    • Vertical Margin: the vertical margin between different branches in the tree.
  • Both layouts:
    • Node Size: The size of shapes that represent nodes in the graph.

Tip: Node Size is useful to prevent nodes from overlapping each other.

Reset the properties of current layout

Click View and then click Reset Layout. The parameters will be reset to their default values.

Fix the positions of all nodes under Force Layout

Click Fixed button on the Legend located at the left-bottom corner of screen.

The Force Layout constantly distributes the nodes with a force-based simulation.. This operation will freeze all the nodes.

Unfix the positions of all nodes under Force layout

Click Moving button on the Legend located at the left-bottom corner of screen.

This operation will resume the simulation and the nodes will move again towards their resting positions. Nodes that were previously fixed will remain so until they are selected and unfixed.

See: Fix/Unfix the position of specific nodes under Force layout

View Control

Zoom in and out

Press and hold option on a Mac or alt on a PC, and Scroll Mouse Wheel to zoom in and out.

To zoom in/out by step, click View and click Zoom In or Zoom Out or press + or - for zooming it or out.

The cursor will change to a magnify glass icon indicating the zooming operation. The boundaries of the viewport and the graph and its current scale are displayed in the Navigator at the bottom right corner of the screen.

See Overview the graph with Navigator and Quick panning with Navigator.

Zoom and fit the whole graph in the window

Click View and then Zoom to fit or press 9.

The graph will be zoomed in/out to fit into the screen. The boundaries of the viewport and the graph and its current scale are displayed in the Navigator at the bottom right corner of screen.

See Overview the graph with Navigator and Quick panning with Navigator.

Zoom and fit part of graph to window size

Select the elements, click View and then Zoom to fit or press 9.

The graph will be zoomed to fit only the selected part into the screen with transition. The boundaries of viewport and graph and the current scale are displayed in the Navigator at the bottom left corner of screen.

See Overview the graph with Navigator and Quick panning with Navigator.

Pan the viewport

Press and hold option on a Mac or alt on a PC, and drag to pan the view.

The cursor will change to hand icon indicating the panning operation. The boundaries of viewport and graph and the current scale are displayed in the Navigator at the bottom left corner screen.

See Overview the graph with Navigator and Quick panning with Navigator.

Reset zoom scale

Click View and then Actual Size or press 0.

The viewport will set back to zooming scale of 1 with transition. The boundaries of viewport and graph and the current scale are displayed in the Navigator at the bottom left corner screen.

See Overview the graph with Navigator and Quick panning with Navigator.

Overview the graph with Navigator

In the navigator, the dark gray area indicates the boundary of a graph, which is updated in real-time as the graph move. The gray rectangle is the boundary of the viewport.

When the graph is smaller than the screen, the navigator will indicate the current position of graph on screen. When the graph is larger than the screen, the navigator will indicate the position of the viewport relative to the whole graph.

Quick panning with Navigator

Move the cursor onto the navigator and drag to panning the graph.

Tip: this is a faster way of panning than panning in the graph.

See: Pan the viewport.

Hide graph components

A list of standard XDI graph components is located at the bottom left of the screen. Click on an item to hide the corresponding components in the current graph.

Search elements

Enter search queries

Click on the Search Bar on the top right corner and type the query. The Search Bar will expand into a panel and display the results.

The results will be updated as the query is entered. The current search is a string-match search within all the labels in the graph including the hidden ones.

Note: The labels in folded subgraphs are not included.

See: Fold a subgraph.

Browse search results

The matched nodes and links are displayed in two scrollable lists. The amount of matches is indicated at the top of each list.

The color-coding of items is the same as the one used in the graph. That is, a Literal Node is green and a Relational Link is red.

Browse matched elements in the graph

The matched elements in the graph are highlighted with light blue. Their labels are displayed even if they are currently hidden.

See: Hide graph components.

Navigate to match elements

Click on the item in the search lists and the graph will be centered and zoomed in on the corresponding element.

Close Search Panel

Click Done next to the search bar to close the Search Panel. The search text area and the lists will be cleared.

Customize windows visibility

Show/Hide a particular window

Click Window and then click the corresponding window to toggle visibility. The tick icon before each item indicates the visibility of the corresponding window.

Show/Hide all the window

Click Window and then click Show All or Hide All to show/hide all the windows at once.

Advanced operations

Interaction Modes

This is a summary of the modifier shortcuts described above. The XDI Graph Editor has three interaction modes and the user can press and hold modifier keys to switch modes.

  1. Browse Mode: drag, select and perform operations on elements in this mode. This is the default mode without any modifier keys held.
  2. Viewport Mode: Any viewport changes are performed in this mode. Current viewport operations are panning and zooming. Press and hold option on a Mac or alt on a PC to enter this mode.
  3. Edit Mode: Any adding operations are performed in this mode. Current adding operations are creating new nodes and new links. Press and hold Shift to enter this mode.

Mouse Functions

With your mouse, you can do the following:
  1. Left-click: Select & Drag a new node.
  2. Shift + Click on Canvas: Create a new node.
  3. Shift + Drag from one node towards another: Add a link between the 2 nodes.
  4. Double-click a root node: Fold the subgraph under that node.

Node related keys

Once a node is selected (by clicking once on it), the following keys are enabled:
  1. R: Switch a node's type to Root. Note that common or inner roots are not distinguished. If the selected node was already of Root type, it will be changed back to Context.
  2. F: Fix/Unfix the movement of a node.
  3. Enter: Rename the node.
  4. Delete/Backspace: Delete the node along with all attached links.

Link related keys

Once a link is selected (by clicking once on it), the following keys are enabled:
  1. R: Switch a link's type to Relationship. If the selected link was already of Relational type, it will be changed back to Context.
  2. L: Inverse a link's direction.
  3. Enter: Rename the link.
  4. Delete/Backspace: Delete the link.

Viewport Control

Press and hold option on a Mac or alt on a PC, you can do the following:
  1. Drag: Pan the viewport.
  2. Scroll Mouse wheel: Scale the viewport.
A navigator at the bottom right indicates the size and position of the viewport.

Search

There is a search bar at the top right. You can perform keyword searches on nodes and links:
  1. Make a query: Click on the search bar and type your query. The results will be listed and updated as you are typing.
  2. Browse Results: The names of matches are listed. The lists are scrollable. All matches are highlighted in the graph.
  3. See it in graph: Click on an item and the view will pan and zoom to the node or link.
  4. Done: Click on done to hide the list.