This document describes the resources available from the yFiles AJAX web application. In other words it documents the web application interface of the server side of yFiles AJAX.
This document was created from a WADL description using the wadl_documentation.xsl XSL stylesheet by Mark Nottingham ( http://www.mnot.net/ ) used under the terms of the Creative Commons Attribution-ShareAlike 2.5 License.
The resource returned for this request is a graph tile. A graph tile is an image of a part of the graph. The image of a tile is a quadratic PNG. Its magnification with respect to the world coordinates of the graph is controlled by the zoom factor. For a fixed graph and a fixed zoom factor, all tiles form a grid covering the plane containing the graph. One of those tiles is specified by its column and row.
| parameter | value | description |
|---|---|---|
|
zoom |
double(required) |
the zoom factor, strictly greater than 0, 1.0 is the "original" size of the graph |
|
col |
integer(required) |
the colum of the image, the left edge of the image corresponds to col*size/zoom in world coordinates |
|
row |
integer(required) |
the row of the image, the upper edge of the image corresponds to row*size/zoom in world coordinates |
|
size |
integer(required) |
the size of the image (width and height) in pixels |
|
path |
string(required) |
the name of the graph, which is shown on the image |
the world bounds as an enclosing rectangle for a given graph in comment filtered JSON format
| parameter | value | description |
|---|---|---|
|
path |
string(required) |
the name of the graph |
hit test information for a given graph and a given axis-parallel query rectangle in comment filtered JSON format
| parameter | value | description |
|---|---|---|
|
path |
string(required) |
the name of the graph |
|
x |
double(required) |
left edge of the query rectangle in world coordinates |
|
y |
double(required) |
upper edge of the query rectangle in world coordinates |
|
width |
double(required) |
width of the query rectangle in world coordinates |
|
height |
double(required) |
height of the query rectangle in world coordinates |
|
types |
integer(required) |
types of elements to be included into the response as a bitmask (e.g. 3 means nodes and edges)
|
hit test information for a given graph and a given axis-parallel query rectangle in comment filtered JSON format
| parameter | value | description |
|---|---|---|
|
path |
string(required) |
the name of the graph |
|
x |
double(required) |
left edge of the query rectangle in world coordinates |
|
y |
double(required) |
upper edge of the query rectangle in world coordinates |
|
width |
double(required) |
width of the query rectangle in world coordinates |
|
height |
double(required) |
height of the query rectangle in world coordinates |
|
types |
integer(required) |
types of elements to be included into the response as a bitmask (e.g. 3 means nodes and edges)
|
hierarchy information for a given graph in comment filtered JSON format
| parameter | value | description |
|---|---|---|
|
path |
string(required) |
the name of the graph |
a list of names of graphs in comment filtered JSON format, which are suitable for loadGraph
If the value of the parameter "path" is "foo.ygf", and there is not yet a graph cached for the name "foo.ygf" in the session of the request, then the graph is loaded from the file "foo.ygf" from the directory "resources/graphs" in the web application, to which this servlet belongs, and cached using the name "foo.ygf". Reloading a graph which is already cached can be forced by setting the optional parameter "reload" to "true".
a array of file format descriptions available for downloadGraph in comment filtered JSON format,
each entry is an array containing a description and a file name extension, e.g.,
["GraphML Format","graphml"]
The "downloadGraph" request has a mandatory parameter "path" and an optional parameter "format". The parameter "path" contains the name of the graph to be downloaded.
The parameter "format" specifies the format for the download. It defaults to "ygf". Possible values can be queried with a "downloadableFormats" request. The values are filename extensions of yFiles graph formats; "ygf", "gml", "graphml", "graphmlz" and "tgf". Moreover some image formats are supported: "gif", "jpg", "png" and "bmp" Depending on the server configuration "png" and "bmp" may not be available and "pdf" and "swf" may additionally be available, if the server can access yExport. The response for this request is a binary stream containing the graph in the requested format. For the graph formats "ygf", "gml", "graphml", "graphmlz" and "tgf" the whole graph is exported. For the image formats "gif", "jpg", "png" and "bmp" there are additional parameters for specifying the size and contents of the target image.
The parameters x, y, zoom, width and height are required for image formats. They specify the part of the graph to be exported and the magnification of the target image. Note that there is a limit of 2000 on the target width and height in order to protect the server from allocating too much memory for a single request. If a width or height greater than this limit is requested, then width, height and zoom are scaled down to meet the limits before the request is processed.
| parameter | value | description |
|---|---|---|
|
path |
string(required) |
the name of the graph |
|
format |
One of:
|
the format for the response (default: ygf), depending on the server additional formats are possible (see "downloadableFormats") |
|
x |
left edge of the exported image in world coordinates for image formats, this parameter is required for image formats |
|
|
y |
upper edge of the exported image in world coordinates for image formats, this parameter is required for image formats |
|
|
zoom |
zoom of the exported image for image formats, this parameter is required for image formats |
|
|
width |
width of the exported image in pixels for image formats, this parameter is required for image formats |
|
|
height |
height of the exported image in pixels for image formats, this parameter is required for image formats |
caches a new empty graph for the given name
| parameter | value | description |
|---|---|---|
|
name |
string(required) |
the name of the graph |
returns a comment filtered JSON object containing the names of the available node types (node realizers)
returns a PNG image showing a sample node realized with the given node realizer
| parameter | value | description |
|---|---|---|
|
type |
string(required) |
the name of the node realizer (node type), suitable values are returned by getRealizers |
creates a new node in a cached graph and returns a comment filtered JSON object containing the id of the new node and the new world bounds
creates a new group or folder node in a cached graph and returns a comment filtered JSON object containing the id of the new node and the new world bounds
| parameter | value | description |
|---|---|---|
|
name |
string(required) |
the name of the graph |
|
x |
x coordinate of the new node in world coordinates (default 0) |
|
|
y |
y coordinate of the new node in world coordinates (default 0) |
|
|
closed |
One of:
|
a folder node is created, if this parameter is true, a group node otherwise (default) |
|
type |
the type of node, suitable values are returned by getRealizers |
|
|
subNodeIds |
comma separated ids of the nodes to become members of the inner graph of the newly created node |
|
|
parentNodeId |
id of the parent group or folder node for the new group node, if not specified and no subnode ids are given use the currently visible subgraph, if not specified and subnode ids are given, their nearest common ancestor becomes the parent of the new group |
converts the group node with the given id into a folder node.
converts the folder node with the given id into a group node.
creates a new edge in a cached graph and returns a comment filtered JSON object containing the id of the new edge and the new world bounds
moves the positions of a set of nodes according to a shift vector
removes the first node or edge at the given coordinates and returns a comment filtered JSON object containing the id of the removed node or edge if any and the new world bounds
removes the graph elements with the given ids and returns a comment filtered JSON object containing the id of the removed node or edge if any and the new world bounds. Note that dependent objects are also removed. For example removing a node leads to removing all its adjacent edges and all labels of the removed node and the adjacent edges.
returns the text of the given node label or the text of the first label of the given node as a plain text in UTF-8 encoding.
sets the text of the given node label or the text of the first label of the given node and returns a comment filtered JSON object containing the id of the label and the new world bounds.
performs a layout algorithm on the given graph and returns a comment filtered JSON object containing the new world bounds.
switches the currently displayed graph to the inner graph of a group or folder node.
switches the currently displayed graph to its parent graph.
| parameter | value | description |
|---|---|---|
|
name |
string(required) |
the name of the graph |
moves a set of nodes to another nested graph.
moves each node in a set of nodes one level up.
Copyright (c) 2006-2008 yWorks. All Rights Reserved.