Skip to content

Commit

Permalink
Fix "Plotting fails when there are EinExpr nodes in a path whose `h…
Browse files Browse the repository at this point in the history
…ead` length is 0" #28
  • Loading branch information
mofeing committed Nov 20, 2023
1 parent 0fda588 commit 857571a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ext/EinExprsMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,18 @@ function Makie.plot!(
kwargs = Dict{Symbol,Any}(kwargs)

# configure graphics
get!(() -> log_size ./ maximum(log_size) .* MAX_EDGE_WIDTH, kwargs, :edge_width)
get!(() -> log_size ./ maximum(log_size) .* MAX_ARROW_SIZE, kwargs, :arrow_size)
get!(kwargs, :edge_width) do
map(log_size ./ maximum(log_size) .* MAX_EDGE_WIDTH) do x
iszero(x) ? 4.0 : x
end
end

get!(kwargs, :arrow_size) do
map(log_size ./ maximum(log_size) .* MAX_ARROW_SIZE) do x
iszero(x) ? 30.0 : x
end
end

get!(() -> log_flops ./ maximum(log_flops) .* MAX_NODE_SIZE, kwargs, :node_size)

get!(kwargs, :edge_color, lin_size)
Expand Down

0 comments on commit 857571a

Please sign in to comment.