Skip to content

Commit

Permalink
Replace Dot -> Graphviz
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed May 14, 2024
1 parent dc60352 commit 7e9d534
Show file tree
Hide file tree
Showing 11 changed files with 1,288 additions and 1,231 deletions.
3 changes: 2 additions & 1 deletion PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## <!ENTITY ORBVERS "4.8.2">
## <!ENTITY DATASTRUCTURESVERS "0.2.5">
## <!ENTITY NAUTYTRACESINTERFACEVERS "0.2">
## <!ENTITY GRAPHVIZVERS "0.0.0">
## <!ENTITY ARCHIVENAME "digraphs-1.7.1">
## <!ENTITY COPYRIGHTYEARS "2014-24">
## <#/GAPDoc>
Expand Down Expand Up @@ -390,7 +391,7 @@ Dependencies := rec(
GAP := ">=4.10.0",
NeededOtherPackages := [["io", ">=4.5.1"],
["orb", ">=4.8.2"],
["graphviz", "*"],
["graphviz", ">=0.0.0"],
["datastructures", ">=0.2.5"]],
SuggestedOtherPackages := [["GAPDoc", ">=1.6.3"],
["grape", ">=4.8.1"],
Expand Down
846 changes: 332 additions & 514 deletions doc/display.xml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion doc/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
<!ENTITY Grape "<Alt Not='Text'><URL
Text='Grape'>https://gap-packages.github.io/grape</URL></Alt><Alt
Only='Text'><Package>Grape</Package></Alt>">
<!ENTITY graphviz "<Alt Not='Text'><URL
Text='Graphviz'>https://digraphs.github.io/graphviz</URL></Alt><Alt
Only='Text'><Package>Graphviz</Package></Alt>">
<!ENTITY bliss "<Alt Not='Text'><URL
Text='bliss'>http://www.tcs.tkk.fi/Software/bliss/</URL></Alt><Alt
Only='Text'><Package>bliss</Package></Alt>">
<!ENTITY edge-addition-planarity-suite "<Alt Not='Text'><URL
<!ENTITY edge-addition-planarity-suite "<Alt Not='Text'><URL
Text='edge-addition-planarity-suite'>https://github.com/graph-algorithms/edge-addition-planarity-suite</URL></Alt><Alt
Only='Text'><Package>edge-addition-planarity-suite</Package></Alt>">
<!ENTITY nauty "<Alt Not='Text'><URL
Expand Down
15 changes: 13 additions & 2 deletions doc/z-chap9.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<Chapter Label="Visualising and IO"><Heading>Visualising and IO</Heading>

<Section><Heading>Visualising a digraph</Heading>
<#Include Label="Splash">
<#Include Label="GraphvizDigraph">
<#Include Label="DotDigraph">
<#Include Label="DotSymmetricDigraph">

<#Include Label="GraphvizColoredDigraph">
<#Include Label="DotColoredDigraph">

<#Include Label="GraphvizVertexLabelledDigraph">
<#Include Label="DotVertexLabelledDigraph">

<#Include Label="GraphvizPartialOrderDigraph">
<#Include Label="DotPartialOrderDigraph">

<#Include Label="GraphvizPreorderDigraph">
<#Include Label="DotPreorderDigraph">

<#Include Label="GraphvizHighlightedDigraph">
<#Include Label="DotHighlightedDigraph">
</Section>

Expand Down
35 changes: 35 additions & 0 deletions gap/deprecated.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#############################################################################
##
## deprecated.gd
## Copyright (C) 2024 James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

DeclareAttribute("DotDigraph", IsDigraph);
DeclareAttribute("DotSymmetricDigraph", IsDigraph);

DeclareOperation("DotSymmetricVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotVertexColoredDigraph", [IsDigraph, IsList]);

DeclareOperation("DotEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotSymmetricEdgeColoredDigraph", [IsDigraph, IsList]);

DeclareOperation("DotColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("DotSymmetricColoredDigraph", [IsDigraph, IsList, IsList]);

DeclareOperation("DotVertexLabelledDigraph", [IsDigraph]);

DeclareAttribute("DotPartialOrderDigraph", IsDigraph);
DeclareAttribute("DotPreorderDigraph", IsDigraph);

DeclareSynonym("DotQuasiorderDigraph", DotPreorderDigraph);

DeclareOperation("DotHighlightedDigraph", [IsDigraph, IsList]);
DeclareOperation("DotHighlightedDigraph",
[IsDigraph, IsList, IsString, IsString]);
DeclareOperation("DotHighlightedGraph", [IsDigraph, IsList]);
DeclareOperation("DotHighlightedGraph",
[IsDigraph, IsList, IsString, IsString]);
116 changes: 116 additions & 0 deletions gap/deprecated.gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#############################################################################
##
## deprecated.gi
## Copyright (C) 2024 James D. Mitchell
##
## Licensing information can be found in the README file of this package.
##
#############################################################################
##

BindGlobal("_PrintDeprecated", function(old, arg...)
Info(InfoWarning, 1, "`", old, "` is deprecated and will be removed in v3",
" use `", Concatenation(List(arg, String)), "` instead!");
end);

InstallMethod(DotDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotDigraph", "GraphvizDigraph");
return AsString(GraphvizDigraph(D));
end);

InstallMethod(DotSymmetricDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotSymmetricDigraph", "GraphvizGraph");
return AsString(GraphvizGraph(D));
end);

InstallMethod(DotSymmetricVertexColoredDigraph,
"for a digraph and list of colors",
[IsDigraph, IsHomogeneousList],
function(D, colors)
_PrintDeprecated("DotSymmetricVertexColoredDigraph",
"GraphvizVertexColoredGraph");
return AsString(GraphvizVertexColoredGraph(D, colors));
end);

InstallMethod(DotVertexColoredDigraph, "for a digraph and a list",
[IsDigraph, IsList],
function(D, colors)
_PrintDeprecated("DotVertexColoredDigraph",
"GraphvizVertexColoredDigraph");
return AsString(GraphvizVertexColoredDigraph(D, colors));
end);

InstallMethod(DotSymmetricEdgeColoredDigraph,
"for a digraph and list of colors",
[IsDigraph, IsHomogeneousList],
function(D, colors)
_PrintDeprecated("DotSymmetricEdgeColoredDigraph",
"GraphvizEdgeColoredGraph");
return AsString(GraphvizEdgeColoredGraph(D, colors));
end);

InstallMethod(DotEdgeColoredDigraph, "for a digraph and a list",
[IsDigraph, IsList],
function(D, colors)
_PrintDeprecated("DotEdgeColoredDigraph",
"GraphvizEdgeColoredDigraph");
return AsString(GraphvizEdgeColoredDigraph(D, colors));
end);

InstallMethod(DotSymmetricColoredDigraph,
"for a digraph, vertex colors, and edge colors",
[IsDigraph, IsHomogeneousList, IsHomogeneousList],
function(D, n_colors, e_colors)
_PrintDeprecated("DotSymmetricColoredDigraph",
"GraphvizColoredGraph");
return AsString(GraphvizColoredGraph(D, n_colors, e_colors));
end);

InstallMethod(DotColoredDigraph,
"for a digraph, vertex colors, and edge colors",
[IsDigraph, IsHomogeneousList, IsHomogeneousList],
function(D, n_colors, e_colors)
_PrintDeprecated("DotColoredDigraph",
"GraphvizColoredDigraph");
return AsString(GraphvizColoredDigraph(D, n_colors, e_colors));
end);

InstallMethod(DotVertexLabelledDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotVertexLabelledDigraph",
"GraphvizVertexLabelledDigraph");
return AsString(GraphvizVertexLabelledDigraph(D));
end);

InstallMethod(DotPartialOrderDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotPartialOrderDigraph",
"GraphvizPartialOrderDigraph");
return AsString(GraphvizPartialOrderDigraph(D));
end);

InstallMethod(DotPreorderDigraph, "for a digraph", [IsDigraph],
function(D)
_PrintDeprecated("DotPreorderDigraph",
"GraphvizPreorderDigraph");
return AsString(GraphvizPreorderDigraph(D));
end);

InstallMethod(DotHighlightedDigraph,
"for a digraph, list, and two strings",
[IsDigraph, IsList, IsString, IsString],
function(D, hi_verts, hi, lo)
_PrintDeprecated("DotHighlightedDigraph",
"GraphvizHighlightedDigraph");
return AsString(GraphvizHighlightedDigraph(D, hi_verts, hi, lo));
end);

InstallMethod(DotHighlightedDigraph, "for a digraph and list",
[IsDigraph, IsList],
function(D, list)
_PrintDeprecated("DotHighlightedDigraph",
"GraphvizHighlightedDigraph");
return AsString(GraphvizHighlightedDigraph(D, list, "black", "grey"));
end);
84 changes: 52 additions & 32 deletions gap/display.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,57 @@
#############################################################################
##

DeclareAttribute("GraphvizDotDigraph", IsDigraph);
DeclareOperation("GraphvizDotColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("GraphvizDotVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizDotEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizDotVertexLabelledDigraph", [IsDigraph]);
DeclareAttribute("GraphvizDotSymmetricDigraph", IsDigraph);
DeclareOperation("GraphvizDotSymmetricColoredDigraph",
[IsDigraph, IsList, IsList]);
DeclareOperation("GraphvizDotSymmetricVertexColoredDigraph",
[IsDigraph, IsList]);
DeclareOperation("GraphvizDotSymmetricEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareAttribute("GraphvizDotPartialOrderDigraph", IsDigraph);
DeclareAttribute("GraphvizDotPreorderDigraph", IsDigraph);
DeclareSynonym("GraphvizDotQuasiorderDigraph", GraphvizDotPreorderDigraph);
DeclareOperation("GraphvizDotHighlightedDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizDotHighlightedDigraph",
[IsDigraph, IsList, IsString, IsString]);
#############################################################################
# Graphs and digraphs
#############################################################################

DeclareAttribute("DotDigraph", IsDigraph);
DeclareOperation("DotColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("DotVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotVertexLabelledDigraph", [IsDigraph]);
DeclareAttribute("DotSymmetricDigraph", IsDigraph);
DeclareOperation("DotSymmetricColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("DotSymmetricVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("DotSymmetricEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareAttribute("DotPartialOrderDigraph", IsDigraph);
DeclareAttribute("DotPreorderDigraph", IsDigraph);
DeclareSynonym("DotQuasiorderDigraph", DotPreorderDigraph);
DeclareOperation("DotHighlightedDigraph", [IsDigraph, IsList]);
DeclareOperation("DotHighlightedDigraph",
[IsDigraph, IsList, IsString, IsString]);
DeclareOperation("GraphvizDigraph", [IsDigraph]);
DeclareOperation("GraphvizGraph", [IsDigraph]);

#############################################################################
# Vertex coloured graphs and digraphs
#############################################################################

DeclareOperation("GraphvizVertexColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizVertexColoredGraph", [IsDigraph, IsList]);

#############################################################################
# Edge coloured graphs and digraphs
#############################################################################

DeclareOperation("GraphvizEdgeColoredDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizEdgeColoredGraph", [IsDigraph, IsList]);

#############################################################################
# Vertex and edge coloured graphs and digraphs
#############################################################################

DeclareOperation("GraphvizColoredDigraph", [IsDigraph, IsList, IsList]);
DeclareOperation("GraphvizColoredGraph", [IsDigraph, IsList, IsList]);

#############################################################################
# Vertex labelled graphs and digraphs
#############################################################################

DeclareOperation("GraphvizVertexLabelledDigraph", [IsDigraph]);
DeclareOperation("GraphvizVertexLabelledGraph", [IsDigraph]);

#############################################################################
# Partial and preorder digraphs
#############################################################################

DeclareAttribute("GraphvizPartialOrderDigraph", IsDigraph);
DeclareAttribute("GraphvizPreorderDigraph", IsDigraph);

DeclareSynonym("GraphvizQuasiorderDigraph", GraphvizPreorderDigraph);

#############################################################################
# Highlighted subdigraphs
#############################################################################

DeclareOperation("GraphvizHighlightedDigraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizHighlightedDigraph",
[IsDigraph, IsList, IsString, IsString]);
DeclareOperation("GraphvizHighlightedGraph", [IsDigraph, IsList]);
DeclareOperation("GraphvizHighlightedGraph",
[IsDigraph, IsList, IsString, IsString]);
Loading

0 comments on commit 7e9d534

Please sign in to comment.