Skip to main content

Release notes *2.8.3*

⏱️ 4 min read
  • Labels now behave more like Mathematica, supporting StandardForm, Automatic, offsets, LaTeX cells, and even custom WLJS functions.
  • Improved export using custom ElectronJS-based PDF renderer, preserving dynamics/transitions.
  • Correct rendering of standard forms like Complexes, Reals.
  • Added TableAsync and DoAsync, allowing asynchronous versions of Table/Do.
  • Better handling of 2D/3D plots with very large numbers of points (via WebGL OES_element_index_uint).
  • Assistant plugin can now connect to locally running LLMs (e.g., Ollama), not just OpenAI models.
  • Fixed missing AnimationRate and RefreshRate options in animations.
  • Improved Windows network I/O stability and fixed minor bugs.
Download original notebook

AxesLabel, FrameLabel Improvements

We have expanded our implementation of axes labels in a manner similar to how it is done in Mathematica.

If the expression is not defined on the frontend as a WLJS function or if it is wrapped with HoldForm, the expression will appear in its StandardForm, i.e.

Plot[x, {x,0,1}, AxesLabel->{x,x}]
(*VB[*)(FrontEndRef["15e770e6-c6c1-4ad6-9317-72a4637dec39"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKG5qmmpsbpJrpJpslG+qaJKaY6VoaG5rrmhslmpgZm6ekJhtbAgB9RBVN"*)(*]VB*)

Or using Automatic

(*VB[*)(FrontEndRef["2b15edf2-6625-4eaf-8dc9-3bbf6281919e"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKGyUZmqampBnpmpkZmeqapCam6VqkJFvqGiclpZkZWRhaGlqmAgCKQhXf"*)(*]VB*)

One can offset the labels, which is usually not possible in Mathematica:

Plot[x, {x,0,1}, Frame->True, FrameLabel->{{HoldForm[1/2], {0,-58}}, "y-axis"}]
(*VB[*)(FrontEndRef["eb207ad4-6928-4951-90ac-d35d8b9707e3"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpyYZGZgnppjomlkaWeiaWJoa6loaJCbrphibplgkWZobmKcaAwB/cRVO"*)(*]VB*)

Or even put latex cells inside:

Plot[x, {x,0,1}, Frame->True, FrameLabel->{{HoldForm[CellView["\\alpha", "Display"->"latex"]], {0,-5}},  None}]
(*VB[*)(FrontEndRef["4ea99016-ae3a-4897-8790-7f469aaadd17"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKm6QmWloaGJrpJqYaJ+qaWFia61qYWxromqeZmFkmJiampBiaAwB+7RWH"*)(*]VB*)

Here is an example with custom WLJS function, that defines a label:

.html

<style>
@keyframes colorChange {
  0% { color: red; }
  50% { color: blue; }
 100% { color: green; }
}
</style>
.js
core.MyLabel = async (args, env) => {
  const text = await interpretate(args[0], env);
  env.element.style.width = "4rem";
  env.element.innerHTML = `<span style="animation: colorChange 0.5s infinite;">${text}</span>`
}
core.MyLabel = async (args, env) => {
  const text = await interpretate(args[0], env);
  env.element.style.width = "4rem";
  env.element.innerHTML = `<span style="animation: colorChange 0.5s infinite;">${text}</span>`
}
Plot[x, {x,0,1}, Frame->True, FrameLabel->{{MyLabel["x-label"]//Offload, {0,-5}},  None}]
(*VB[*)(FrontEndRef["dca94f64-c7f9-49cb-95d1-a873f5aa8252"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKpyQnWpqkmZnoJpunWeqaWCYn6VqaphjqJlqYG6eZJiZaGJkaAQCQdhXn"*)(*]VB*)

Improved Slides Export

By utilizing our custom PDF renderer (based on the ElectronJS engine), we managed to export slides in a semi-automatic mode as close as possible to the original view you see in the WLJS Notebook.

note

Export happens live; the slides are projected to the full window size, input is blocked, and you need to wait while it artificially flips through all slides.

This is the only way to ensure that all dynamics and transitions have occurred on time.

Missing Decorations

We fixed some broken standard forms of Complexes, Reals, etc.:

Reals
(*VB[*)(Reals)(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRAeL5AIy0wtd0lNzi9KLMkvCmYFigSlJuYUAwAXSgwe"*)(*]VB*)

New AsyncFunction Methods

TableAsync and DoAsync were added to be used within asynchronious functions. They work in the same way as corresponding symbols from Wolfram Language, but the inner expression can be an implicit AsyncFunction. For example:

Then[
  TableAsync[
    PauseAsync[0.5] // Await;
    i + 1
  , {i, 3}]
, With[{c = EvaluationCell[]}, 
    CellPrint[#, "After"->c]&
  ]
];
{2,3,4}

Better Support for Many Data Points

Here is an example of more than 64,000 vertices of indexed geometry in Graphics3D:

(*VB[*)(FrontEndRef["9fc900da-e886-4fb5-a4da-57b3abcaee0c"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKW6YlWxoYpCTqplpYmOmapCWZ6iaaALmm5knGiUnJiampBskAkbgWvg=="*)(*]VB*)

And here is a similar feature, but in the context of 2D graphics. We utilized the OES_element_index_uint extension of WebGL, which is available on 93% of machines. Even if your machine does not support it, the renderer will still try to display the result.

(*VB[*)(FrontEndRef["5a2ba9cc-5abb-4218-b877-b8088af8b3a9"])(*,*)(*"1:eJxTTMoPSmNkYGAoZgESHvk5KRCeEJBwK8rPK3HNS3GtSE0uLUlMykkNVgEKmyYaJSVaJifrmiYmJemaGBla6CZZmJsDCQMLi8Q0iyTjREsAj1YWBg=="*)(*]VB*)

Support for Local LLMs in Assistant

Some of you are using our old plugin that allows editing the notebook cells in automated mode using GPT models.

Before we restricted ourselves to OpenAI's gpt-4* models, however, some OSS and freeware solutions emerged on the market. We patched our API to be able to work with locally running LLM servers such as Ollama.

The only requirements are:

  • The completion API must be compatible with the OpenAI v1 API (this is usually the case for most models/LLM servers).
  • Support for plugins/tools.
note

Local LLMs performance is strongly depend on your machine/model specs.

...and we also fixed unicode issue 🙂

AnimationRate

We fixed the missing feature of RefreshRate and AnimationRate:

Animate[Graphics3D[Sphere[{0,0,1.0-(*SpB[*)Power[Cos[z](*|*),(*|*)2](*]SpB*)}, 0.1]], {z,0,10.0}, AnimationRate->0.03, RefreshRate->30]

Buy us a coffee ☕

We are not affiliated with Wolfram Research or any other companies. If you enjoy WLJS, consider supporting us:


  • write a blog post about WLJS
  • tell a colleague

or

Your contributions help keep our project alive and improve the experience for everyone.

Stability and Minor Bug Fixes

We improved the stability of the network IO interface on Windows machines and patched a few more bugs in the interface.

All the best ❤️ from WLJS Team