<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create utility network diagram using REST API in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-utility-network-diagram-using-rest-api/m-p/1187188#M4195</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/551024"&gt;@KarthikAditya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We do not have any public Network Diagram JavaScript API yet. However, you can develop your WebApp in JavaScript and visualize the newly generated diagram you expect. To do so, you can follow the guidance below:&lt;/P&gt;&lt;P&gt;First of all, regarding our REST API, the createDiagramFromFeatures operation returns a &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/appendix-diagram-information-object-network-diagram-service-.htm" target="_self"&gt;Diagram Information Object&lt;/A&gt;&amp;nbsp;with the diagram Name given by default to this new diagram.&lt;BR /&gt;This is this default name &amp;lt;diagramName&amp;gt; that you can use to retrieve the new diagram among all the diagrams that currently exist in the dataset,&amp;nbsp;https://&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/network-diagrams.htm" target="_blank"&gt;&amp;lt;networkdiagrams_url&amp;gt;&lt;/A&gt;/&amp;lt;diagramName&amp;gt;&amp;nbsp;and then build the diagram map url for this specific diagram.&lt;BR /&gt;&lt;BR /&gt;As an attached file, please find a sample Network Diagrams WebApp that&amp;nbsp; exemplifies how you can create and display a network diagram using JavaScript code.&lt;BR /&gt;For this sample WebApp, the 1st workflow step is to connect to a utility network service. This makesthe related network data to load in a network map. Then, when users click &lt;STRONG&gt;&lt;I&gt;btnGenerateFromExtent&lt;/I&gt;&lt;/STRONG&gt; (See line#329 in&amp;nbsp;&lt;EM&gt;NetworkDiagramsSampleWebApp.html)&lt;/EM&gt;, the code retrieves the GlobalID of all the network features currently visible in this network map and creates a diagram from this network feature set (see &lt;EM&gt;&lt;STRONG&gt;cloneTemporaryDiagram &lt;/STRONG&gt;&lt;/EM&gt;code starting at line#198 in &lt;EM&gt;networkdiagram.js.&lt;/EM&gt;)&lt;BR /&gt;Then, starting from the default diagram name (&lt;EM&gt;&lt;STRONG&gt;diagramName = res.diagramInfo.name&lt;/STRONG&gt;&lt;/EM&gt;), we build the diagram map URL (see &lt;EM&gt;&lt;STRONG&gt;getDiagramMapUrl&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;at&amp;nbsp;line#142 in &lt;EM&gt;networkdiagram.js.&lt;/EM&gt;) and display this map (see &lt;EM&gt;&lt;STRONG&gt;displayDiagram&lt;/STRONG&gt;&lt;/EM&gt; at line#300 in&amp;nbsp;&lt;EM&gt;NetworkDiagramsSampleWebApp.html)&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;Hopping this helps&lt;BR /&gt;Anne-Yvonne&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 09:08:51 GMT</pubDate>
    <dc:creator>AnneYvonneBlin</dc:creator>
    <dc:date>2022-06-28T09:08:51Z</dc:date>
    <item>
      <title>Create utility network diagram using REST API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-utility-network-diagram-using-rest-api/m-p/1178520#M4159</link>
      <description>&lt;P&gt;I'm trying to create a&amp;nbsp;&lt;SPAN&gt;network diagram based on the Basic diagram template for a&amp;nbsp;utility network feature using&amp;nbsp;createDiagramFromFeatures endpoint&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/create-diagram-from-features-network-diagram-service-.htm" target="_blank" rel="noopener"&gt;Create Diagram From Features—ArcGIS REST APIs | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I get a response of the form&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/appendix-diagram-information-object-network-diagram-service-.htm" target="_self"&gt;Diagram Information object&amp;nbsp;&lt;/A&gt;but I'm not sure how to convert this JSON object into an actual network diagram that can be visualized on a &lt;A href="https://developers.arcgis.com/javascript/latest/display-a-map/" target="_self"&gt;map&lt;/A&gt; that is created using JavaScript API.&lt;/P&gt;&lt;P data-unlink="true"&gt;There is the&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/using-fromjson/" target="_self"&gt;fromJSON&lt;/A&gt; method that can create&amp;nbsp;&lt;SPAN&gt;an instance of the given class from JSON. But, it looks it is supported only for certain types like -&amp;nbsp;&amp;nbsp;symbols&amp;nbsp;,&amp;nbsp;geometries&amp;nbsp;,&amp;nbsp;FeatureSet. Can this method be used to create a network diagram from Diagram Information JSON?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any suggestions or examples related to this would be really helpful&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 12:46:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-utility-network-diagram-using-rest-api/m-p/1178520#M4159</guid>
      <dc:creator>KarthikAditya</dc:creator>
      <dc:date>2022-05-31T12:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create utility network diagram using REST API</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-utility-network-diagram-using-rest-api/m-p/1187188#M4195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/551024"&gt;@KarthikAditya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We do not have any public Network Diagram JavaScript API yet. However, you can develop your WebApp in JavaScript and visualize the newly generated diagram you expect. To do so, you can follow the guidance below:&lt;/P&gt;&lt;P&gt;First of all, regarding our REST API, the createDiagramFromFeatures operation returns a &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/appendix-diagram-information-object-network-diagram-service-.htm" target="_self"&gt;Diagram Information Object&lt;/A&gt;&amp;nbsp;with the diagram Name given by default to this new diagram.&lt;BR /&gt;This is this default name &amp;lt;diagramName&amp;gt; that you can use to retrieve the new diagram among all the diagrams that currently exist in the dataset,&amp;nbsp;https://&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/network-diagrams.htm" target="_blank"&gt;&amp;lt;networkdiagrams_url&amp;gt;&lt;/A&gt;/&amp;lt;diagramName&amp;gt;&amp;nbsp;and then build the diagram map url for this specific diagram.&lt;BR /&gt;&lt;BR /&gt;As an attached file, please find a sample Network Diagrams WebApp that&amp;nbsp; exemplifies how you can create and display a network diagram using JavaScript code.&lt;BR /&gt;For this sample WebApp, the 1st workflow step is to connect to a utility network service. This makesthe related network data to load in a network map. Then, when users click &lt;STRONG&gt;&lt;I&gt;btnGenerateFromExtent&lt;/I&gt;&lt;/STRONG&gt; (See line#329 in&amp;nbsp;&lt;EM&gt;NetworkDiagramsSampleWebApp.html)&lt;/EM&gt;, the code retrieves the GlobalID of all the network features currently visible in this network map and creates a diagram from this network feature set (see &lt;EM&gt;&lt;STRONG&gt;cloneTemporaryDiagram &lt;/STRONG&gt;&lt;/EM&gt;code starting at line#198 in &lt;EM&gt;networkdiagram.js.&lt;/EM&gt;)&lt;BR /&gt;Then, starting from the default diagram name (&lt;EM&gt;&lt;STRONG&gt;diagramName = res.diagramInfo.name&lt;/STRONG&gt;&lt;/EM&gt;), we build the diagram map URL (see &lt;EM&gt;&lt;STRONG&gt;getDiagramMapUrl&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;at&amp;nbsp;line#142 in &lt;EM&gt;networkdiagram.js.&lt;/EM&gt;) and display this map (see &lt;EM&gt;&lt;STRONG&gt;displayDiagram&lt;/STRONG&gt;&lt;/EM&gt; at line#300 in&amp;nbsp;&lt;EM&gt;NetworkDiagramsSampleWebApp.html)&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;Hopping this helps&lt;BR /&gt;Anne-Yvonne&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 09:08:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/create-utility-network-diagram-using-rest-api/m-p/1187188#M4195</guid>
      <dc:creator>AnneYvonneBlin</dc:creator>
      <dc:date>2022-06-28T09:08:51Z</dc:date>
    </item>
  </channel>
</rss>

