New statistic plugin

A new statistic plugin was added, providing the following fundamental statistic operations on arrays:

  • min,max.
  • mean,median.
  • std,var.
  • sort,sortDesc. The input it can be both an array or list of numerical values:
  "=min([40, 30, 60])"
  "=mean(40, t, 60)"

New format plugin

This new plugin allows to format numbers and currency according to a specific locale.

The function numToStr will converts a number (with grouping) to string.

  "=numToStr(4000.67)" // uses system locale
  "=numToStr(4000.67, 'pt-PT')" // = 4 000,67

The function nogrpToStr only affects the decimal place, so it doesn’t adds the thousand separator.

The function currToStr also adds the currency sign according to the locale.
It’s also possible to define the currency sign based on the sign but for that it must be defined the locale.

"=currToStr(4000.45, 'pt-PT', 'EUR')"

Array extracting functions

The core function has two new functions:

  • get - retrieves the n-index value of an array.
  "=get([40, 30, 60], 0)" // = 40
  "=get(sort([40, 30, 60]), 0)" // = 30
  • slice - retrieves a slice of an array.

    the input is: array, start index, end index (not included).

  "=slice([10,30,15,40],1, 3)" // = [30, 15]

Firefox Render Server support (Alpha version)

In order to provide an alternative to puppeteer/chrome, and since phantomjs has been discontinued, in this version, I worked to support slimerjs/firefox.
The first problem that I encountered was the fact that latest version of slimerjs doesn’t supports the recent versions of firefox, I’m using firefox 62.0. After some code modifications, where you can find on this link, I was able to make it work on Linux, but later the it didn’t work on Windows.
Therefore, this project feature is considered in alpha stage, waiting for further developments in behalf of the slimerjs team to provide support for the recent versions of firefox.
If you want to test:

  1. Download the modified slimerjs code, and place it inside the folder named slimerjs.

  2. Run the render server with the following parameters:

abeamer render --server slimerjs --server-exec ./slimerj/src/slimerjs-node foo

New cli scale parameter

Often when a story is created, it’s fixed to a certain frame size. Of course, it’s always possible to create a story where all the sizes are dynamic and adjust them to different resolution sizes, but many times it’s not worth that extra effort.
Usually when the project is designed to be a movie, it tends to have a big frame size, but when it’s designed for an animated gif, it tends to have a small frame size.
With the new command-line --scale parameter now it’s possible to create a story for a certain frame size, render it, and then when you want to generate the gif or the movie output at a different frame size.
This parameter supports:

  • Relative single value --scale 25%.
  • Width,Height values --scale 25%,45% --scale 400,600.

New getVars function

If you are creating plugins, and you need to initialize the general variables, now you can use ABeamer.getVars() to have access to initialization variables.
This function should be used only for plugins during the initialization phase.
To use these variables, it should be done by using the traditional method of args.vars supplied as a parameter to the plugin function runner.

What is next

The two major areas that need improvement are: svg support and the video-sync task.
CSS has come a long way from html pages started to support the style attribute, but some areas are still defaulting such as paths and complex shapes.
At the moment, ABeamer can already animate inline svg code but modifying html code on every frame.

Check out the alien abduction example on codepen where the beam is injected in every frame.

One of ABeamer’s major goals is to be used to create video overlays, this field has been stale for a while since it might require breaking changes, so I have been spending time to think how to implement the required improvements while minimizing the breaking changes impact.