Skip to content

Commit

Permalink
pass current_figure() or current_axis() to functions by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin committed Dec 2, 2024
1 parent c2b6f1a commit 3c8e7c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MakieExtra"
uuid = "54e234d5-9986-40d8-815f-a5e42de435f6"
authors = ["Alexander Plavin <[email protected]>"]
version = "0.1.37"
version = "0.1.38"

[deps]
AccessorsExtra = "33016aad-b69d-45be-9359-82a41f556fd4"
Expand Down
12 changes: 12 additions & 0 deletions src/MakieExtra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ function obsmap(x::Observable, xvals, res::Observable)
end


# https://github.com/MakieOrg/Makie.jl/pull/4519
Makie.resize_to_layout!() = resize_to_layout!(current_figure())
Makie.xautolimits() = xautolimits(current_axis())
Makie.yautolimits() = yautolimits(current_axis())
Makie.hidexdecorations!(; kwargs...) = hidexdecorations!(current_axis(); kwargs...)
Makie.hideydecorations!(; kwargs...) = hideydecorations!(current_axis(); kwargs...)
Makie.hidedecorations!(; kwargs...) = hidedecorations!(current_axis(); kwargs...)
Makie.hidespines!(spines::Symbol...) = hidespines!(current_axis(), spines...)
Makie.tight_xticklabel_spacing!() = tight_xticklabel_spacing!(current_axis())
Makie.tight_yticklabel_spacing!() = tight_yticklabel_spacing!(current_axis())
Makie.tight_ticklabel_spacing!() = tight_ticklabel_spacing!(current_axis())

# XXX: should upstream all of these!

_which_to_ix(which::Integer) = which == -1 ? 1 : which == 1 ? 2 : error("which must be -1 or 1, got $which")
Expand Down

0 comments on commit 3c8e7c2

Please sign in to comment.