Skip to content
This repository was archived by the owner on Jul 13, 2021. It is now read-only.

Commit c5937f0

Browse files
committed
Merge branch 'master' of github.com:JuliaPlots/AbstractPlotting.jl
2 parents faa7a02 + fb3d2ad commit c5937f0

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

src/AbstractPlotting.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export textslider
129129

130130
# gui
131131
export slider, button, playbutton
132+
export move!
132133

133134
# Raymarching algorithms
134135
export RaymarchAlgorithm, IsoValue, Absorption, MaximumIntensityProjection, AbsorptionRGBA, IndexedAbsorptionRGBA

src/camera/camera2d.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ struct Camera2D <: AbstractCamera
22
area::Node{FRect2D}
33
zoomspeed::Node{Float32}
44
zoombutton::Node{ButtonTypes}
5-
panbutton::Node{ButtonTypes}
5+
panbutton::Node{Union{ButtonTypes, Vector{ButtonTypes}}}
66
padding::Node{Float32}
77
last_area::Node{Vec{2, Int}}
88
update_limits::Node{Bool}
@@ -19,7 +19,7 @@ function cam2d!(scene::SceneLike; kw_args...)
1919
area = node(:area, FRect(0, 0, 1, 1)),
2020
zoomspeed = 0.10f0,
2121
zoombutton = nothing,
22-
panbutton = Mouse.left,
22+
panbutton = Mouse.right,
2323
selectionbutton = (Keyboard.space, Mouse.left),
2424
padding = 0.001,
2525
last_area = Vec(size(scene)),

src/interaction/gui.jl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ julia> -5:5 .|> exp .|> sig_printer
3030
sig_printer(v::Real) = @sprintf "%0.2e" v
3131

3232
"""
33-
Slider
33+
slider(range; kwargs...)
3434
35-
TODO add function signatures
36-
TODO add description
35+
Creates a slider which slides through the selected range; sliders are discrete.
36+
The Slider's value can be accessed through its `value` field. For example:
37+
38+
```julia
39+
scene = slider(1:10)
40+
lift(scene[end].value) do val
41+
# your function here
42+
end
43+
```
3744
3845
## Theme
3946
$(ATTRIBUTES)
@@ -166,13 +173,20 @@ function move!(x::Slider, idx::Integer)
166173
return
167174
end
168175

169-
export move!
170-
171176
"""
172-
Button
177+
button(text)
173178
174-
TODO add function signatures
175-
TODO add description
179+
Creates a button which can be clicked.
180+
On click, the button increments its `clicks` field by one.
181+
182+
For example:
183+
184+
```julia
185+
scene = button("click me please")
186+
lift(scene[end].clicks) do clicks
187+
# your function here
188+
end
189+
```
176190
177191
## Theme
178192
$(ATTRIBUTES)

0 commit comments

Comments
 (0)