That’s described in the documentation. Here’s a complete sample:
<!DOCTYPE html>
<html>
<head>
<title>Minimal GoJS Sample</title>
<!-- Copyright 1998-2021 by Northwoods Software Corporation. -->
<script src="https://unpkg.com/gojs"></script>
<script id="code">
function init() {
var $ = go.GraphObject.make;
myDiagram =
$(go.Diagram, "myDiagramDiv",
{
"animationManager.duration": 250,
"undoManager.isEnabled": true
});
myDiagram.nodeTemplate =
$(go.Node, "Auto",
$(go.Shape,
{ fill: "white", strokeWidth: 0, portId: "", fromLinkable: true, toLinkable: true, cursor: "pointer" },
new go.Binding("fill", "color")),
$(go.TextBlock,
{ name: "TB", margin: 8, editable: true },
new go.Binding("text").makeTwoWay(),
new go.AnimationTrigger("stroke")
)
);
myDiagram.model = new go.GraphLinksModel(
[
{ key: 1, text: "Alpha", color: "lightblue" },
{ key: 2, text: "Beta", color: "orange", blinking: true },
{ key: 3, text: "Gamma", color: "lightgreen" },
{ key: 4, text: "Delta", color: "pink", blinking: true }
],
[
{ from: 1, to: 2 },
{ from: 1, to: 3 },
{ from: 2, to: 2 },
{ from: 3, to: 4 },
{ from: 4, to: 1 }
]);
}
function loop() {
setTimeout(function() {
myDiagram.commit(function(diag) {
diag.nodes.each(function(n) {
if (n.data.blinking) {
var tb = n.findObject("TB");
if (tb) {
tb.flag = !tb.flag;
tb.stroke = tb.flag ? "red" : "black";
}
}
});
}, null);
loop();
}, 1000);
}
loop(); // start animation right away
</script>
</head>
<body onload="init()">
<div id="myDiagramDiv" style="border: solid 1px black; width:100%; height:600px"></div>
</body>
</html>