#8959: interact layouts with arbitrary html
---------------------------+------------------------------------------------
Reporter: jason | Owner: itolkov, jason
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.4.2
Component: interact | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Changes (by jason):
* cc: was, timdumol (added)
Comment:
Okay, the attached patch lets you specify controls on each side, as well
as the width of the interact. The following code gives the interact in
the screenshot attached.
{{{
var('x')
@interact(layout=dict(top=[['f'],['r','plot_points']],
bottom=[['color','thickness'],['adaptive_recursion','adaptive_tolerance']],
left=[['gridlines'],['fill'],['frame'],['axes']], right=[['linestyle']]))
def
plot_example(f=sin(x^2),r=range_slider(-5,5,step_size=1/4,default=(-3,3)),
color=color_selector(widget='colorpicker'),
thickness=(3,(1..10)),
adaptive_recursion=(5,(0..10)),
adaptive_tolerance=(0.01,(0.001,1)),
plot_points=(20,(1..100)),
linestyle=['-','--','-.',':'],
gridlines=False, fill=False,
frame=False, axes=True
):
show(plot(f, (x,r[0],r[1]), color=color, thickness=thickness,
adaptive_recursion=adaptive_recursion,
adaptive_tolerance=adaptive_tolerance,
plot_points=plot_points,
linestyle=linestyle, fill=fill if fill else None),
gridlines=gridlines, frame=frame, axes=axes)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8959#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.