WLJS LogoWLJS Notebook

Mini apps

Turn a WLJS notebook into a standalone mini app with a dedicated window, automatic initialization, and interactive Wolfram Language interfaces.

This export option converts a notebook into a window application that uses WLJS as a runtime and works in an isolated context.

Call Share from the top menu or click the icon and choose Mini app:

Share
Mini app

Use cases

  • Calculators and utilities
  • Useful tools for processing data with a GUI
  • Share your notebook in the form of a small app
  • Share your notebook as a web app in your network (if WLJS is run on a server)

All initialization cells of the notebook are evaluated on startup, and the last input cell becomes the main window of the app.

Use WLX cells for maximum customization
You can create new windows with CellPrint

How to Prepare a Mini App

In general, you can think of a mini app as if it were an output of a single cell projected (see Project feature) to a window. The following rules apply:

  • The default context ($Context) of all symbols is randomly generated and will be unique for each running instance of your app
  • All initialization cells will be executed automatically on the startup of an app
  • The output of the last input cell will be the first window of your app
  • An app will pick the first available computation kernel in your system

Apart from that, the program for the widget is just a plain WLJS notebook. You can leave cells there for testing and debugging with no impact.

Example 1

Let's write the simplest possible interactive widget:


(* make it initialization cell *)
equation[x_,n_] := Sum[(Sin[2[Pi](2j - 1) x])/(2j - 1), {j, 1, n}];
Widget = ManipulatePlot[equation[x,n]//Re, {x, -1,1}, {n, 1,10,1}];

Widget

Then export it as Mini app and double-click the created file. You can open it anytime on any machine with WLJS Notebook installed.

How to write useful apps with Wolfram & WLJS, or swimming against the stream

A practical guide to building and deploying research applications with Wolfram Language and WLJS, covering interactive interfaces, asynchronous programming, physics, classical light-matter interaction, data import and export, and a complete Lorentz-oscillator fitting app.

On this page