degraph icon indicating copy to clipboard operation
degraph copied to clipboard

Other color for wrong edges

Open opensource21 opened this issue 9 years ago • 4 comments

A lot of people have problems to see the color red. At the moment I replace #FF0000 with #0101FF in the graphml. Now I find the error much quicker even in a difficult diagram. Would be nice to have it configurable.

Workaround

    /**
     * Define the name of errorfile with Junit-Name-Rule.
     */
    @Before
    public void setUp() {
        errorFilename = name.getMethodName() + "Error.graphml";
        final Package runtimePackage = Runtime.class.getPackage();
        final boolean oracleJDK = runtimePackage.getImplementationVendor().contains("Oracle");
        final boolean java7 = runtimePackage.getImplementationVersion().startsWith("1.7.0");
        // Oracle JDK 1.7 ends with OutOfMemory at travis-ci..
        Assume.assumeFalse(oracleJDK && java7);
    }

    /**
     * Change color from RED to BLUE.
     * @throws IOException .
     */
    @After
    public void fixForRedBlindPeople() throws IOException {
        final Path errorFile = Paths.get(errorFilename);
        if (Files.exists(errorFile)) {
            final Charset charset = StandardCharsets.UTF_8;
            String content = new String(Files.readAllBytes(errorFile), charset);
            content = content.replaceAll("#FF0000", "#0101FF");
            Files.write(errorFile, content.getBytes(charset));
        }
    }

opensource21 avatar Jan 20 '17 16:01 opensource21

Thanks for the input,

schauder avatar Jan 21 '17 07:01 schauder

I have two questions:

  1. Can you recommend a color that is red for people with normal vision, but also clearly distinguishable for people that can't see the color red? Maybe a light red?

  2. What do you think about a different line style instead like dashed or dotted?

schauder avatar Jan 21 '17 08:01 schauder

About 1: You could try purple, which is easy to see for both. But you have no chance to find a solution which looks red for people with normal color-seeing and the one which are blind. Light red would be worse for both.

About 2: You could make all other lines dotted and the violations normal. I think the violations should be the eye catcher.

opensource21 avatar Jan 21 '17 18:01 opensource21

Generally, it would be nice that dehraph takes options to select the colours. I imagine:

  • colour for the edges
  • colour for edges causing a violation
  • colour for java packages
  • colour for each slice

regisd avatar Oct 23 '18 07:10 regisd