JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
337 stars 63 forks source link

[meta-issue] State of examples #137

Open randyzwitch opened 8 years ago

randyzwitch commented 8 years ago

Running on 0.4.6 on OSX, I found the following:

So not bad, can fix up latex.jl and mc.jl pretty quickly I'd think. Minesweeper doesn't lay out grid for me, it makes everything as rows (though the rows are interactive to spaces away from a mine)

shashi commented 8 years ago

Randy thanks for making this!

minesweeper.jl, is related to #122

shashi commented 8 years ago

I should add that I intended the current examples to be replaced by #67 . I haven't worked on it in a while

randyzwitch commented 8 years ago

Was going to hassle you about that, it's got merge conflicts ;)

On Apr 13, 2016, at 10:31 AM, Shashi Gowda notifications@github.com wrote:

I should add that I intended the current examples to be replaced by #67 . I haven't worked on it in a while

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

shashi commented 8 years ago

There you go, I moved the non-doc commits which were causing the conflict to a new drawer-panel branch

shashi commented 8 years ago

(I'm merging master and fixing things up now)

shashi commented 8 years ago

Okay I have updated content.jl and graphics.jl which are the files that currently exist. You can hit ctrl+enter on any code cell to execute it.

zznop commented 8 years ago

@shashi @randyzwitch any idea what is causing mc.jl to not work correctly? I have an app that uses a similar abstraction that exhibits the same behaviour. Sometimes the button fires and sometimes not. I noticed that it started acting this way around the time Reactive.jl v0.3 was tagged which deprecated Input() and lift() - not sure if there's any relation. I've tar'd up the last METADATA.jl that mc.jl worked with and it appears Reactive.jl was at version 0.2.4.

This issue seems hard to pin down because it appears the button fires, but it gets held up once it hits the Reactive function calls - and if you refresh - sometimes the simulation will execute. Perhaps there was a breaking change from Reactive 0.2.4 to 0.3.0 (or maybe it's a Compose or Interact issue). It's almost as if Julia is still compiling the app while the UI is already being rendered. Sometimes if you wait after clicking the button for 30+ seconds I've seen it execute.

zznop commented 8 years ago

For what it's worth: the issue seems to be around line 54:

result = map(sampleon(btn, N); typ=Any, init=nothing) do n
    # doesn't reach this point when the simulation doesn't fire
    # despite the browser dev tools showing that the button is detected as clicked
    println("fire!")
    run_simulate(n, running, current_approx)
end

Although again - it's a Heisenbug in that if you refresh repeatedly the simulation runs on occasion - which leads me to believe it's something with compilation

shashi commented 8 years ago

Reactive 0.3+ uses channels, so the updates are asynchronous - so if you do a push! and immediately start doing some computation, Reactive does not get any time to continue with the update propagation. I think we need to address this in Reactive somehow.