Skip to content

Commit a2be767

Browse files
committed
update
1 parent 737a626 commit a2be767

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/viz.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ using Viznet
22
export vizeinsum, vizconfig
33
using Compose
44

5-
function vizconfig(g::SimpleGraph; locs, config=zeros(Int, length(locs)), unit=1.0, graphsize=12cm, radius=0.03)
6-
vizconfig([string(v)=>locs[v] for v in Graphs.vertices(g)], [(e.src, e.dst) for e in edges(g)]; config=config, unit=unit, graphsize=graphsize, radius=radius)
5+
function vizconfig(g::SimpleGraph; locs, kwargs...)
6+
vizconfig([string(v)=>locs[v] for v in Graphs.vertices(g)], [(e.src, e.dst) for e in edges(g)]; kwargs...)
77
end
88

9-
function vizconfig(nodes, edges; config=zeros(Int, length(nodes)), unit=1.0, graphsize=12cm, radius=0.03)
10-
tb = textstyle(:default, fill("white"), fontsize(10pt*unit))
11-
nb = nodestyle(:circle, fill("black"), r=radius*unit)
12-
nb2 = nodestyle(:circle, fill("red"),r=radius*unit)
13-
eb = bondstyle(:default, linewidth(0.4mm*unit))
9+
function vizconfig(nodes, edges; config=zeros(Int, length(nodes)), unit=1.0, graphsize=12cm, radius=0.03, edgecolor="white", nodecolor="black", nodecolor2="red", textcolor="white")
10+
tb = textstyle(:default, fill(textcolor), fontsize(10pt*unit))
11+
nb = nodestyle(:circle, fill(nodecolor), r=radius*unit)
12+
nb2 = nodestyle(:circle, fill(nodecolor2),r=radius*unit)
13+
eb = bondstyle(:default, stroke(edgecolor), linewidth(0.4mm*unit))
1414
img = canvas() do
1515
for (i, (t, p)) in enumerate(nodes)
1616
(config[i]==1 ? nb2 : nb) >> (p...,)

0 commit comments

Comments
 (0)