Merge pull request #2461 from SebastianM-C/recipeutils

Continue Recipeutils integration
This commit is contained in:
Daniel Schwabeneder 2020-03-14 23:18:36 +01:00 committed by GitHub
commit c31654a520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 8 deletions

View File

@ -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"

View File

@ -18,12 +18,13 @@ 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!,
_recipe_init!, _recipe_after_user!,
_recipe_after_plot!, _recipe_finish!
_recipe_after_plot!, _recipe_before_series!,
_recipe_finish!
using Requires
@ -228,7 +229,7 @@ end
const CURRENT_BACKEND = CurrentBackend(:none)
include("precompile.jl")
_precompile_()
# include("precompile.jl")
# _precompile_()
end # module

View File

@ -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)
recipe_pipeline!(plt, plotattributes, args, type_aliases=_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)