Class EdgeShading
java.lang.Object
edu.cmu.tetrad.graph.EdgeShading
A small color-vision-safe palette for shading graph edges by the sign and strength of an estimated effect. Hues are
from the Okabe-Ito palette, chosen to remain distinguishable under the common forms of color-vision deficiency.
Intensity in [0, 1] runs from a light but clearly colored tint of the hue to a deepened version of it. Shared by the
SEM IM and hybrid CG IM graph views.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Colorcolor(EdgeShading.Hue hue, double intensity) Returns the shade for a hue and intensity.static Colorcolor(EdgeShading.Hue hue, double intensity, boolean dark) Ascolor(Hue, double), for a light or a dark canvas.static Colorsigned(double value, double intensity) Returns the shade for a signed value: POSITIVE for values at or above zero, NEGATIVE otherwise.static Colorsigned(double value, double intensity, boolean dark) Assigned(double, double), for a light or a dark canvas; seecolor(Hue, double, boolean).
-
Method Details
-
color
Returns the shade for a hue and intensity.- Parameters:
hue- the hue familyintensity- a value in [0, 1]; values outside are clamped- Returns:
- the color
-
color
Ascolor(Hue, double), for a light or a dark canvas. The hues are the same in both modes; only the intensity ramp changes. On a light canvas it runs from a pale tint toward a deep shade, so strong edges are dark. On a dark canvas that ramp runs backwards, deepening toward the canvas until the strongest edges are the least visible, so there it runs from a muted, greyed base toward a light tint instead. Both ramps put the weakest edges near 2:1 against their canvas and the strongest near 5:1 to 7:1.- Parameters:
hue- the hue familyintensity- a value in [0, 1]dark- true for a dark canvas- Returns:
- the color
-
signed
Returns the shade for a signed value: POSITIVE for values at or above zero, NEGATIVE otherwise.- Parameters:
value- the signed valueintensity- a value in [0, 1]- Returns:
- the color
-
signed
Assigned(double, double), for a light or a dark canvas; seecolor(Hue, double, boolean).- Parameters:
value- the signed valueintensity- a value in [0, 1]dark- true for a dark canvas- Returns:
- the color
-