Cloud Notebooks

Jan Poeschko & John Pacey,
Wolfram Research

Join the Conversation #WolframTechConf

A core technology in the Wolfram Cloud

A type of deployment

Cloud notebooks are a type of thing you can deploy in the cloud. But they are not the only type of deployment:

FormFunction allows you to easily create web forms.

APIFunction gives you full control over lower-level server programming.

ScheduledTask allows you to define repeatedly executed tasks.

…

A way to deploy other things into the cloud

Cloud notebooks are a way to deploy things into the cloud. But they are not the only way:

Desktop Mathematica can also connect to the cloud.

A way to work just like in Mathematica

Cloud notebooks allow you to do computations just like in desktop Mathematica.

Notebook interface

Integrate[1/(1-x^10),x]

Button["Click Here",Print[10!]]

Graphics – 2D

Graphics[{Thick,Green,Rectangle[{0,-1},{2,1}],Red,Disk[],Blue,Circle[{2,0}],Yellow,Polygon[{{2,0},{4,1},{4,-1}}],Purple,Arrowheads[Large],Arrow[{{4,3/2},{0,3/2},{0,0}}],Black,Dashed,Line[{{-1,0},{4,0}}]}]

Plot[Evaluate[Table[BesselJ[n,x],{n,4}]],{x,0,10},Filling->Axis]

GraphPlot[Table[i->Mod[i^2,102],{i,0,102}]]

ReliefPlot[Table[i+Sin[i^2+j^2],{i,-4,4,.03},{j,-4,4,.03}],ColorFunction->"SunsetColors"]

Plot[Evaluate[Table[BesselJ[n,x],{n,4}]],{x,0,10},Filling->Axis]

Graphics – 3D

Graphics3D[{Blue,Cylinder[],Red,Sphere[{0,0,2}],Black,Thick,Dashed,Line[{{-2,0,2},{2,0,2},{0,0,4},{-2,0,2}}],Yellow,Polygon[{{-3,-3,-2},{-3,3,-2},{3,3,-2},{3,-3,-2}}],Green,Opacity[.3],Cuboid[{-2,-2,-2},{2,2,-1}]}]

Plot3D[Sin[x+y^2],{x,-3,3},{y,-2,2}]

ChemicalData["Caffeine","MoleculePlot"]

Manipulate

Manipulate[Plot[Sin[a x+b],{x,0,6}],{{a,2,"Multiplier"},1,4},{{b,0,"Phase Parameter"},0,10}]

Manipulate[Column[{PolyhedronData[g],PolyhedronData[g,p]}],{g,PolyhedronData[All]},{p,Complement@@PolyhedronData/@{"Properties","Classes"}}]

A={{-1.1,0.9},{-1.4,0.3}};
Manipulate[ParametricPlot[Evaluate[MatrixExp[A t,#]&/@pt],{t,0,10},PlotRange->5],{{pt,{{2,0},{0,1},{-3,0}}},Locator}]

Animate[Plot[t((x^2)-1)+(1-t)(-(x^2)),{x,-1,1},Axes->False,Epilog->{Circle[{0,1},3],Disk[{1,2},.3],Disk[{-1,2},.3],Line[{{0,0.6},{0,1.6}}]},PlotRange->{{-3,4},{-3,4}},AspectRatio->1],{t,0,1},AnimationRunning->False]

Dynamic

Dynamic[something]

something=(20+16)!

Infinite self-updating

Dynamic[CurrentImage[]]

loopsiloop=0;Dynamic[loopsiloop++]

New features

Multiple undo & redo (primitive)

only cell additions, deletions, and edits are part of the undo history

evaluations, style changes, etc. are not part of the history

New features

Copy & paste

Graphics[Disk[]]

New features

Shortcuts to enter lists

New features

Notebook dialogs

Input[]

CreateDialog[{TextCell["Click OK to close"],DefaultButton[]}];

Under the hood

new approach to how notebook elements (cells and boxes) are implemented

general framework to define encapsulated components

lifecycle of components follows from their render method

similar to React, but allows for more custom control (e.g., custom absolute positioning of elements)

More functional, less imperative – much like the Wolfram Language itself!

Pre-rendering

non-interactive “HTML cache” for faster initial view of notebooks

generated whenever editing (and closing) or uploading a notebook

Graphics loading

a placeholder at the approximate size of a graphic is shown while fetching helper data from the server

evaluation indicator to show when the client is requesting graphics helper data

Graphics3D[Cuboid[],ImageSize->Tiny]

Plot3D[Sin[x+y^2],{x,-3,3},{y,-2,2}]

Deploying notebooks to the cloud

CloudDeploy[Manipulate[x,{x,0,1}]]

SetPermissions[%,All->{"Read","Interact"}]

filename=FileNameJoin[{$InstallationDirectory,"Documentation","English","System","ExampleData","document.nb"}]

CopyFile[filename,CloudObject["test/notebook.nb"]]

JavaScript Notebook API

Demo: Inserting cells and making kernel evaluations

Demo: Controlling a DynamicModule variable

Documentation of the API

Implementation notes

Documentation of technical details and limitations

Future work

Near

spell checker

improved spanning characters and math typesetting

more complete support of box options

Far

editing of two-dimensional typesetting

live collaboration on notebooks

Thank you!

Get in touch:

jpoeschko@wolfram.com

jpacey@wolfram.com