Last active
July 24, 2019 15:20
-
-
Save twavv/f0ac838addf5f4db06d56da9360275fe to your computer and use it in GitHub Desktop.
Blink.jl/Interact.jl Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Blink, Interact, Observables | |
# spinbox is a widget provided by Interact | |
lhs = spinbox(1:100) | |
rhs = spinbox(1:100) | |
# This map function is provided by Observables; | |
# It creates an observables whose value updates every time lhs or rhs change. | |
# You can use do-block syntax for a more complex formula. | |
result = map(+, lhs, rhs) | |
# hbox is a layout widget provided by Interact. | |
# This isn't the prettiest formatting but you can make it nicer or construct | |
# your own layout using WebIO DOM primitives (this is closer to web dev). | |
widget = hbox(lhs, "+", rhs, "=", result) | |
# Display the damn thing! | |
window = Window() | |
body!(window, widget) |
Author
twavv
commented
Jul 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment