forked from JuliaPlots/Plots.jl
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from SebastianM-C/vc2
Attempt to complete pipeline change
- Loading branch information
Showing
5 changed files
with
54 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name = "RecipeUtils" | ||
name = "RecipePipeline" | ||
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" | ||
authors = ["Michael Krabbe Borregaard <[email protected]>"] | ||
version = "0.1.0" | ||
|
3 changes: 2 additions & 1 deletion
3
RecipesPipeline/src/RecipeUtils.jl → RecipesPipeline/src/RecipePipeline.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
module RecipeUtils | ||
module RecipePipeline | ||
|
||
import RecipesBase | ||
include("pipeline.jl") | ||
include("process_recipes.jl") | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,56 @@ | ||
## Stubs | ||
function _recipe_init!(plt, plotattributes, args) end | ||
function _recipe_after_user!(plt, plotattributes, args) end | ||
function _recipe_after_plot!(plt, plotattributes, args) end | ||
function _recipe_after_series!(plt, plotattributes, args, series_ind) end | ||
function _recipe_after_plot!(plt, plotattributes, kw_list) end | ||
function _recipe_before_series!(plt, kw, kw_list) end | ||
function _recipe_finish!(plt, plotattributes, args) end | ||
|
||
## | ||
# Here comes the specification of when which recipe is processed. | ||
# It contains functions before and after every stage for interaction with the plotting package. | ||
|
||
function recipe_pipeline!(plt, # frontend specific representation of a plot | ||
plotattributes, # current state of recipe keywords | ||
args, # set of arguments passed by the user | ||
) | ||
_recipe_init!(plt, plotattributes, args) | ||
kw_list = _process_userrecipes(plt, plotattributes, args) | ||
_recipe_after_user!(plt, plotattributes, args) | ||
kw_list = _process_plotrecipes(plt, plotattributes, args) | ||
_recipe_after_plot!(plt, plotattributes, args) | ||
for (series_ind, series) in enumerate(series_list) | ||
kw_list = _process_seriesrecipe(plt, plotattributes) | ||
_recipe_after_series!(plt, plotattributes, series_ind) | ||
end | ||
_recipe_finish!((plt, plotattributes, args) | ||
function recipe_pipeline!(plt, # frontend specific representation of a plot | ||
plotattributes, # current state of recipe keywords | ||
args; # set of arguments passed by the user | ||
type_aliases) | ||
|
||
_recipe_init!(plt, plotattributes, args) | ||
|
||
# -------------------------------- | ||
# "USER RECIPES" | ||
# -------------------------------- | ||
|
||
kw_list = _process_userrecipes(plt, plotattributes, args) | ||
_recipe_after_user!(plt, plotattributes, args) | ||
|
||
# -------------------------------- | ||
# "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 = Dict{Symbol,Any}[] | ||
while !isempty(still_to_process) | ||
next_kw = popfirst!(still_to_process) | ||
_process_plotrecipe(plt, next_kw, kw_list, still_to_process; type_aliases=type_aliases) | ||
end | ||
|
||
_recipe_after_plot!(plt, plotattributes, 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" | ||
# -------------------------------- | ||
|
||
for kw in kw_list | ||
series_attr = _recipe_before_series!(plt, kw, kw_list) | ||
kw_list = _process_seriesrecipe(plt, series_attr) | ||
end | ||
|
||
_recipe_finish!(plt, plotattributes, args) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using RecipeUtils | ||
using RecipePipeline | ||
using Test | ||
|
||
@testset "RecipeUtils.jl" begin | ||
@testset "RecipePipeline.jl" begin | ||
# Write your own tests here. | ||
end |