Skip to content

Commit

Permalink
Improve default Vec size in viz
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Mar 19, 2024
1 parent 1421a58 commit e9591d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ext/vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ function Makie.plot!(plot::Viz{<:Tuple{AbstractVector{Vec{Dim,T}}}}) where {Dim,
color = plot[:color]
alpha = plot[:alpha]
colorscheme = plot[:colorscheme]
segmentsize = plot[:segmentsize]

if Dim (2, 3)
error("not implemented")
end
Dim (2, 3) || error("not implemented")

# process color spec into colorant
colorant = Makie.@lift process($color, $colorscheme, $alpha)

# visualize as built-in arrows
origins = Makie.@lift fill(zero(Makie.Point{Dim,T}), length($vecs))
directions = Makie.@lift asmakie.($vecs)
Makie.arrows!(plot, origins, directions, color=colorant)
orig = Makie.@lift fill(zero(Makie.Point{Dim,T}), length($vecs))
dirs = Makie.@lift asmakie.($vecs)
size = Makie.@lift 0.1 * $segmentsize
Makie.arrows!(plot, orig, dirs, color=colorant, arrowsize=size)
end

0 comments on commit e9591d4

Please sign in to comment.