Class EdgeShading

java.lang.Object
edu.cmu.tetrad.graph.EdgeShading

public final class EdgeShading extends Object
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.
  • Method Details

    • color

      public static Color color(EdgeShading.Hue hue, double intensity)
      Returns the shade for a hue and intensity.
      Parameters:
      hue - the hue family
      intensity - a value in [0, 1]; values outside are clamped
      Returns:
      the color
    • color

      public static Color color(EdgeShading.Hue hue, double intensity, boolean dark)
      As color(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 family
      intensity - a value in [0, 1]
      dark - true for a dark canvas
      Returns:
      the color
    • signed

      public static Color signed(double value, double intensity)
      Returns the shade for a signed value: POSITIVE for values at or above zero, NEGATIVE otherwise.
      Parameters:
      value - the signed value
      intensity - a value in [0, 1]
      Returns:
      the color
    • signed

      public static Color signed(double value, double intensity, boolean dark)
      As signed(double, double), for a light or a dark canvas; see color(Hue, double, boolean).
      Parameters:
      value - the signed value
      intensity - a value in [0, 1]
      dark - true for a dark canvas
      Returns:
      the color