title: GoJS update of an animation property for a link through an ajax call
body: <p>I am a newbie and trying to understand the processflow example of gojs and hopefully customize it for my needs. Here is my code:</p>
  <pre><code>  myDiagram.linkTemplate =
      $(go.Link,
        { routing: go.Link.AvoidsNodes, curve: go.Link.JumpGap, corner: 10, reshapable: true, toShortLength: 7 },
        new go.Binding(&quot;points&quot;).makeTwoWay(),
       
        // mark each Shape to get the link geometry with isPanelMain: true
        $(go.Shape, { isPanelMain: true, stroke: &quot;black&quot;, strokeWidth: 7 }),
        $(go.Shape, { isPanelMain: true, strokeWidth: 5 }, 
          new go.Binding(&quot;stroke&quot;, &quot;colors&quot;)),
       $(go.Shape, { isPanelMain: true, stroke: &quot;white&quot;, strokeWidth: 3, name: &quot;PIPE&quot;, strokeDashArray: [10, 10] }),
        $(go.Shape, { toArrow: &quot;Triangle&quot;, scale: 1.3, fill: &quot;gray&quot;, stroke: null })
      );
  
  
    load();
  
  }
  function load() {
              $.ajax({
                      url : &quot;../php/dw_model.php&quot;,
                      type : &quot;GET&quot;,
                      success : function(data){
                      console.log(data);
                      $.ajax({
                              url : &quot;../php/dw_model_link.php&quot;,
                              type : &quot;GET&quot;,
                              success : function(data1){
                                      console.log(data1);
                                      myDiagram.model = new go.GraphLinksModel(data, data1);
                                    // Animate the flow in the pipes
                                    var anim = new go.Animation();
                                    anim.easing = go.Animation.EaseLinear;
                                    myDiagram.links.each(function(link) {
                                      anim.add(link.findObject(&quot;PIPE&quot;), &quot;strokeDashOffset&quot;, 20, 0)
                                    });
                                    // Run indefinitely
                                    anim.runCount = Infinity;
                                    anim.start();
                              },
                              error : function(data1) {
                              }
                      });
  
  
                      },
                      error : function(data) {
                      }
              });
  </code></pre>
  <p>Data:
  php/dw_model.php
  [{&quot;key&quot;:&quot;P1&quot;,&quot;category&quot;:&quot;Process&quot;,&quot;pos&quot;:&quot;300 120&quot;,&quot;text&quot;:&quot;VIP&quot;,&quot;color&quot;:&quot;red&quot;},{&quot;key&quot;:&quot;P2&quot;,&quot;category&quot;:&quot;Process&quot;,&quot;pos&quot;:&quot;180 220&quot;,&quot;text&quot;:&quot;Routing-maxscale-RDU1&quot;,&quot;color&quot;:&quot;green&quot;},{&quot;key&quot;:&quot;P3&quot;,&quot;category&quot;:&quot;Process&quot;,&quot;pos&quot;:&quot;420 220&quot;,&quot;text&quot;:&quot;Routing-maxscale-RDU2&quot;,&quot;color&quot;:&quot;blue&quot;},{&quot;key&quot;:&quot;P4&quot;,&quot;category&quot;:&quot;Process&quot;,&quot;pos&quot;:&quot;300 300&quot;,&quot;text&quot;:&quot;Master-DB&quot;,&quot;color&quot;:&quot;yellow&quot;}]</p>
  <p>php/dw_model_link.php
  [{&quot;from&quot;:&quot;P1&quot;,&quot;to&quot;:&quot;P2&quot;,&quot;colors&quot;:&quot;green&quot;,&quot;speed&quot;:&quot;20&quot;},{&quot;from&quot;:&quot;P2&quot;,&quot;to&quot;:&quot;P3&quot;,&quot;colors&quot;:&quot;green&quot;,&quot;speed&quot;:&quot;10&quot;},{&quot;from&quot;:&quot;P3&quot;,&quot;to&quot;:&quot;P2&quot;,&quot;colors&quot;:&quot;blue&quot;,&quot;speed&quot;:&quot;100&quot;},{&quot;from&quot;:&quot;P3&quot;,&quot;to&quot;:&quot;P4&quot;,&quot;colors&quot;:&quot;yellow&quot;,&quot;speed&quot;:&quot;200&quot;}]</p>
  <p>I understand that the following routine updates each links with animation property of &quot;strokeDashOffset&quot; to 20. I want to be able to update each links &quot;strokeDashOffset&quot; value with the data from the dw_model_link &quot;speed&quot; key.(ie.&quot;speed&quot;:&quot;20&quot;,&quot;speed&quot;:&quot;10&quot; etc). Any help would be appreciated.</p>