Skip to content

JerryI/wolfram-js-frontend

Repository files navigation

Dynamic Notebook Environment for Wolfram Language

Preview

Made for scientists by scientists โš—๏ธ

written with love using freeware Wolfram Engine, JavaScript and WLX

Documentation & Tutorials ๐Ÿ“š

Telegram support chat ๐Ÿ’ฌ

Recommended Wolfram Engine: 13.3 or higher

Special thanks to our co-developer @KirillBelovTest (Wolfram Language HTTP/WS Stack developer)

To help maintain this project โค๏ธ

Highlights

Not a typical Jupyter-like notebook environment ๐Ÿงจ

It supports dynamics, GUI building blocks, and powerful Mathematica syntax out of the box.

alt text

alt text

No more static graphics! Each primitive of Graphics/Graphics3D was recreated from scratch using d3.js and THREE.js libraries. Most native plotting functions of Mathematica are supported.

AI Assistant ๐Ÿค–

We deeply integrated ChatGPT, so that AI can have a read/write acccess to your notebook

AAI

Command Palette and GUI-in-Code Emulation ๐ŸŽจ

Inline Dynamic Tool for Tuning 2D/3D Positions

ezgif com-optipng

Native Math Input in the Code Editor ๐Ÿงฎ

Write beautiful equations between lines of normal Wolfram Language expressions.

Mathinput-ezgif com-optipng

Compress to HTML ๐Ÿ—œ๏ธ

An entire notebook can be exported to a standalone .html file keeping all data inside. No internet dependency, no additional software is required for viewing a notebook

HTML-ezgif com-optipng

Later, once opened using WLJS Notebook application, it is unpacked back to a normal editable format.

Data-Driven Slides ๐Ÿ›

Make a presentation right from the notebook.

slides

Real-Time Interactivity โฑ๏ธ

Follows the mouse pointer and performs complex calculations.

Many More

Autocomplete

JavaScript Cells and Integration with WL

HTML Cells

Markdown Cells

Mermaid Diagrams

Offline documentation ๐Ÿฉบ

WLJS Notebook runs locally and belongs to you (no cloud-based stuff involved). No internet connection is needed.

Motivation

The idea is to implement a minimalistic but easily extendable open-source notebook interface with syntax sugar, interactive objects for the freeware Wolfram Engine.

There is no aim to fully copy Mathematica (it will never be possible), however, there are a few things that can be improved:

  • Stability and speed
  • Independence from WRI
  • Portability (not PDF) - easy to share your work with someone outside the ecosystem keeping your graphics interactive or embedded to a website
  • Event-based approach to dynamics - allow users to build complex dynamic notebooks and to have clear control over all moving parts
  • Natural bridge between other languages - HTML as markup, WL for computations, and JS for stunning visuals

Installation ๐Ÿ› ๏ธ

The freeware Wolfram Engine is required (Version 13.3 is preferable). Activation can be done later using WLJS Notebook App.

On macOS, if you have Homebrew installed, you can install it through Homebrew Cask:

brew install --cask wolfram-engine

a side note for Linux users If you face any issues, try to install avahi daemon.

Desktop App โœจ

Download from the releases section.

Again, if you have Homebrew installed, you can install this app using:

brew install --cask wljs-notebook

Standalone Server

Clone this repository and run:

wolframscript -f Scripts/start.wls

or on a specific hostname

wolframscript -f Scripts/start.wls host 0.0.0.0 http 8080 ws 8081 ws2 8082 docs 8085

that will open an HTTP server on 8080 port with 8081, 8082 used for realtime communication and docs pages at 8085

Extra arguments

  • set the home folder (overrides settings)
wolframscript -f Scripts/start.wls folder "Demos"
  • disable autolaunch of the evaluation kernel
wolframscript -f Scripts/start.wls noautolaunch True
  • disable autotest
wolframscript -f Scripts/start.wls bypasstest True

A side note for servers with no desktop interface

You might need to install the following (for Image and some other graphics to work properly) libraries.

Shortcuts ๐ŸŽฌ

working in both: browser and desktop application

UI

  • Ctrl+S, Cmd+S save notebook
  • Alt+., Cmd+. abort evaluation
  • Ctrl+P, Cmd+P open command palette
  • Shift+Enter evaluate current cell

Cells

  • Ctrl+W, Cmd+2 hide/show input cell
  • Ctrl+/ make fraction on selected
  • Ctrl+6 make superscript on selected
  • Ctrl+2 make square root on selected
  • Ctrl+- make subscript on selected

Package System

The frontend uses its own package/plugin system. It doesn't require any software installed except wolframscript. Precompiled plugins are downloaded using URLFetch from GitHub repositories and imported to the system.

Sponsors

@MitsuhaMiyamizu ๐Ÿค

Technology Stack

Wolfram Language, JavaScript

Inspired By

  • Wolfram Mathematica
  • Jupyter Notebook
  • Observable
  • Wolfram Language Notebook VSCode
  • Mathics

License

GNU GPLv3