I have use nodeRules to set specific styling for nodes depending on the type of node. Now looking for a way to overrule nodeDisplay settings. What I want to achieve is that when there is no node.image available, that it shows the label.
in my chart I have :
style:{
nodeRules:{"rule1":nodeStyle},
linkRules:{"rule1":linkStyle},
linkLabel:{textStyle:{font:"12px Arial", fillColor: "black"}, backgroundStyle:{fillColor:"#FFF", lineColor:"black"}},
makeImagesCircular:true,
nodeDisplay:"image"
},
in my nodeStyle function, I would like to have something like this:
case "organization":
node.radius = 40;
node.fillColor = "red";
node.lineColor = "red";
node.labelStyle= {textStyle:{font:"14px Arial",fillColor:"black"}};
$.ajax({
url:'/img/'+node.id+'.png',
type:'HEAD',
error: function()
{
// here the chart's nodeDisplay settings would be overruled
node.display="roundtext";
},
success: function()
{
node.image= "/img/"+node.id+".png";
}
});
break;
Currently the nodeDisplay is a global setting, not customizable per node.
Per node display type will certainly be implemented as we develop the chart.