| 1 | initial version |
Since this functionality has yet to appear explicitly, one solution is to nest interacts. Here's a slider that depends on a slider (live example):
@interact
def _( n=slider(1,10) ):
@interact
def _( m=slider(0,n,default=n/2) ):
show( 'n=', n )
show( 'm=', m )
And here's a slider that depends on an input box as per the original question (live example):
@interact
def _( n=input_box(10) ):
@interact
def _( m=slider(0,n,default=n/2) ):
show( 'n=', n )
show( 'm=', m )
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.