Wiki

Clone wiki

Tree Visualization API / setStrokeColor

Operator.js

connectTofillorderreshaperotatescalesetStrokeColorsetStrokeWidthslicesquarifystriptranslate

Function setStrokeColor

Assigns a line a color/color from a palette. Recommended stage: POSTLAYOUT

Function definition


setStrokeColor(scope,color,condition)
setStrokeColor(scope,palette,direction,value,maxvalue,condition)            

Parameters


scope = (NODES|EDGES)
color = “#RRGGBB in hex
palette = ("YlGn", "YlGnBu", "GnBu", "BuGn", "PuBuGn", "PuBu", "BuPu", "RdPu", "PuRd",
	    "OrRd", "YlOrRd", "YlOrBr", "Purples", "Blues", "Greens", "Oranges", "Reds","Greys")
			- taken from http://colorbrewer2.org (sequential palettes)
direction = (DARK2LIGHT|LIGHT2DARK)
value = the value to be mapped on a color
maxvalue = maximum value to be mapped on the highest color (0 is the assumed minvalue)
condition = optional condition if operator is to be carried out. If left out, it is assumed TRUE

Example


//Make the nodes border line blue.
POSTLAYOUT:
{
reshape(POINT);
setStrokeColor(NODES,"#00FF00");
}

Updated