MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.42k stars 313 forks source link

slider example no longer working as intended? #367

Closed AshtonSBradley closed 3 years ago

AshtonSBradley commented 5 years ago

this

https://simondanisch.github.io/ReferenceImages/gallery//sliders/index.html

is now creating strange output

using AbstractPlotting

 s1 = slider(LinRange(0.01, 1, 100), raw = true, camera = campixel!, start = 0.3)
 s2 = slider(LinRange(-2pi, 2pi, 100), raw = true, camera = campixel!)
 data = lift(s2[end][:value]) do v
     map(LinRange(0, 2pi, 100)) do x
         4f0 .* Point2f0(sin(x) + (sin(x * v) .* 0.1), cos(x) + (cos(x * v) .* 0.1))
     end
 end
 p = scatter(data, markersize = s1[end][:value])

 RecordEvents(
     hbox(p, vbox(s1, s2), parent = Scene(resolution = (500, 500))),
     "output"
 )
Screen Shot 2019-06-25 at 9 30 58 PM
julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
asinghvi17 commented 5 years ago

What's the output of ]build GLMakie?

asinghvi17 commented 5 years ago

Also, what are your computer's specs?

SimonDanisch commented 5 years ago

This looks familiar, but seems fixed... Try to update GLMakie & AbstractPlotting!

AshtonSBradley commented 5 years ago

Fresh run in the REPL, after ] up; build GLMakie, and AbstractPlotting, GLMakie are both #master:

julia> using AbstractPlotting
[ Info: Recompiling stale cache file /Users/abradley/.julia/compiled/v1.1/AbstractPlotting/6fydZ.ji for AbstractPlotting [537997a7-5e4e-5d89-9595-2241ea00577e]

julia> s1 = slider(LinRange(0.01, 1, 100), raw = true, camera = campixel!, start = 0.3)
Scene (960px, 540px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
   *Slider{...}
subscenes:

julia> s2 = slider(LinRange(-2pi, 2pi, 100), raw = true, camera = campixel!)
Scene (960px, 540px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
   *Slider{...}
subscenes:

julia> data = lift(s2[end][:value]) do v
            map(LinRange(0, 2pi, 100)) do x
                4f0 .* Point2f0(sin(x) + (sin(x * v) .* 0.1), cos(x) + (cos(x * v) .* 0.1))
            end
        end
Observable{Array{Point{2,Float32},1}} with 0 listeners. Value:
Point{2,Float32}[[0.0, 4.4], [0.0983809, 4.36056], [0.220113, 4.24721], [0.384726, 4.07403], [0.60471, 3.86208], [0.8834, 3.63606], [1.2143, 3.42051], [1.58195, 3.23598], [1.96421, 3.09587], [2.3356, 3.00438]  …  [-1.77392, 3.27038], [-1.54989, 3.5591], [-1.38, 3.82374], [-1.25641, 4.04057], [-1.16297, 4.19111], [-1.07786, 4.26503], [-0.977214, 4.26164], [-0.838961, 4.19004], [-0.646478, 4.06759], [-0.391336, 3.9172]]

julia> p = scatter(data, markersize = s1[end][:value])
Scene (960px, 540px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
   *Axis2D{...}
   *Scatter{...}
subscenes:
   *scene(960px, 540px)

julia> scene = hbox(p, vbox(s1, s2), parent = Scene(resolution = (500, 500)))
Scene (500px, 500px):
events:
    window_area: GeometryTypes.HyperRectangle{2,Int64}([0, 0], [0, 0])
    window_dpi: 100.0
    window_open: false
    mousebuttons: Set(AbstractPlotting.Mouse.Button[])
    mouseposition: (0.0, 0.0)
    mousedrag: notpressed
    scroll: (0.0, 0.0)
    keyboardbuttons: Set(AbstractPlotting.Keyboard.Button[])
    unicode_input: Char[]
    dropped_files: String[]
    hasfocus: false
    entered_window: false
plots:
subscenes:
   *scene(500px, 440px)
   *scene(500px, 60px)

produces no figure, and verbose output in REPL. Is this expected?

SimonDanisch commented 5 years ago

It's expected if GLMakie doesn't build correctly

asinghvi17 commented 5 years ago

Did you do using GLMakie before running that example?

AshtonSBradley commented 5 years ago

Yes, I also rebuilt it, without error

SimonDanisch commented 5 years ago

so, using Makie; scatter(rand(4)) doesn't work for you?

AshtonSBradley commented 5 years ago

ok, updates have suppressed the verbose output, and scatter produces a figure, but I still get the giant characters

Screen Shot 2019-07-02 at 7 38 25 AM
SimonDanisch commented 5 years ago

Just run into this: grafik Might be related, since it also looks like some corruption of the text buffers... It also would match, since it happens very rarely

hs-ye commented 3 years ago

Just a heads up that this ticket can probably be closed as the interface to sliders http://makie.juliaplots.org/stable/makielayout/slider.html has totally changed as of v0.14