From 37391f284373fddf277e37c7ad581f6e4750aac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Sat, 14 Mar 2020 21:27:12 +0200 Subject: [PATCH 1/4] Add _recipe_before_series --- src/Plots.jl | 3 ++- src/plot.jl | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 4f644127..831414f6 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -23,7 +23,8 @@ import RecipeUtils: _process_userrecipes, _process_plotrecipe, preprocessArgs!, is_st_supported, recipe_pipeline!, _recipe_init!, _recipe_after_user!, - _recipe_after_plot!, _recipe_finish! + _recipe_after_plot!, _recipe_before_series!, + _recipe_finish! using Requires diff --git a/src/plot.jl b/src/plot.jl index f74e6d5d..42ae43eb 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -155,7 +155,7 @@ function plot!(plt::Plot, args...; kw...) plotattributes = KW(kw) preprocessArgs!(plotattributes) # merge!(plt.user_attr, plotattributes) - recipe_pipeline!(plt, plotattributes, args) + recipe_pipeline!(plt, plotattributes, args, _typeAliases=_typeAliases) end # ------------------------------------------------------------------------------- @@ -174,7 +174,7 @@ function _recipe_init!(plt::Plot, plotattributes::AKW, args::Tuple) end end -function _recipe_after_plot!(plt::Plot, plotattributes::AKW, args::Tuple) +function _recipe_after_plot!(plt::Plot, plotattributes::AKW, kw_list::Vector{KW}) # -------------------------------- # Plot/Subplot/Layout setup # -------------------------------- @@ -182,6 +182,16 @@ function _recipe_after_plot!(plt::Plot, plotattributes::AKW, args::Tuple) _subplot_setup(plt, plotattributes, kw_list) end +function _recipe_before_series!(plt::Plot, kw, kw_list) + sp::Subplot = kw[:subplot] + + # in series attributes given as vector with one element per series, + # select the value for current series + _slice_series_args!(kw, plt, sp, series_idx(kw_list,kw)) + + series_attr = Attr(kw, _series_defaults) +end + function _recipe_finish!(plt::Plot, plotattributes::AKW, args::Tuple) current(plt) From 6aa4c4ee7fb8d2e6bfd0565012ed0b1af1bf6485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Sat, 14 Mar 2020 21:27:32 +0200 Subject: [PATCH 2/4] Disable precompile file for now --- src/Plots.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 831414f6..ded11772 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -229,7 +229,7 @@ end const CURRENT_BACKEND = CurrentBackend(:none) -include("precompile.jl") -_precompile_() +# include("precompile.jl") +# _precompile_() end # module From fb82e6c2a504b6e5d3e8803fa76bb2df3d4e1779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Sat, 14 Mar 2020 22:41:52 +0200 Subject: [PATCH 3/4] Rename _typeAliases to type_aliases --- src/plot.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plot.jl b/src/plot.jl index 42ae43eb..6dfc2a7c 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -54,7 +54,7 @@ function plot(args...; kw...) # create an empty Plot then process plt = Plot() # plt.user_attr = plotattributes - recipe_pipeline!(plt, plotattributes, args) + recipe_pipeline!(plt, plotattributes, args, type_aliases=_typeAliases) end # build a new plot from existing plots @@ -155,7 +155,7 @@ function plot!(plt::Plot, args...; kw...) plotattributes = KW(kw) preprocessArgs!(plotattributes) # merge!(plt.user_attr, plotattributes) - recipe_pipeline!(plt, plotattributes, args, _typeAliases=_typeAliases) + recipe_pipeline!(plt, plotattributes, args, type_aliases=_typeAliases) end # ------------------------------------------------------------------------------- From 4fab583c02a4498ce0929fbc422a8f39d60ecf62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Sun, 15 Mar 2020 00:12:39 +0200 Subject: [PATCH 4/4] rename --- Project.toml | 2 +- src/Plots.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index c4b75b7d..30e9b1bb 100644 --- a/Project.toml +++ b/Project.toml @@ -21,7 +21,7 @@ PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -RecipeUtils = "01d81517-befc-4cb6-b9ec-a95719d0359c" +RecipePipeline = "01d81517-befc-4cb6-b9ec-a95719d0359c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" Requires = "ae029012-a4dd-5104-9daa-d747884805df" diff --git a/src/Plots.jl b/src/Plots.jl index ded11772..4293b811 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -18,7 +18,7 @@ using Base.Meta import Showoff import StatsBase import JSON -import RecipeUtils: _process_userrecipes, _process_plotrecipe, +import RecipePipeline: _process_userrecipes, _process_plotrecipe, _process_seriesrecipe, _preprocess_args, preprocessArgs!, is_st_supported, recipe_pipeline!,