Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@bind gives index instead of value #1638

Closed
chunjiw opened this issue Nov 4, 2021 · 3 comments
Closed

@bind gives index instead of value #1638

chunjiw opened this issue Nov 4, 2021 · 3 comments

Comments

@chunjiw
Copy link

chunjiw commented Nov 4, 2021

image

But miraculously, if I wrap it in a Markdown string then it is correct:

image

@chunjiw
Copy link
Author

chunjiw commented Nov 4, 2021

I also occasionally get this error in the terminal, but cannot reproduce it consistently:

┌ Error: AbstractPlutoDingetjes: Bond value transformation errored.
│   exception =
│    ArgumentError: invalid index: 7.4 of type Float64
│    Stacktrace:
│      [1] to_index(i::Float64)
│        @ Base ./indices.jl:300
│      [2] to_index(A::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, i::Float64)
│        @ Base ./indices.jl:277
│      [3] to_indices
│        @ ./indices.jl:333 [inlined]
│      [4] to_indices
│        @ ./indices.jl:325 [inlined]
│      [5] getindex(A::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, I::Float64)
│        @ Base ./abstractarray.jl:1170
│      [6] transform_value(slider::PlutoUI.BuiltinsNotebook.Slider{Float64}, val_from_js::Float64)
│        @ PlutoUI.BuiltinsNotebook ~/.julia/packages/PlutoUI/5FbWl/src/Builtins.jl:186
│      [7] transform_bond_value(s::Symbol, value_from_js::Float64)
│        @ Main.PlutoRunner ~/.julia/packages/Pluto/OxjgN/src/runner/PlutoRunner.jl:1433
│      [8] top-level scope
│        @ none:1
│      [9] eval(m::Module, e::Any)
│        @ Core ./boot.jl:360
│     [10] top-level scope
│        @ none:1
│     [11] eval(m::Module, e::Any)
│        @ Core ./boot.jl:360
│     [12] (::Distributed.var"#103#104"{Distributed.CallMsg{:call}})()
│        @ Distributed /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:274
│     [13] run_work_thunk(thunk::Distributed.var"#103#104"{Distributed.CallMsg{:call}}, print_error::Bool)
│        @ Distributed /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:63
│     [14] run_work_thunk(rv::Distributed.RemoteValue, thunk::Function)
│        @ Distributed /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:72
│     [15] (::Distributed.var"#96#98"{Distributed.RemoteValue, Distributed.var"#103#104"{Distributed.CallMsg{:call}}})()
│        @ Distributed ./task.jl:411
└ @ Main.PlutoRunner ~/.julia/packages/Pluto/OxjgN/src/runner/PlutoRunner.jl:1435

@disberd
Copy link
Contributor

disberd commented Nov 5, 2021

I can't seem to reproduce your MWE, in a fresh notebook on the latest version of Pluto it gives me the correct value:

image

I am using Chrome on Windows with Julia 1.7-rc2

@chunjiw
Copy link
Author

chunjiw commented Nov 6, 2021

I also cannot reproduce on another machine... I will reopen if I can reproduce it. Thanks!

@chunjiw chunjiw closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants