Skip to content

Commit

Permalink
fixed reftests failing due to glyph plotting
Browse files Browse the repository at this point in the history
also removed decorations where applicable to prevent future breaking if
only the axis decorations chagen
  • Loading branch information
hexaeder committed Mar 12, 2024
1 parent 9b203be commit d1cd53b
Show file tree
Hide file tree
Showing 53 changed files with 24 additions and 0 deletions.
Binary file modified assets/plots.jl-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/plots.jl-17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reftests.jl-20.png
Binary file modified assets/reftests.jl-21.png
Binary file modified assets/reftests.jl-22.png
Binary file modified assets/reftests.jl-23.png
Binary file modified assets/reftests.jl-24.png
Binary file modified assets/reftests.jl-25.png
Binary file modified assets/reftests.jl-26.png
Binary file modified assets/reftests.jl-27.png
Binary file modified assets/reftests.jl-28.png
Binary file modified assets/reftests.jl-29.png
Binary file modified assets/reftests.jl-30.png
Binary file modified assets/reftests.jl-31.png
Binary file modified assets/reftests.jl-32.png
Binary file modified assets/reftests.jl-33.png
Binary file modified assets/reftests.jl-34.png
Binary file modified assets/reftests.jl-35.png
Binary file modified assets/reftests.jl-36.png
Binary file modified assets/reftests.jl-37.png
Binary file modified assets/reftests.jl-38.png
Binary file modified assets/reftests.jl-39.png
Binary file modified assets/reftests.jl-40.png
Binary file modified assets/reftests.jl-41.png
Binary file modified assets/reftests.jl-42.png
Binary file modified assets/reftests.jl-43.png
Binary file modified assets/syntaxtree.jl-01.png
Binary file modified assets/syntaxtree.jl-02.png
1 change: 1 addition & 0 deletions docs/examples/plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ add_edge!(g, 1, 1) #add self loop
f, ax, p = graphplot(g,
layout = [(0,0)],
waypoints = [[(1,-1),(1,1),(-1,1),(-1,-1)]])
hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect()
@save_reference f #hide

#=
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/reftests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ g = complete_digraph(3)
elabels = repr.(edges(g))
nlabels = repr.(1:nv(g))
fig, ax, p = graphplot(g; elabels, nlabels, elabels_fontsize=10)
hidedecorations!(ax)
@save_reference fig
#
limits!(ax, ax.finallimits[]) # freeze the limits
p[:node_pos][] = Point2f.([(1., -.5), (-1.,0.), (-1.,-1.)])
hidedecorations!(ax)
@save_reference fig

# ## Change of the underlying graph
Expand Down Expand Up @@ -115,28 +117,33 @@ graphplot(fig[1,1],
edge_attr = (; linestyle = [:dot, :dash]),
edge_plottype = :beziersegments,
)
hidedecorations!(current_axis())

graphplot(fig[1,2],
DiGraph([Edge(1 => 2), Edge(2 => 1)]),
edge_attr = (; linestyle = [:dot, :dash]),
edge_plottype = :beziersegments,
)
hidedecorations!(current_axis())

graphplot(fig[2,1],
DiGraph([Edge(1 => 2), Edge(2 => 3), Edge(3=>4), Edge(4=>1)]),
edge_attr = (; linestyle = Linestyle([0.5, 1.0, 1.5, 2.5])),
edge_plottype = :beziersegments,
)
hidedecorations!(current_axis())
@save_reference fig

# ## Self loop with waypoints
g1 = SimpleDiGraph(1)
add_edge!(g1, 1, 1) #add self loop
fig, ax, p = graphplot(g1, layout = [(0,0)], waypoints = [[(1,-1),(1,1),(-1,1),(-1,-1)]])
hidedecorations!(ax)
@save_reference fig

# ## Shift arrows to nodes
fig, ax, p=graphplot(SimpleDiGraph(ones(2,2)),node_size=50,arrow_size=20,curve_distance=0.5,arrow_shift=:end)
hidedecorations!(ax)
@save_reference fig

# ### update shifts
Expand All @@ -147,6 +154,7 @@ add_edge!(g, 1, 1); add_edge!(g, 1, 2); add_edge!(g, 2, 1); add_edge!(g, 2, 3);
fig, ax, p = graphplot(g; arrow_shift=:end,
node_size=[20 for _ in 1:nv(g)],
arrow_size=[20 for _ in 1:ne(g)])
hidedecorations!(ax)
@save_reference fig

p.node_size[][1] = 40
Expand Down Expand Up @@ -175,16 +183,19 @@ fig, ax, p = graphplot(g; arrow_shift=:end, layout=SquareGrid(cols=2),
arrow_attr=(color=:blue,),
edge_color=:red)
xlims!(-.5,1.5); ylims!(-3.5,.5)
hidedecorations!(ax)
@save_reference fig

# ## Inner node labels

fig, ax, p = graphplot(cycle_digraph(3), ilabels=[1, L"\sum_{i=1}^n \alpha^i", "a label"], node_marker=Circle)
hidedecorations!(ax)
@save_reference fig

# Interact with `arrow_shift=:end`

fig, ax, p = graphplot(cycle_digraph(3), ilabels=[1, L"\sum_{i=1}^n \alpha^i", "a label"], node_marker=Circle, arrow_shift=:end)
hidedecorations!(ax)
@save_reference fig

# Update observables
Expand All @@ -204,6 +215,7 @@ gc = circular_ladder_graph(5);
ons = Observable(30);
onf = Observable(30);
fig,ax,p = graphplot(gc; nlabels=repr.(vertices(gc)), node_size=ons, nlabels_fontsize=onf)
hidedecorations!(ax)
@save_reference fig

# Change node size
Expand All @@ -219,6 +231,7 @@ onf[] = 10; # check changes
onf = Observable(Dict(1=>30, 10=>30));
ons = Observable(Dict(1=>30, 10=>30));
fig,ax,p = graphplot(gc; nlabels=repr.(vertices(gc)), node_size=ons, nlabels_fontsize=onf)
hidedecorations!(ax)
@save_reference fig

# Change label font size
Expand All @@ -233,6 +246,7 @@ onf[] = Dict(7=>30); # check changes
ons = Observable(DefaultDict(70, 1=>30, 10=>30));
onf = Observable(DefaultDict(70, 1=>30, 10=>30));
fig,ax,p = graphplot(gc; nlabels=repr.(vertices(gc)), node_size=ons, nlabels_fontsize=onf)
hidedecorations!(ax)
@save_reference fig

# Change node size
Expand All @@ -248,42 +262,51 @@ onf[] = DefaultDict(20, 10=>70); # check changes
# First with a normal `Dict`
gc = circular_ladder_graph(5);
fig,ax,p = graphplot(gc, nlabels=Dict(1=>"One", 2 => "Two"))
hidedecorations!(ax)
@save_reference fig

# And also with a `DefaultDict`
fig,ax,p = graphplot(gc, nlabels=DefaultDict("Unknown", 1=>"One", 2 => "Two"))
hidedecorations!(ax)
@save_reference fig

# ## Use Dict{Edge} for edge arguments
fig,ax,p = graphplot(gc, edge_color=Dict(Edge(7,8)=>:blue))
hidedecorations!(ax)
@save_reference fig

# try out also the DefaultDict
fig,ax,p = graphplot(gc, edge_color=DefaultDict(:green, Edge(7,8)=>:blue))
hidedecorations!(ax)
@save_reference fig

# Of course you can still use integers labeling
ind = findfirst(==(Edge(7,8)) , collect(edges(gc)))
fig,ax,p = graphplot(gc, edge_color=DefaultDict(:green, ind=>:blue))
hidedecorations!(ax)
@save_reference fig

# The same can be done with all enumerations of edge arguments
fig,ax,p = graphplot(gc, elabels=DefaultDict("Unknown", Edge(1,2)=>"1-2", Edge(7,8) => "7-8"))
hidedecorations!(ax)
@save_reference fig

# directed and undirected graphs are handled appropriately.
# For example for directed graphs
gcd = SimpleDiGraph(gc)
fig,ax,p = graphplot(gcd, elabels=DefaultDict("Unknown", Edge(8,7)=>"8-7", Edge(2,7) => "2-7"), nlabels=repr.(vertices(gcd)))
hidedecorations!(ax)
@save_reference fig

# and non-directed graphs
fig,ax,p = graphplot(gc, elabels=DefaultDict("Unknown", Edge(8,7)=>"8-7", Edge(2,7) => "2-7"), nlabels=repr.(vertices(gc)))
hidedecorations!(ax)
@save_reference fig

# Test edge-specific updates
ec = Observable(Dict(Edge(8,7)=>:blue))
fig,ax,p = graphplot(gc, edge_color=ec, nlabels=repr.(vertices(gc)))
hidedecorations!(ax)
@save_reference fig

# update `Observable`
Expand Down

0 comments on commit d1cd53b

Please sign in to comment.