Skip to content

Commit

Permalink
Merge pull request #189 from MakieOrg/hexaeder-patch-1
Browse files Browse the repository at this point in the history
remove unneccesary outputs
  • Loading branch information
hexaeder authored Jun 24, 2024
2 parents 09132b5 + 06bf20e commit 5839721
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/examples/scenegraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function walk_tree(scene)
walk_tree!(g, labels, scene)
return (g, labels)
end
nothing #hide

# Now, we can walk down the Scene tree. Scenes can have child Scenes as well as child Plots,
# but in terms of semantic order we walk down the Scene tree before looking at the Scene's attached
Expand Down Expand Up @@ -64,6 +65,7 @@ end
## the cruft that comes from excessive type printing.
label_str(::Scene) = "Scene"
label_str(::Makie.Combined{F, T}) where {F, T} = string(F) # get only the plot func, not the argument type
nothing #hide


# ## Creating the plot
Expand All @@ -79,6 +81,7 @@ end
newg, newl = walk_tree(fig.scene)
## This is for convenience later:
nlabels_align = [(:left, :center) for v in vertices(newg)]
nothing #hide
# We start out by plotting the graph itself.
f, a, p = graphplot(
newg;
Expand All @@ -102,10 +105,8 @@ fig

for v in vertices(newg)
if isempty(inneighbors(newg, v)) # root
println("Found root")
nlabels_align[v] = (:center,:bottom)
elseif isempty(outneighbors(newg, v)) #leaf
println("Found leaf")
nlabels_align[v] = (:center,:top)
else
self = p[:node_pos][][v]
Expand All @@ -116,5 +117,6 @@ for v in vertices(newg)
end
end
p.nlabels_align = nlabels_align
nothing #hide
# ### Final figure
@save_reference f

0 comments on commit 5839721

Please sign in to comment.