-
-
Notifications
You must be signed in to change notification settings - Fork 290
/
MakieLayout.jl
137 lines (125 loc) · 3.96 KB
/
MakieLayout.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
module MakieLayout
using ..Makie
using ..Makie: Rect2
import ..Makie: Rect2i
using ..Makie.Keyboard
using ..Makie.Mouse
using ..Makie: ispressed, is_mouseinside, get_scene, FigureLike
using ..Makie: Consume
using ..Makie: OpenInterval, Interval
using MakieCore
using MakieCore: Automatic, automatic
using Observables: onany
import Observables
import Formatting
using Match
import Animations
import PlotUtils
using GridLayoutBase
using GridLayoutBase: GridSubposition
import Showoff
using Colors
const FPS = Node(30)
const COLOR_ACCENT = Ref(RGBf(((79, 122, 214) ./ 255)...))
const COLOR_ACCENT_DIMMED = Ref(RGBf(((174, 192, 230) ./ 255)...))
# Make GridLayoutBase default row and colgaps themeable when using MakieLayout
# This mutates module-level state so it could mess up other libraries using
# GridLayoutBase at the same time as MakieLayout, which is unlikely, though
function __init__()
GridLayoutBase.DEFAULT_COLGAP_GETTER[] = function()
ct = Makie.current_default_theme()
if haskey(ct, :colgap)
ct[:colgap][]
else
GridLayoutBase.DEFAULT_COLGAP[]
end
end
GridLayoutBase.DEFAULT_ROWGAP_GETTER[] = function()
ct = Makie.current_default_theme()
if haskey(ct, :rowgap)
ct[:rowgap][]
else
GridLayoutBase.DEFAULT_ROWGAP[]
end
end
end
include("layoutables.jl")
include("geometrybasics_extension.jl")
include("mousestatemachine.jl")
include("types.jl")
include("helpers.jl")
include("ticklocators/linear.jl")
include("ticklocators/wilkinson.jl")
include("defaultattributes.jl")
include("lineaxis.jl")
include("interactions.jl")
include("layoutables/axis.jl")
include("layoutables/axis3d.jl")
include("layoutables/colorbar.jl")
include("layoutables/label.jl")
include("layoutables/slider.jl")
include("layoutables/intervalslider.jl")
include("layoutables/button.jl")
include("layoutables/box.jl")
include("layoutables/toggle.jl")
include("layoutables/legend.jl")
include("layoutables/scene.jl")
include("layoutables/menu.jl")
include("layoutables/textbox.jl")
export Axis
export Axis3
export Slider
export IntervalSlider
export Button
export Colorbar
export Label
export Box
export Toggle
export Legend, axislegend
export LegendEntry, MarkerElement, PolyElement, LineElement, LegendElement
export LScene
export Menu
export Textbox
export linkxaxes!, linkyaxes!, linkaxes!
export AxisAspect, DataAspect
export autolimits!, limits!, reset_limits!
export LinearTicks, WilkinsonTicks, MultiplesTicks, IntervalsBetween, LogTicks
export hidexdecorations!, hideydecorations!, hidedecorations!, hidespines!
export tight_xticklabel_spacing!, tight_yticklabel_spacing!, tight_ticklabel_spacing!, tightlimits!
export layoutscene
export set_close_to!
export labelslider!, labelslidergrid!
export addmouseevents!
export interactions, register_interaction!, deregister_interaction!, activate_interaction!, deactivate_interaction!
export MouseEventTypes, MouseEvent, ScrollEvent, KeysEvent
export hlines!, vlines!, abline!, hspan!, vspan!
export Cycle
# from GridLayoutBase
export GridLayout, GridPosition, GridSubposition
export GridLayoutSpec
export BBox
export LayoutObservables
export Inside, Outside, Mixed
export Fixed, Auto, Relative, Aspect
export width, height, top, bottom, left, right
export with_updates_suspended
export trim!
# these might conflict with other packages and are not used that often
# insertcols! does already conflict with DataFrames
# export appendcols!, appendrows!, prependcols!, prependrows!, deletecol!, deleterow!, insertrows!, insertcols!
export gridnest!
export AxisAspect, DataAspect
export colsize!, rowsize!, colgap!, rowgap!
export Left, Right, Top, Bottom, TopLeft, BottomLeft, TopRight, BottomRight
# hbox and vbox shadow Makie functions
const hgrid! = GridLayoutBase.hbox!
const vgrid! = GridLayoutBase.vbox!
export grid!, hgrid!, vgrid!
export swap!
export ncols, nrows
export contents, content
if Base.VERSION >= v"1.4.2"
include("precompile.jl")
_precompile_()
end
end # module