Skip to content

Commit

Permalink
bump RB
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Nov 30, 2022
1 parent 965d2d1 commit 9c8b780
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion RecipesBase/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RecipesBase"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
author = ["Tom Breloff (@tbreloff)"]
version = "1.3.1"
version = "1.3.2"

[deps]
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
Expand Down
54 changes: 30 additions & 24 deletions RecipesBase/src/RecipesBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,13 @@ macro recipe(funcexpr::Expr)
$cleanup_body
series_list = $RecipesBase.RecipeData[]
func_return = $func_body
func_return === nothing ||
push!(series_list, $RecipesBase.RecipeData(plotattributes, $RecipesBase.wrap_tuple(func_return)))
func_return === nothing || push!(
series_list,
$RecipesBase.RecipeData(
plotattributes,
$RecipesBase.wrap_tuple(func_return),
),
)
series_list
end |> esc,
)
Expand Down Expand Up @@ -330,13 +335,16 @@ end
```
"""
macro series(expr::Expr)
esc(quote
quote
let plotattributes = copy(plotattributes)
args = $expr
push!(series_list, $RecipesBase.RecipeData(plotattributes, $RecipesBase.wrap_tuple(args)))
push!(
series_list,
$RecipesBase.RecipeData(plotattributes, $RecipesBase.wrap_tuple(args)),
)
nothing
end
end)
end |> esc
end

# --------------------------------------------------------------------------
Expand Down Expand Up @@ -366,16 +374,16 @@ function _userplot(expr::Expr)
funcname2 = Symbol(funcname, "!")

# return a code block with the type definition and convenience plotting methods
esc(
quote
$expr
export $funcname, $funcname2
Core.@__doc__ $funcname(args...; kw...) = $RecipesBase.plot($typename(args); kw...)
Core.@__doc__ $funcname2(args...; kw...) = $RecipesBase.plot!($typename(args); kw...)
Core.@__doc__ $funcname2(plt::$RecipesBase.AbstractPlot, args...; kw...) =
$RecipesBase.plot!(plt, $typename(args); kw...)
end,
)
quote
$expr
export $funcname, $funcname2
Core.@__doc__ $funcname(args...; kw...) =
$RecipesBase.plot($typename(args); kw...)
Core.@__doc__ $funcname2(args...; kw...) =
$RecipesBase.plot!($typename(args); kw...)
Core.@__doc__ $funcname2(plt::$RecipesBase.AbstractPlot, args...; kw...) =
$RecipesBase.plot!(plt, $typename(args); kw...)
end |> esc
end

_userplot(sym::Symbol) = _userplot(:(mutable struct $sym
Expand Down Expand Up @@ -414,15 +422,13 @@ Plot my series type!
"""
macro shorthands(funcname::Symbol)
funcname2 = Symbol(funcname, "!")
esc(
quote
export $funcname, $funcname2
Core.@__doc__ $funcname(args...; kw...) =
$RecipesBase.plot(args...; kw..., seriestype = $(Meta.quot(funcname)))
Core.@__doc__ $funcname2(args...; kw...) =
$RecipesBase.plot!(args...; kw..., seriestype = $(Meta.quot(funcname)))
end,
)
quote
export $funcname, $funcname2
Core.@__doc__ $funcname(args...; kw...) =
$RecipesBase.plot(args...; kw..., seriestype = $(Meta.quot(funcname)))
Core.@__doc__ $funcname2(args...; kw...) =
$RecipesBase.plot!(args...; kw..., seriestype = $(Meta.quot(funcname)))
end |> esc
end

#----------------------------------------------------------------------------
Expand Down
9 changes: 2 additions & 7 deletions src/backends/plotly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,18 +711,13 @@ function plotly_series(plt::Plot, series::Series)
[merge(plotattributes_out, series[:extra_kwargs])]
end


function plotly_colorbar(sp::Subplot)
_, y_domain = plotly_domain(sp)
plot_attribute = KW(
:title => sp[:colorbar_title],
:y => mean(y_domain),
:len => diff(y_domain)[1]
)
plot_attribute =
KW(:title => sp[:colorbar_title], :y => mean(y_domain), :len => diff(y_domain)[1])
return plot_attribute
end


function plotly_series_shapes(plt::Plot, series::Series, clims)
segments = series_segments(series; check = true)
plotattributes_outs = map(i -> KW(), 1:length(segments))
Expand Down

0 comments on commit 9c8b780

Please sign in to comment.