ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 01 May 2012 00:01:48 +0200arrange sage interact input elementshttps://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/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?Mon, 30 Apr 2012 12:59:20 +0200https://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/Answer by Alex Kramer for <p>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?</p>
https://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/?answer=13513#post-id-13513You 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.Mon, 30 Apr 2012 18:37:03 +0200https://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/?answer=13513#post-id-13513Comment by kcrisman for <p>You should be able to accomplish this with the layout parameter to @interact. Here's one sample from the interact documentation:</p>
<pre><code>@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
</code></pre>
<p>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.</p>
https://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/?comment=19846#post-id-19846Aack! That is what I was actually looking for, and got confused while looking around.Tue, 01 May 2012 00:01:48 +0200https://ask.sagemath.org/question/8939/arrange-sage-interact-input-elements/?comment=19846#post-id-19846