infovis onbeforeplot node color settings visible only after mouseover

43 views Asked by At

I'm using the InfoVis JIT sunburst visualisation and modifying node and parent node color accordingly:

onBeforePlotNode: function(node)
    {

       if(node.data.risk == '1') 
        {
            var parents = node.getParents()[0];
            var gparents = parents.getParents()[0];
            node.data.$color = '#fc9802';
            parents.data.$color = '#fc9802';
            gparents.data.$color = '#fc9802';                  
        }

The problem I'm having is that the color settings are not visible until I move the cursor over any part of the visualisation.

  • Interestingly the first of the color assignments works, node.data.$color = '#fc9802'; (before needing to move cursor):

Is there a way to refresh prior to render (or a better way of setting color)?

1

There are 1 answers

0
haz On

The solution was to employ a delay using

setTimeout(function(){ ...somecode... ,1);

It appears that the delay in milliseconds does not matter - I used 1 and it still worked.