Ask Your Question

arrange sage interact input elements

asked 2012-04-30 05:59:20 -0500

sagefan gravatar image

Is it possible to control the arrangement of the input elements like sliders or input boxes in sage interact? By default all elements are grouped below each other. Is it possible to change this arrangement in some way? For example is it possible to have 3 or 4 input boxes and sliders side by side in one row?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-04-30 11:37:03 -0500

Alex Kramer gravatar image

You should be able to accomplish this with the layout parameter to @interact. Here's one sample from the interact documentation:

@interact(layout={'top': [['a', 'b']], 'left': [['c']], 'bottom': [['d']]})
def _(a=x^2, b=(0..20), c=100, d=x+1): print a+b+c+d

Nested lists allow specification of both distinct rows of interact controls and distinct elements within each row, which is what I think you're asking about.

edit flag offensive delete link more


Aack! That is what I was actually looking for, and got confused while looking around.

kcrisman gravatar imagekcrisman ( 2012-04-30 17:01:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-04-30 05:59:20 -0500

Seen: 188 times

Last updated: Apr 30 '12