vis.js setOptions to change color on network node
<p>I am using vis.js to display network nodes. I am parsing the node data from JSON and storing it in an array:</p>

<pre><code>$.each(jsonObj, function(i, val) {  

    var itemId      = val.id;
    var itemGroup   = val.group;
    var itemLabel   = val.label;
    var itemLevel   = val.level;
    var itemData    = val.nodeData;
    var itemX       = val.x;
    var itemY       = val.y;
    var nodeData    = JSON.parse(val.nodeData);

nodes[nodeCnt] = { id: itemId, group: itemGroup, label: itemLabel, level: itemLevel, title: itemData, x: itemX, y: itemY, font: { color: colour }, color: { border: colour }};
        nodeCnt++;

}
</code></pre>

<p><strong>This work perfectly and I can display my network:</strong></p>

<pre><code>var data = {
    nodes: nodes,
    edges: edges

};

var options = { ... }
network = new vis.Network( container, data, options );
</code></pre>

<p>I use an event handler to take action when a node it clicked, I parse the ID of the clicked node (this is the shorthand version):</p>

<pre><code>network.on("click", function (params) {

        // parse node id
        var nodeID = params['nodes']['0'];

}
</code></pre>

<p>I would like to update the color of the node, I have tried various variation including the following to no avail?</p>

<pre><code>var options = {
    nodes:{
        id: nodeID,
        borderWidth: 20,
        color: {
            border: '#000000',
            background: '#000000',
            border:  '#000000',
            highlight: {
                border: '#2B7CE9',
                background: '#D2E5FF'
            }
        }
    }
}
network.setOptions(options);
</code></pre>

<p>I have been round and round trying different ways of doing this. If I remove the <code>"id: nodeID,"</code> parameter from the above options I would expect all the nodes to be updated, however none are.</p>

<p>I am using standard id's for my nodes: <code>595191aa-98c6-4a4b-a0e0-4262df83e0de</code></p>

<p>Any ideas?</p>

<p>Thank you in advance.</p>