more noinline
This commit is contained in:
parent
fcb9078838
commit
db685b6ee0
@ -3,11 +3,11 @@
|
|||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# preprocessing
|
# preprocessing
|
||||||
|
|
||||||
function command_idx(kw_list::AVec{KW}, kw::KW)
|
@noinline function command_idx(kw_list::AVec{KW}, kw::KW)
|
||||||
Int(kw[:series_plotindex]) - Int(kw_list[1][:series_plotindex]) + 1
|
Int(kw[:series_plotindex]) - Int(kw_list[1][:series_plotindex]) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
function _expand_seriestype_array(plotattributes::KW, args)
|
@noinline function _expand_seriestype_array(plotattributes::KW, args)
|
||||||
sts = get(plotattributes, :seriestype, :path)
|
sts = get(plotattributes, :seriestype, :path)
|
||||||
if typeof(sts) <: AbstractArray
|
if typeof(sts) <: AbstractArray
|
||||||
delete!(plotattributes, :seriestype)
|
delete!(plotattributes, :seriestype)
|
||||||
@ -132,7 +132,7 @@ function _preprocess_userrecipe(kw::KW)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function _add_errorbar_kw(kw_list::Vector{KW}, kw::KW)
|
@noinline function _add_errorbar_kw(kw_list::Vector{KW}, kw::KW)
|
||||||
# handle error bars by creating new recipedata data... these will have
|
# handle error bars by creating new recipedata data... these will have
|
||||||
# the same recipedata index as the recipedata they are copied from
|
# the same recipedata index as the recipedata they are copied from
|
||||||
for esym in (:xerror, :yerror)
|
for esym in (:xerror, :yerror)
|
||||||
@ -147,7 +147,7 @@ function _add_errorbar_kw(kw_list::Vector{KW}, kw::KW)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _add_smooth_kw(kw_list::Vector{KW}, kw::KW)
|
@noinline function _add_smooth_kw(kw_list::Vector{KW}, kw::KW)
|
||||||
# handle smoothing by adding a new series
|
# handle smoothing by adding a new series
|
||||||
if get(kw, :smooth, false)
|
if get(kw, :smooth, false)
|
||||||
x, y = kw[:x], kw[:y]
|
x, y = kw[:x], kw[:y]
|
||||||
@ -257,11 +257,11 @@ function _subplot_setup(plt::Plot{T}, plotattributes::KW, kw_list::Vector{KW}) w
|
|||||||
# Subplot/Axis attributes set by a user/series recipe apply only to the
|
# Subplot/Axis attributes set by a user/series recipe apply only to the
|
||||||
# Subplot object which they belong to.
|
# Subplot object which they belong to.
|
||||||
# TODO: allow matrices to still apply to all subplots
|
# TODO: allow matrices to still apply to all subplots
|
||||||
sp_attrs = Dict{Subplot{T},Any}()
|
sp_attrs = Dict{Any,Any}()
|
||||||
for kw in kw_list
|
for kw in kw_list
|
||||||
# get the Subplot object to which the series belongs.
|
# get the Subplot object to which the series belongs.
|
||||||
sps = get(kw, :subplot, :auto)
|
sps = get(kw, :subplot, :auto)
|
||||||
sp::Subplot{T} = get_subplot(plt, _cycle(sps == :auto ? plt.subplots : plt.subplots[sps], command_idx(kw_list,kw)))
|
sp = get_subplot(plt, _cycle(sps == :auto ? plt.subplots : plt.subplots[sps], command_idx(kw_list,kw)))
|
||||||
kw[:subplot] = sp
|
kw[:subplot] = sp
|
||||||
# extract subplot/axis attributes from kw and add to sp_attr
|
# extract subplot/axis attributes from kw and add to sp_attr
|
||||||
attr = KW()
|
attr = KW()
|
||||||
@ -326,7 +326,7 @@ end
|
|||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# series types
|
# series types
|
||||||
|
|
||||||
function _override_seriestype_check(plotattributes::KW, st::Symbol)
|
@noinline function _override_seriestype_check(plotattributes::KW, st::Symbol)
|
||||||
# do we want to override the series type?
|
# do we want to override the series type?
|
||||||
if !is3d(st) && !(st in (:contour,:contour3d))
|
if !is3d(st) && !(st in (:contour,:contour3d))
|
||||||
z = plotattributes[:z]
|
z = plotattributes[:z]
|
||||||
@ -338,7 +338,7 @@ function _override_seriestype_check(plotattributes::KW, st::Symbol)
|
|||||||
st
|
st
|
||||||
end
|
end
|
||||||
|
|
||||||
function _prepare_annotations(sp::Subplot, plotattributes::KW)
|
@noinline function _prepare_annotations(sp::Subplot, plotattributes::KW)
|
||||||
# strip out series annotations (those which are based on series x/y coords)
|
# strip out series annotations (those which are based on series x/y coords)
|
||||||
# and add them to the subplot attr
|
# and add them to the subplot attr
|
||||||
sp_anns = annotations(sp[:annotations])
|
sp_anns = annotations(sp[:annotations])
|
||||||
@ -371,7 +371,7 @@ function _expand_subplot_extrema(sp::Subplot, plotattributes::KW, st::Symbol)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _add_the_series(plt, sp, plotattributes)
|
@noinline function _add_the_series(plt, sp, plotattributes)
|
||||||
warnOnUnsupported_args(plt.backend, plotattributes)
|
warnOnUnsupported_args(plt.backend, plotattributes)
|
||||||
warnOnUnsupported(plt.backend, plotattributes)
|
warnOnUnsupported(plt.backend, plotattributes)
|
||||||
series = Series(plotattributes)
|
series = Series(plotattributes)
|
||||||
|
|||||||
13
src/plot.jl
13
src/plot.jl
@ -4,13 +4,13 @@ mutable struct CurrentPlot
|
|||||||
end
|
end
|
||||||
const CURRENT_PLOT = CurrentPlot(nothing)
|
const CURRENT_PLOT = CurrentPlot(nothing)
|
||||||
|
|
||||||
isplotnull() = CURRENT_PLOT.nullableplot === nothing
|
@noinline isplotnull() = CURRENT_PLOT.nullableplot === nothing
|
||||||
|
|
||||||
"""
|
"""
|
||||||
current()
|
current()
|
||||||
Returns the Plot object for the current plot
|
Returns the Plot object for the current plot
|
||||||
"""
|
"""
|
||||||
function current()
|
@noinline function current()
|
||||||
if isplotnull()
|
if isplotnull()
|
||||||
error("No current plot/subplot")
|
error("No current plot/subplot")
|
||||||
end
|
end
|
||||||
@ -25,9 +25,9 @@ Base.string(plt::Plot) = "Plot{$(plt.backend) n=$(plt.n)}"
|
|||||||
Base.print(io::IO, plt::Plot) = print(io, string(plt))
|
Base.print(io::IO, plt::Plot) = print(io, string(plt))
|
||||||
Base.show(io::IO, plt::Plot) = print(io, string(plt))
|
Base.show(io::IO, plt::Plot) = print(io, string(plt))
|
||||||
|
|
||||||
getplot(plt::Plot) = plt
|
@noinline getplot(plt::Plot) = plt
|
||||||
getattr(plt::Plot, idx::Int = 1) = plt.attr
|
@noinline getattr(plt::Plot, idx::Int = 1) = plt.attr
|
||||||
convertSeriesIndex(plt::Plot, n::Int) = n
|
@noinline convertSeriesIndex(plt::Plot, n::Int) = n
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ function _plot!(plt::Plot{T}, plotattributes::KW, args::Vector{Any}) where {T}
|
|||||||
|
|
||||||
# 6 seconds
|
# 6 seconds
|
||||||
_subplot_setup(plt, plotattributes, kw_list)
|
_subplot_setup(plt, plotattributes, kw_list)
|
||||||
|
#=
|
||||||
# !!! note: At this point, kw_list is fully decomposed into individual series... one KW per series. !!!
|
# !!! 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 !!!
|
# !!! The next step is to recursively apply series recipes until the backend supports that series type !!!
|
||||||
|
|
||||||
@ -246,6 +246,7 @@ function _plot!(plt::Plot{T}, plotattributes::KW, args::Vector{Any}) where {T}
|
|||||||
# end
|
# end
|
||||||
_do_plot_show(plt, plt[:show])
|
_do_plot_show(plt, plt[:show])
|
||||||
plt
|
plt
|
||||||
|
=#
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user