Skip to content

C4v1nc3mpT/wolfram-js-frontend

 
 

Repository files navigation

Freeware Wolfram Language Notebook

demo2

written for the freeware Wolfram Engine using webstack with vanilla Javascript

Documentation & Tutorials

Telegram support chat

Recommended Wolfram Engine: 13.0.1

Special thanks to @KirillBelovTest (Wolfram Language HTTP Server developer)

To help maintain this project

Highlights

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

  • Autocomplete for user's defined symbols

  • Screenshot 2023-10-26 at 13 53 31

  • Math in code, equation support, various decorations, syntax sugar for dates, colors...

  • Screenshot 2023-10-26 at 13 57 15

  • Full dynamics evaluation support. GUI building blocks are also included

  • ezgif com-video-to-gif-6

  • Native integration of HTML, Markdown, Javascript, OpenAI GPT assistant ... cells. Possibillity of usage multiple languages within one notebook

  • Export to a standalone .html file feature (keeps some part of interactivity still possible)

  • Extensibility using external JS libraries, WL plugins

  • Markdown-based data-driven slides

  • slides

  • 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, opensource lightweight notebook interface with syntax sugar, interactive objects for freeware Wolfram Engine.

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

  • stabillity and speed
  • independency from WRI
  • portabillity (not PDF) - easy to share you work with someone outside the ecosystem keeping you graphics interactive or embeb on a website
  • event-based approach to dynamics - allow user to build complex dynamic notebooks and to have a clear control over all moving parts
  • natural bridge between other languages - use HTML as a markup, WL for computations, and JS for stunning visuals

How to run

This is quite simple. All that you need is

the rest will be downloaded via the internet.

Desktop app

Use prebuilt binaries from Releases section

Standalone server

Clone this repository and run

wolframscript -f Scripts/run.wls

A message with a local address http://xxxx:xxxx will appear in the console. Open this address in your browser

Package system

Frontend uses its own package/plugin system. It doent require any software installed except wolframscript. Precompiled plugins are downloaded using URLFetch from github repositories and imported to the system. They can extend core or UI or standard library. The following packages are available (already included as default plugins and will be downloaded automatically)

  • wljs-interpreter - WL interpreter written in JS is a core component, that controls UI, draw graphics, manage states (bridges WL and WEB). Can be used as a standalone library for building web apps
  • wljs-editor - cells editor based on CodeMirror 6
  • wljs-inputs - io library that provides sliders, textboxes for buuilding simple GUI in the notebook
  • wljs-graphics3d-threejs - library for Graphics3D based on Three.js. Can also be used as a standalone plugin together with wljs-interpreter
  • wljs-graphics-d3 implementation of Graphics function and primitives based on d3.js and plotly.js. Can be used separately
  • wljs-mermaid-support support for Mermaid.js diagrams language
  • wljs-markdown-support support for markdown language
  • wljs-magic-support misc useful features for the editor
  • wljs-js-support support for JS cells in the editor with data-binding between WL and JS
  • wljs-html-support support for HTML language in the cells with a template engine WSP

Sponsors

Technology stack

Backend

  • Wolfram Engine as HTTP Server, IO operator, DB manager and etc

Frontend

  • WLJS interpreter for graphics, internal commands, events handing, lightweight calculations
  • CodeMirror 6 as a cell's editor
  • d3.js, plotly.js for 2D Graphics
  • three.js for 3D Graphics
  • mermaid.js for diagrams
  • reveal.js for slides
  • marked.js *for markdown *
  • katex.js as $\LaTeX$ renderer
  • layout is a rip off from Notion
  • ...

Inspired by

License

GNU GPLv3

About

Javascript frontend for freeware Wolfram Engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 45.1%
  • Mathematica 30.8%
  • JavaScript 23.2%
  • Other 0.9%