Format .jl files [skip ci] (#3846)
Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
parent
032c5d1638
commit
8e17a182f9
@ -521,7 +521,10 @@ function pgfx_add_series!(::Val{:mesh3d}, axis, series_opt, series, series_func,
|
|||||||
elseif typeof(opt[:connections]) <: AbstractVector{NTuple{3,Int}}
|
elseif typeof(opt[:connections]) <: AbstractVector{NTuple{3,Int}}
|
||||||
# 1-based indexing
|
# 1-based indexing
|
||||||
ptable = join(
|
ptable = join(
|
||||||
[string(i-1, " ", j-1, " ", k-1, "\\\\") for (i, j, k) in opt[:connections]],
|
[
|
||||||
|
string(i - 1, " ", j - 1, " ", k - 1, "\\\\") for
|
||||||
|
(i, j, k) in opt[:connections]
|
||||||
|
],
|
||||||
"\n ",
|
"\n ",
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
|
|||||||
@ -693,7 +693,10 @@ function plotly_series(plt::Plot, series::Series)
|
|||||||
plotattributes_out[:k] = k
|
plotattributes_out[:k] = k
|
||||||
elseif typeof(series[:connections]) <: AbstractVector{NTuple{3,Int}}
|
elseif typeof(series[:connections]) <: AbstractVector{NTuple{3,Int}}
|
||||||
# 1-based indexing
|
# 1-based indexing
|
||||||
i, j, k = broadcast(i -> [ inds[i]-1 for inds in series[:connections]], (1, 2, 3))
|
i, j, k = broadcast(
|
||||||
|
i -> [inds[i] - 1 for inds in series[:connections]],
|
||||||
|
(1, 2, 3),
|
||||||
|
)
|
||||||
plotattributes_out[:i] = i
|
plotattributes_out[:i] = i
|
||||||
plotattributes_out[:j] = j
|
plotattributes_out[:j] = j
|
||||||
plotattributes_out[:k] = k
|
plotattributes_out[:k] = k
|
||||||
|
|||||||
@ -702,7 +702,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
polygons = if series[:connections] isa AbstractVector{<:AbstractVector{Int}}
|
polygons = if series[:connections] isa AbstractVector{<:AbstractVector{Int}}
|
||||||
# Combination of any polygon types
|
# Combination of any polygon types
|
||||||
broadcast(inds -> broadcast(i -> [x[i], y[i], z[i]], inds), series[:connections])
|
broadcast(inds -> broadcast(i -> [x[i], y[i], z[i]], inds), series[:connections])
|
||||||
elseif series[:connections] isa AbstractVector{NTuple{N, Int}} where N
|
elseif series[:connections] isa AbstractVector{NTuple{N,Int}} where {N}
|
||||||
# Only N-gons - connections have to be 1-based (indexing)
|
# Only N-gons - connections have to be 1-based (indexing)
|
||||||
broadcast(inds -> broadcast(i -> [x[i], y[i], z[i]], inds), series[:connections])
|
broadcast(inds -> broadcast(i -> [x[i], y[i], z[i]], inds), series[:connections])
|
||||||
elseif series[:connections] isa NTuple{3,<:AbstractVector{Int}}
|
elseif series[:connections] isa NTuple{3,<:AbstractVector{Int}}
|
||||||
@ -710,21 +710,29 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
ci, cj, ck = series[:connections]
|
ci, cj, ck = series[:connections]
|
||||||
if !(length(ci) == length(cj) == length(ck))
|
if !(length(ci) == length(cj) == length(ck))
|
||||||
throw(
|
throw(
|
||||||
ArgumentError("Argument connections must consist of equally sized arrays."),
|
ArgumentError(
|
||||||
|
"Argument connections must consist of equally sized arrays.",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
broadcast(j -> broadcast(i -> [x[i], y[i], z[i]], [ci[j]+1, cj[j]+1, ck[j]+1]), eachindex(ci))
|
broadcast(
|
||||||
|
j -> broadcast(i -> [x[i], y[i], z[i]], [ci[j] + 1, cj[j] + 1, ck[j] + 1]),
|
||||||
|
eachindex(ci),
|
||||||
|
)
|
||||||
else
|
else
|
||||||
throw(
|
throw(
|
||||||
ArgumentError("Unsupported `:connections` type $(typeof(series[:connections])) for seriestype=$st"),
|
ArgumentError(
|
||||||
|
"Unsupported `:connections` type $(typeof(series[:connections])) for seriestype=$st",
|
||||||
|
),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
col = mplot3d.art3d.Poly3DCollection(polygons,
|
col = mplot3d.art3d.Poly3DCollection(
|
||||||
|
polygons,
|
||||||
linewidths = py_thickness_scale(plt, series[:linewidth]),
|
linewidths = py_thickness_scale(plt, series[:linewidth]),
|
||||||
edgecolor = py_color(get_linecolor(series)),
|
edgecolor = py_color(get_linecolor(series)),
|
||||||
facecolor = py_color(series[:fillcolor]),
|
facecolor = py_color(series[:fillcolor]),
|
||||||
alpha = get_fillalpha(series),
|
alpha = get_fillalpha(series),
|
||||||
zorder = series[:series_plotindex]
|
zorder = series[:series_plotindex],
|
||||||
)
|
)
|
||||||
handle = ax."add_collection3d"(col)
|
handle = ax."add_collection3d"(col)
|
||||||
# Fix for handle: https://stackoverflow.com/questions/54994600/pyplot-legend-poly3dcollection-object-has-no-attribute-edgecolors2d
|
# Fix for handle: https://stackoverflow.com/questions/54994600/pyplot-legend-poly3dcollection-object-has-no-attribute-edgecolors2d
|
||||||
@ -734,7 +742,6 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
push!(handles, handle)
|
push!(handles, handle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if st == :image
|
if st == :image
|
||||||
xmin, xmax = ignorenan_extrema(series[:x])
|
xmin, xmax = ignorenan_extrema(series[:x])
|
||||||
ymin, ymax = ignorenan_extrema(series[:y])
|
ymin, ymax = ignorenan_extrema(series[:y])
|
||||||
|
|||||||
@ -132,7 +132,14 @@ function addUnicodeSeries!(
|
|||||||
for (n, segment) in enumerate(series_segments(series, st; check = true))
|
for (n, segment) in enumerate(series_segments(series, st; check = true))
|
||||||
i, rng = segment.attr_index, segment.range
|
i, rng = segment.attr_index, segment.range
|
||||||
lc = get_linecolor(series, i)
|
lc = get_linecolor(series, i)
|
||||||
up = func(up, x[rng], y[rng]; color = up_color(lc), name = n == 1 ? label : "", series_kw...)
|
up = func(
|
||||||
|
up,
|
||||||
|
x[rng],
|
||||||
|
y[rng];
|
||||||
|
color = up_color(lc),
|
||||||
|
name = n == 1 ? label : "",
|
||||||
|
series_kw...,
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
for (xi, yi, str, fnt) in EachAnn(series[:series_annotations], x, y)
|
for (xi, yi, str, fnt) in EachAnn(series[:series_annotations], x, y)
|
||||||
|
|||||||
@ -15,7 +15,11 @@ function get_clims(sp::Subplot, op = process_clims(sp[:clims]))::Tuple{Float64,
|
|||||||
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_clims(sp::Subplot, series::Series, op = process_clims(sp[:clims]))::Tuple{Float64, Float64}
|
function get_clims(
|
||||||
|
sp::Subplot,
|
||||||
|
series::Series,
|
||||||
|
op = process_clims(sp[:clims]),
|
||||||
|
)::Tuple{Float64,Float64}
|
||||||
zmin, zmax = if series[:colorbar_entry]
|
zmin, zmax = if series[:colorbar_entry]
|
||||||
get_clims(sp, op)
|
get_clims(sp, op)
|
||||||
else
|
else
|
||||||
|
|||||||
@ -7,10 +7,9 @@ ismultiversion = false
|
|||||||
@static if !should_precompile
|
@static if !should_precompile
|
||||||
# nothing
|
# nothing
|
||||||
elseif !ismultios && !ismultiversion
|
elseif !ismultios && !ismultiversion
|
||||||
@static if isfile(joinpath(
|
@static if isfile(
|
||||||
@__DIR__,
|
joinpath(@__DIR__, "../deps/SnoopCompile/precompile/precompile_Plots.jl"),
|
||||||
"../deps/SnoopCompile/precompile/precompile_Plots.jl",
|
)
|
||||||
))
|
|
||||||
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
|
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
|
||||||
_precompile_()
|
_precompile_()
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1184,9 +1184,7 @@ _document_argument(S::AbstractString) =
|
|||||||
function mesh3d_triangles(x, y, z, cns::Tuple{Array,Array,Array})
|
function mesh3d_triangles(x, y, z, cns::Tuple{Array,Array,Array})
|
||||||
ci, cj, ck = cns
|
ci, cj, ck = cns
|
||||||
if !(length(ci) == length(cj) == length(ck))
|
if !(length(ci) == length(cj) == length(ck))
|
||||||
throw(
|
throw(ArgumentError("Argument connections must consist of equally sized arrays."))
|
||||||
ArgumentError("Argument connections must consist of equally sized arrays."),
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
X = zeros(eltype(x), 4length(ci))
|
X = zeros(eltype(x), 4length(ci))
|
||||||
Y = zeros(eltype(y), 4length(cj))
|
Y = zeros(eltype(y), 4length(cj))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user