Coloring link does not work

I’m working on example:
https://gojs.net/latest/samples/stateChart.html

i modified first line in linkDataArray
from:
{ “from”: 0, “to”: 0, “text”: “up or timer”, “curviness”: -20 },
to:
{ “from”: 0, “to”: 0, “text”: “up or timer”, “curviness”: -20, “color”: “green” },

but link is not colored.

You need to establish a data Binding on the link’s Shape.stroke property to your data.color property.

Just add this line to your link template’s main Shape:

      . . .
      $(go.Shape,
        { strokeWidth: 1.5 },
        new go.Binding("stroke", "color")),
      . . .

Read more at http://gojs.net/latest/intro/dataBinding.html.

The point of having models and data binding is so that the model data can be very simple, holding only those properties that you want to be different than normal. Furthermore, you have the flexibility to parameterize only those TextBlock or Shape or Panel properties that you want, by putting Bindings only where you need them.