Ask Your Question
1

arrange sage interact input elements

asked 2012-04-30 12:59:20 +0100

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
4

answered 2012-04-30 18:37:03 +0100

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

Comments

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

kcrisman gravatar imagekcrisman ( 2012-05-01 00:01:48 +0100 )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

Stats

Asked: 2012-04-30 12:59:20 +0100

Seen: 822 times

Last updated: Apr 30 '12