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

Commit

Permalink
Merge branch 'master' of github.com:JuliaPlots/AbstractPlotting.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Jul 31, 2019
2 parents faa7a02 + fb3d2ad commit c5937f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/AbstractPlotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export textslider

# gui
export slider, button, playbutton
export move!

# Raymarching algorithms
export RaymarchAlgorithm, IsoValue, Absorption, MaximumIntensityProjection, AbsorptionRGBA, IndexedAbsorptionRGBA
Expand Down
4 changes: 2 additions & 2 deletions src/camera/camera2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ struct Camera2D <: AbstractCamera
area::Node{FRect2D}
zoomspeed::Node{Float32}
zoombutton::Node{ButtonTypes}
panbutton::Node{ButtonTypes}
panbutton::Node{Union{ButtonTypes, Vector{ButtonTypes}}}
padding::Node{Float32}
last_area::Node{Vec{2, Int}}
update_limits::Node{Bool}
Expand All @@ -19,7 +19,7 @@ function cam2d!(scene::SceneLike; kw_args...)
area = node(:area, FRect(0, 0, 1, 1)),
zoomspeed = 0.10f0,
zoombutton = nothing,
panbutton = Mouse.left,
panbutton = Mouse.right,
selectionbutton = (Keyboard.space, Mouse.left),
padding = 0.001,
last_area = Vec(size(scene)),
Expand Down
30 changes: 22 additions & 8 deletions src/interaction/gui.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ julia> -5:5 .|> exp .|> sig_printer
sig_printer(v::Real) = @sprintf "%0.2e" v

"""
Slider
slider(range; kwargs...)
TODO add function signatures
TODO add description
Creates a slider which slides through the selected range; sliders are discrete.
The Slider's value can be accessed through its `value` field. For example:
```julia
scene = slider(1:10)
lift(scene[end].value) do val
# your function here
end
```
## Theme
$(ATTRIBUTES)
Expand Down Expand Up @@ -166,13 +173,20 @@ function move!(x::Slider, idx::Integer)
return
end

export move!

"""
Button
button(text)
TODO add function signatures
TODO add description
Creates a button which can be clicked.
On click, the button increments its `clicks` field by one.
For example:
```julia
scene = button("click me please")
lift(scene[end].clicks) do clicks
# your function here
end
```
## Theme
$(ATTRIBUTES)
Expand Down

0 comments on commit c5937f0

Please sign in to comment.