ArcGIS REST API

Apply Layout (Network Diagrams)

Description

The applyLayout operation is performed on a Diagram resource. The result of this operation is a Diagram JSON Information object, and the moment (date) the applyLayout operation happens for a stored diagram.

It is used to apply a specific diagram algorithm on all or parts of the resource diagram content.

License:
The ArcGIS Utility Network Management extension is required to use this operation.

Request Parameters

ParameterDetails
gdbVersion

Description: The name of the geodatabase version.

Syntax: gdbVersion=<version>

Example: gdbVersion=ABV1

sessionId

Description: The token (guid) used to lock the version.

Syntax: sessionId=<guid>

Example: sessionId=44G259DE-87B0-407D-8F2E-DCB7665DD0F0

layoutName

Required

Description: The name of the algorithm layout to execute (string)

Syntax: layoutName = <AngleDirectedDiagramLayout | CompressionDiagramLayout | ForceDirectedDiagramLayout | GeoPositionsDiagramLayout | GridDiagramLayout | LinearDispatchDiagramLayout | MainLineTreeDiagramLayout | PartialOverlappingEdgesDiagramLayout | RadialTreeDiagramLayout | ReshapeEdgesDiagramLayout | SeparateOverlappingEdgesDiagramLayout | SmartTreeDiagramLayout | SpatialDispatchDiagramLayout >

Example: layoutName = ForceDirectedDiagramLayout

layoutParams

Description: The algorithm layout parameters property set.

There is a specific property set JSON object for each diagram layout parameters

Syntax:

layoutParams = {
 "type": "PropertySet",
 "propertySetItems": ["algoParamName1", <algoParamValue1>, …, "algoParamNameN",<algoParamValueN>]
}

Example:

Sample of parameter property set when layoutName = ForceDirectedDiagramLayout

layoutParams = {
   "type": "PropertySet",
   "propertySetItems": [
    "are_containers_preserved",
    false,
    "is_active",
    false,
    "iterations_number",
    20,
    "repel_factor",
    1,
    "degree_freedom",
    1
   ]
  }

junctionObjectIDs

Description: For the case you want the layout algorithm to execute on a diagram part, a list of junction ObjectIDs (long) that will be processed:

Syntax: junctionObjectIDs=[<DiagJctOid1>, …, <DiagJctOidN]

Example: junctionObjectIDs=[1,2,3,4,5]

containerObjectIDs

Description: For the case you want the layout algorithm to execute on a diagram part, a list of container ObjectIDs (long) that will be processed:

Syntax: containerObjectIDs=[<DiagConOid1>, …, <DiagConOidN]

Example: containerObjectIDs=[1]

edgeObjectIDs

Description: For the case you want the layout algorithm to execute on a diagram part, a list of edge ObjectIDs (long) that will be processed:

Syntax: edgeObjectIDs=[<DiagEdgOid1>, …, <DiagEdgOidN]

Example: edgeObjectIDs=[1,2,3]

f

Description: The response format. The default response format is html.

Values: <html | json>

Example Usage

Applying the SmartTree layout algorithm with its default parameters on the entire DiagramTest2 diagram resource content; this diagram being stored in version ABV1: http://batz.esri.com/server/rest/services/Naperville/NetworkDiagramServer/diagrams/DiagramTest2/applyLayout?gdbVersion=ABV1&sessionId=&layoutName=SmartTreeDiagramLayout&layoutParams=&junctionObjectIDs=&containerObjectIDs=&edgeObjectIDs=&f=pjson

JSON Response Syntax

A JSON object composed of a Diagram JSON Information object and a moment: {"diagramInfo": Diagram JSON Information, "moment": <moment>}

Note:

The moment is only returned for a stored diagram.

JSON Response Example

{
 "diagramInfo": {
  "tag": "",
  "isStored": true,
  "isSystem": false,
  "creator": "acb7352",
  "creationDate": 1505145950000,
  "lastUpdateBy": "acb7352",
  "lastUpdateDate": 1505215730000,
  "containerMargin": 0.5,
  "junctionCount": 10,
  "edgeCount": 12,
  "containerCount": 0,
  "aggregationCount": 0,
  "access": "esriDiagramPublicAccess",
  "diagramExtent": {
   "xmin": 6807604.6431991458,
   "ymin": 1848131.8394459635,
   "xmax": 6807794.5801552236,
   "ymax": 1848226.8080880493,
   "spatialReference": {
    "wkid": 3498,
    "latestWkid": 3498
   }
  },
  "networkExtent": {
   "xmin": 6807604.6431991458,
   "ymin": 1847967.7367558032,
   "xmax": 6808661.8976463079,
   "ymax": 1848650.1848659664,
   "spatialReference": {
    "wkid": 3498,
    "latestWkid": 3498
   }
  },
  "name": "DiagramTest2",
  "id": "{856490C7-ED84-44FE-8EC8-5DA4B39365C0}",
  "template": "Basic"
 },
 "moment": 1505217369240
}