From 6061b6ab37e5001d26b33e710974765773d99e9e Mon Sep 17 00:00:00 2001 From: jheinen Date: Sun, 5 Sep 2021 01:07:44 +0000 Subject: [PATCH] Format .jl files [skip ci] --- src/args.jl | 26 ++++++++++++++++++++------ src/axes.jl | 9 +++++++-- src/backends/pyplot.jl | 2 +- src/utils.jl | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/args.jl b/src/args.jl index 7b41a8c473..7cbf1bfde9 100644 --- a/src/args.jl +++ b/src/args.jl @@ -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 diff --git a/src/axes.jl b/src/axes.jl index 86ec10e810..f2298292ae 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -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 diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index cb43de9837..df25b731fa 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -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 diff --git a/src/utils.jl b/src/utils.jl index 337598fe77..e55276484b 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -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]