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

Change option value within @manipulate? #85

Open
cbecker opened this issue Oct 14, 2015 · 2 comments
Open

Change option value within @manipulate? #85

cbecker opened this issue Oct 14, 2015 · 2 comments

Comments

@cbecker
Copy link

cbecker commented Oct 14, 2015

I am not sure this is possible, but is there a way to change the value of an option within a @manipulate loop? For example, consider

using PyPlot
f = figure()
@manipulate for is_synapse=[true,false,None],i=1:10 withfig(f) do
        display( is_synapse)
    end
end

What I want is that the user goes from i=1...10 and chooses one of the options, but when the user changes the slider value, the option is_synapse gets updated, according to an internal list, such as:

using PyPlot
f = figure()
@manipulate for is_synapse=[true,false,None],i=1:10 withfig(f) do
        if i changed because of user
                is_synapse = value from cache
        else if is_synapse changed because of user
                value from cache = is_synapse
        end
    end
end

Any hints are welcome, thanks for this great package!

@ghost
Copy link

ghost commented Nov 20, 2015

I think it's related enough that it doesn't warrant a new issue: is there any way of setting the default value of a slider while using manipulate?

@shashi shashi closed this as completed in 0cc46c6 Jan 20, 2016
@shashi shashi reopened this Jan 20, 2016
@shashi
Copy link
Member

shashi commented Aug 25, 2016

there is a way of setting the default value:

@manipulate for i=slider(1:10, value=3)
   i
end

however I think the original question is making the default value of some widget depend on the current value of a slider.

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