Digraphs icon indicating copy to clipboard operation
Digraphs copied to clipboard

Write a default "edge colours" function

Open james-d-mitchell opened this issue 7 months ago • 0 comments

At present it's possible to do things like DotEdgeColoredDigraph where the second argument is the list of colours. I often find this second argument more or less difficult to propagate, it'd be good to have a function something like:

EdgeColors := function(D)
  local colors, result, nbs;

colors := ["#00ff00",
           "#ff00ff",
           "#007fff",
           "#ff7f00",
           "#7fbf7f",
           "#600aa0",
           "#b20505",
           "#b16efe",
           "#397807",
           "#dbfe01",
           "#00ffff",
           "#0b6782",
           "#00ff7f",
           "#fc4789"];
  

result := [];
  for nbs in OutNeighbours(D) do
  Add(result, colors{[1 .. Length(nbs)]});
  od;
  return result;
end;

that populates the edge colours with something more (or less) sensible.

james-d-mitchell avatar Aug 18 '25 10:08 james-d-mitchell