From c333cbc906ea6fa0158f48bb8fab4f1467c70bc6 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sat, 14 Mar 2020 16:57:19 +0100 Subject: [PATCH] implement the recipe_pipeline --- src/plot.jl | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/plot.jl b/src/plot.jl index 6dfc2a7c..3a928764 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -203,6 +203,64 @@ function _recipe_finish!(plt::Plot, plotattributes::AKW, args::Tuple) plt end +# function _plot!(plt::Plot, plotattributes::AKW, args::Tuple) +# +# # -------------------------------- +# # "USER RECIPES" +# # -------------------------------- +# +# kw_list = _process_userrecipes(plt, plotattributes, args) +# +# # @info(1) +# # map(DD, kw_list) +# +# +# # -------------------------------- +# # "PLOT RECIPES" +# # -------------------------------- +# +# # "plot recipe", which acts like a series type, and is processed before +# # the plot layout is created, which allows for setting layouts and other plot-wide attributes. +# # we get inputs which have been fully processed by "user recipes" and "type recipes", +# # so we can expect standard vectors, surfaces, etc. No defaults have been set yet. +# still_to_process = kw_list +# kw_list = KW[] +# while !isempty(still_to_process) +# next_kw = popfirst!(still_to_process) +# _process_plotrecipe(plt, next_kw, kw_list, still_to_process) +# end +# +# # @info(2) +# # map(DD, kw_list) +# +# +# # !!! note: At this point, kw_list is fully decomposed into individual series... one KW per series. !!! +# # !!! The next step is to recursively apply series recipes until the backend supports that series type !!! +# +# # -------------------------------- +# # "SERIES RECIPES" +# # -------------------------------- +# +# # @info(3) +# # map(DD, kw_list) +# +# for kw in 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) +# # now we have a fully specified series, with colors chosen. we must recursively handle +# # series recipes, which dispatch on seriestype. If a backend does not natively support a seriestype, +# # we check for a recipe that will convert that series type into one made up of lower-level components. +# # For example, a histogram is just a bar plot with binned data, a bar plot is really a filled step plot, +# # and a step plot is really just a path. So any backend that supports drawing a path will implicitly +# # be able to support step, bar, and histogram plots (and any recipes that use those components). +# _process_seriesrecipe(plt, series_attr) +# end # we're getting ready to display/output. prep for layout calcs, then update # the plot object after