Ticket #1613 (closed enhancement: duplicate)
interactive manipulation of variables using AJAX in notebook
| Reported by: | schilly | Owned by: | boothby |
|---|---|---|---|
| Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | notebook | Keywords: | |
| Cc: | jason-sage@… | Author(s): | |
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description
Like the "Manipulate" function in Mathematica, SAGE could include a similar feature using AJAX.
The idea is, to introduce a widget (slider, drop down, boolean button, list of option-buttons,...) that changes the value of a variable interactively. is a new value set, the cell is evaluated and the new result is shown.
my idea for the syntax: every time the input field has a manipulate function, a variable assignment is done before the expression is evaluated.
example: manipulate(plot(sin(n*x),x),{'n':range(-3,3)})
where n is chosen from the range of integers between -3 and 3. (syntax is only an example, could be better, but an associative array seems applicable. (just manipulate(expr, var, range, var2, range) should work, too)
the manipulate should also work appended: expression.manipulate(var,range,...)
the server sends suitable html code back, which could consist of a lightweight horizontal slider for each variable, which does appropriate rounding to integers (or smaller/larger intervals) and everytime a mouse-up event is issued, the cell is reevaluated with the new variable assignment.
note: mathematica goes a step further using dynamic elements, which update throughout the entire notebook after a new assignment is done. this is more complicated, since there must be a mechanism to register a cell in a client/observer manner. this could be addressed later... (and of course, issues of looping...)
