ibm_ilog.diagram.graphlayout.ServerSideLayout
This class executes a layout algorithm on a server.
operation: A ServerSideLayout object is constructed with the Graph object and the URL where the layout service is located. To execute a layout, the user must select the algorithm with the standard client-side GraphLayout API:
graph.setNodeLayout(x); graph.setLinkLayout(y);
After this, the ServerSideLayout object can be used to execute these algorithms on the server by calling:
serverSideLayout.layout();
This will obtain the currently configured layouts on the graph object, including optional settings for laying out internal subgraphs, gather their configured parameters and requesting the equivalent layout on the server.
Each time a layout is requested, the graph and the layout settings are serialized into a JSON object sent in the request.
The layout() method returns a dojo.Deferred which is signaled after the execution is complete.
Method Summary
- constructor(graph, url) Creates and configures a ServerSideLayout object.
- getTimeout() returns int Returns the current timeout for the request sent to the server.
- getUrl() returns String Returns the location of the layout service at the server.
- isLocalParametersEnabled() returns Boolean Returns 'true' if the local (per node and per link) layout parameters are enabled.
- isRunning() Returns true if the layout is currently running.
- layout() returns dojo.Deferred Requests the layout and applies the results.
- setLocalParametersEnabled(enabled) Sets whether the local (per node and per link) layout parameters are sent to the server-side layout service or to the web worker. enable: Boolean 'true' to enable the local parameters or 'false' to disable it.
- setTimeout(msTimeout) Sets the timeout for the request sent to the server. The unit is milliseconds.
- setUrl(url) Set the location of the layout service at the server.
- stop() Stops the execution of the layout.
Methods
Parameter | Type | Description |
---|---|---|
graph | Graph | The graph to be laid out. |
url | string | String The URL where the server is located. |
Parameter | Type | Description |
---|---|---|
enabled |
Parameter | Type | Description |
---|---|---|
msTimeout | int | The timeout (in milliseconds) for the request sent to the server. |
Parameter | Type | Description |
---|---|---|
url | String | The URL of the layout service at the server. |