I'm trying to create a matrix calculator and graph tools for our website and was wondering if there is a way to create Wolfram API or Widgets based on a Mathematica notebook.

  • $\begingroup$ Take a look at webMathematica. $\endgroup$ – Szabolcs Mar 22 '13 at 0:46
  • $\begingroup$ Wolfram|Alpha lets you develop widgets. But you'd have to define them using the Wolfram|Alpha "language"... $\endgroup$ – cormullion Mar 22 '13 at 12:33
  • $\begingroup$ To create a CDF that is embedded into a web page you could use (Mma version 9) the File / CDF Export / Web Embeddable... menu item. The online documentation is here. $\endgroup$ – Stephen Luttrell Mar 22 '13 at 19:01
  • $\begingroup$ probably with the future online.wolfram.com $\endgroup$ – P. Fonseca Mar 28 '13 at 7:58

webMathematica is one option, but I think CDF would be the easiest way to do this. Check out http://education.wolfram.com/ and http://demonstrations.wolfram.com/ for examples. For instructions see this similar question on stackexchange How can I embed a Manipulate (or other interactive graphics) in my website using CDF?


Making a matrix calculator with the FreeCDF options will be very challenging, since data input via fields such as InputField apparently are not allowed. The following code works with PlayerPro (the enterprise edition)

Clear[r1, r2, r3];
   InputField[Dynamic[r1], String],
   InputField[Dynamic[r2], String],
   InputField[Dynamic[r3], String],
      function@(ToExpression /@ StringSplit[#, " "] & /@ {r1, r2, 
          r3}) }]
   }], {{function, Transpose}, {Transpose, Inverse, Det}}, 
 Initialization :> (r1 := "1 2 3"; r2 := "4 2 2"; r3 := "5 1 7";)]

The input fields want space separated values and there is no error checking. With the FreeCDF you will not be able to change the default values in the InputField. If you have some restrictions on your matrix, then you could substitute input fields for sliders, which would be allowed in the FreeCDF version. The interface would get very cumbersome for large matrices, however.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.