Format .jl files [skip ci] (#3795)

Co-authored-by: t-bltg <t-bltg@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2021-09-06 11:52:32 +02:00 committed by GitHub
parent 748104c807
commit 34758c82a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 11 deletions

View File

@ -616,7 +616,7 @@ const _all_series_args = sort(union([_series_args; _magic_series_args]))
const _all_plot_args = _plot_args
for letter in (:x, :y, :z)
_attrsymbolcache[letter] = Dict{Symbol, Symbol}()
_attrsymbolcache[letter] = Dict{Symbol,Symbol}()
for k in keys(_axis_defaults)
# populate attribute cache
lk = Symbol(letter, k)
@ -1237,8 +1237,10 @@ function processGridArg!(plotattributes::AKW, arg, letter)
plotattributes[get_attr_symbol(letter, :foreground_color_grid)] =
arg.color in (:auto, :match) ? :match : plot_color(arg.color)
)
arg.alpha === nothing || (plotattributes[get_attr_symbol(letter, :gridalpha)] = arg.alpha)
arg.style === nothing || (plotattributes[get_attr_symbol(letter, :gridstyle)] = arg.style)
arg.alpha === nothing ||
(plotattributes[get_attr_symbol(letter, :gridalpha)] = arg.alpha)
arg.style === nothing ||
(plotattributes[get_attr_symbol(letter, :gridstyle)] = arg.style)
# linealpha
elseif allAlphas(arg)
@ -1249,7 +1251,11 @@ function processGridArg!(plotattributes::AKW, arg, letter)
plotattributes[get_attr_symbol(letter, :gridlinewidth)] = arg
# color
elseif !handleColors!(plotattributes, arg, get_attr_symbol(letter, :foreground_color_grid))
elseif !handleColors!(
plotattributes,
arg,
get_attr_symbol(letter, :foreground_color_grid),
)
@warn("Skipped grid arg $arg.")
end
end
@ -1286,7 +1292,11 @@ function processMinorGridArg!(plotattributes::AKW, arg, letter)
plotattributes[get_attr_symbol(letter, :minorgrid)] = true
# color
elseif handleColors!(plotattributes, arg, get_attr_symbol(letter, :foreground_color_minor_grid))
elseif handleColors!(
plotattributes,
arg,
get_attr_symbol(letter, :foreground_color_minor_grid),
)
plotattributes[get_attr_symbol(letter, :minorgrid)] = true
else
@warn("Skipped grid arg $arg.")
@ -1413,7 +1423,11 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW)
# handle individual axes font args
for letter in (:x, :y, :z)
for fontname in (:tickfont, :guidefont)
args = RecipesPipeline.pop_kw!(plotattributes, get_attr_symbol(letter, fontname), ())
args = RecipesPipeline.pop_kw!(
plotattributes,
get_attr_symbol(letter, fontname),
(),
)
for arg in wraptuple(args)
processFontArg!(plotattributes, get_attr_symbol(letter, fontname), arg)
end

View File

@ -68,7 +68,11 @@ function process_axis_arg!(plotattributes::AKW, arg, letter = "")
elseif typeof(arg) <: Function
plotattributes[get_attr_symbol(letter, :formatter)] = arg
elseif !handleColors!(plotattributes, arg, get_attr_symbol(letter, :foreground_color_axis))
elseif !handleColors!(
plotattributes,
arg,
get_attr_symbol(letter, :foreground_color_axis),
)
@warn("Skipped $(letter)axis arg $arg")
end
end
@ -463,7 +467,8 @@ function expand_extrema!(sp::Subplot, plotattributes::AKW)
# TODO: need more here... gotta track the discrete reference value
# as well as any coord offset (think of boxplot shape coords... they all
# correspond to the same x-value)
plotattributes[letter], plotattributes[get_attr_symbol(letter, :(_discrete_indices))] =
plotattributes[letter],
plotattributes[get_attr_symbol(letter, :(_discrete_indices))] =
discrete_value!(axis, data)
expand_extrema!(axis, plotattributes[letter])
end

View File

@ -62,7 +62,7 @@ end
for k in (:linthresh, :base, :label)
# add PyPlot specific symbols to cache
_attrsymbolcache[k] = Dict{Symbol, Symbol}()
_attrsymbolcache[k] = Dict{Symbol,Symbol}()
for letter in (:x, :y, :z, Symbol(""), :top, :bottom, :left, :right)
_attrsymbolcache[k][letter] = Symbol(k, letter)
end

View File

@ -71,7 +71,7 @@ function addUnicodeSeries!(
ylim,
)
st = series[:seriestype]
# get the series data and label
x, y = if st == :straightline
straightline_data(series)

View File

@ -1216,7 +1216,7 @@ function mesh3d_triangles(x, y, z, cns)
end
# cache joined symbols so they can be looked up instead of constructed each time
const _attrsymbolcache = Dict{Symbol, Dict{Symbol, Symbol}}()
const _attrsymbolcache = Dict{Symbol,Dict{Symbol,Symbol}}()
get_attr_symbol(letter::Symbol, keyword::String) = get_attr_symbol(letter, Symbol(keyword))
get_attr_symbol(letter::Symbol, keyword::Symbol) = _attrsymbolcache[letter][keyword]