Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphvizSetAttr doesn't work on 2nd application #24

Closed
james-d-mitchell opened this issue May 15, 2024 · 3 comments
Closed

GraphvizSetAttr doesn't work on 2nd application #24

james-d-mitchell opened this issue May 15, 2024 · 3 comments

Comments

@james-d-mitchell
Copy link
Member

james-d-mitchell commented May 15, 2024

gap> gv := GraphvizGraph("xxx");
<graphviz graph xxx with 0 nodes and 0 edges>
gap> GraphvizAddNode(gv, 1);
<graphviz node 1>
gap> GraphvizAddNode(gv, 2);
<graphviz node 2>
gap> GraphvizAddNode(gv, 3);
<graphviz node 3>
gap> GraphvizSetNodeLabels(gv, ["i", "ii", "iii"]);
<graphviz graph xxx with 3 nodes and 0 edges>
gap> Print(String(gv));
//dot
graph xxx {
	1 [label=i]
	2 [label=ii]
	3 [label=iii]
}
gap> GraphvizSetNodeLabels(gv, ["a", "b", "c"]);
<graphviz graph xxx with 3 nodes and 0 edges>
gap> Print(String(gv));
//dot
graph xxx {
	1 [label=i]
	2 [label=ii]
	3 [label=iii]
}

Should rather be "a", "b", and "c" the second time around.

@james-d-mitchell
Copy link
Member Author

james-d-mitchell commented May 15, 2024

Here's another example:

gap> gv := GraphvizGraph("xxx");
<graphviz graph xxx with 0 nodes and 0 edges>
gap> GraphvizAddNode(gv, 1);
<graphviz node 1>
gap> GraphvizAddNode(gv, 2);
<graphviz node 2>
gap> GraphvizAddNode(gv, 3);
<graphviz node 3>
gap> GraphvizSetNodeColors(gv, ["i", "ii", "iii"]);
Error, invalid color "i" (list (string)), valid colors are RGB values or names\
 from the GraphViz 2.44.1 X11 Color Scheme http://graphviz.org/doc/info/colors\
.html
gap> GraphvizSetNodeColors(gv, ["red", "green", "blue"]);
<graphviz graph xxx with 3 nodes and 0 edges>
gap> Print(String(gv));
//dot
graph xxx {
	1 [color=red, style=filled]
	2 [color=green, style=filled]
	3 [color=blue, style=filled]
}
gap> GraphvizSetNodeColors(gv, ["red", "#00FF00", "blue"]);
<graphviz graph xxx with 3 nodes and 0 edges>
gap> Print(String(gv));
//dot
graph xxx {
	1 [color=red, style=filled]
	2 [color=green, style=filled]
	3 [color=blue, style=filled]
}
gap> GraphvizSetNodeColors(gv, ["#FF0000", "#00FF00", "#0000FF"]);
<graphviz graph xxx with 3 nodes and 0 edges>
gap> Print(String(gv));
//dot
graph xxx {
	1 [color=red, style=filled]
	2 [color=green, style=filled]
	3 [color=blue, style=filled]
}

@james-d-mitchell
Copy link
Member Author

I think this is a problem that I introduced, will fix.

mpan322 added a commit to mpan322/graphviz that referenced this issue May 15, 2024
@james-d-mitchell
Copy link
Member Author

Resolved it in my PR #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant