Ask Your Question
1

arrange sage interact input elements

asked 12 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
4

answered 12 years ago

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.

Preview: (hide)
link

Comments

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

kcrisman gravatar imagekcrisman ( 12 years ago )

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: 12 years ago

Seen: 937 times

Last updated: Apr 30 '12