Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Interact depending on other arguments

Hello,

Is it possible to have interact arguments depend on one another? For example, having the maximum of one slider depend on the former? I tried this:

@interact
def metacontrol(a=slider(5,10)):
    @interact
    def control(b=slider(0, a)):
        pass

But it doesn't work; updating the first slider deletes the second slider. It is possible with two cells, but this requires executing the cell which defeats the purpose of interact.

Thank you.

click to hide/show revision 2
retagged

Interact depending on other arguments

Hello,

Is it possible to have interact arguments depend on one another? For example, having the maximum of one slider depend on the former? I tried this:

@interact
def metacontrol(a=slider(5,10)):
    @interact
    def control(b=slider(0, a)):
        pass

But it doesn't work; updating the first slider deletes the second slider. It is possible with two cells, but this requires executing the cell which defeats the purpose of interact.

Thank you.