Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@interact produces html output instead of interactive diagram

I tried to make an interactive diagram by placing @interact before the myplot function:

def myplot(f=(c_repulsion / (epsilon + abs(d))^2) * ((d) / abs(d))):
    show(plot(f, (d,-10, 10)))

much like it's described in the tutorials.

But the output looks literally like this:

<html><!--notruncate-->
        <div padding=6 id="div-interact-0">
          <table width=800px height=20px bgcolor="#c5c5c5" cellpadding=15>
            <tr>
              <td bgcolor="#f9f9f9" valign=top align=left>
            <table>
              <tr><td colspan=3><table><tr><td align=right><font color="black">f&nbsp;</font></td><td><input type="text" value="100*d/((abs(d) +
0.00100000000000000)^2*abs(d))" size=80 onchange="interact(0, {variable: 'f', adapt_number: 1, value: encode64(this.value)}, 1)"></input></td> </tr></table></td></tr>
              <tr><td></td><td style='width: 100%;'>
        <div id="cell-interact-0"><?__SAGE__START>
          <table border=0 bgcolor="white" width=100%>
            <tr>
              <td bgcolor="white" align=left valign=top>
                <pre><?__SAGE__TEXT></pre>
              </td>
            </tr>
            <tr>
              <td align=left valign=top><?__SAGE__HTML></td>
            </tr>
          </table><?__SAGE__END>
        </div></td><td></td></tr>
              <tr><td colspan=3></td></tr>
            </table></td>
            </tr>
          </table>
        </div></html>