9
$\begingroup$

In 2014, Steven Wolfram deployed a live Mathematica notebook cell into a blog post in his website. I'd like to do the exact same thing, but can't for the life of me figure out how he did it.

It looked like this:

enter image description here

Notes

  • I have every tool/membership offered by Wolfram Research (including mathematica online) so I just need instructions.
  • This so called "cloud cdf" (which should probably be abandoned) is clunky and slower than a turtle, extra points for a way to increase fps.
  • Be great to speed up initial load times, right now it is ridiculously slow to load, looks like this for 10 seconds:

enter image description here

$\endgroup$
1

1 Answer 1

8
$\begingroup$
  • This so called "cloud cdf" (which should probably be abandoned) is clunky and slower than a turtle, extra points for a way to increase fps.

Only a faster internet connection can save you as almost everything has to be calculated cloud side. It may happen that what you want to calculate takes longer than the call itself but generally the connection is the bottleneck.

A possibility of some client side operations was announced at WTC 2014 (!) but not much has changed since then so I wouldn't build my business plan on that. I'm looking forward to playing with them though.

  • Be great to speed up initial load times, right now it is ridiculously slow to load, looks like this for 10 seconds:

Again, connection is the main issue. Also, the time to initialize packages that your CDF are built on, but that's probably secondary issue for more complicated examples.

  • I have every tool/membership offered by Wolfram Research (including mathematica online) so I just need instructions.

Here is a minimal example, with only an iframe included in a web page, but of course it will work as a part of a bigger one too.

As pointed by SquareOne, you can use EmbedCode to create an iframe or use CloudDeploy, take the link to the CloudObject and do what you want.

code = EmbedCode[
  CloudDeploy[
   Manipulate[  Plot[Sin[n x], {x, 0, 2 Pi}],  {n, 1, 10, 1}  ],
   Permissions -> "Public"
   ]
  ]

path = FileNameJoin[{$HomeDirectory, "Desktop", "test.html"}];

Export[
 path, 
 code[[1]]["CodeSection", "Content"],
 "Text"
]

SystemOpen @ path

enter image description here

$\endgroup$
2
  • $\begingroup$ I would give you +10, if you were able to have the interaction directly in your stackexchange answer :-) $\endgroup$
    – P. Fonseca
    Apr 20, 2016 at 10:26
  • $\begingroup$ @P.Fonseca Unfortunately: Allowed HTML Tags :) $\endgroup$
    – Kuba
    Apr 20, 2016 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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