Plotting backend for Web UI


I wanted to have a discussion regarding recommendations for plotting backends for web UIs for Octave, such as (which I develop).

Currently, we’re using the Gnuplot graphics toolkit in Octave, and we instruct Gnuplot to print the plot to an SVG file. We then send the SVG file across the network to the client. Currentlythe SVG is static, but newer versions of Gnuplot support mouse events in the SVG, which I hope to add in Octave Online (example: Demos for gnuplot Version 5.4 (SVG terminal)). Another advantage of Gnuplot is that there is no communication necessary between the client and the server after the plot is finished.

However, newer versions of GNU Octave print a warning saying that the Gnuplot toolkit is not actively maintained. So, I wanted to discuss:

  1. Can you elaborate on the status of the Gnuplot support in Octave? Does it remain an officially supported toolkit with regression tests, or is there a risk that the toolkit will become unusable if no one steps up to support it?
  2. What other tech stacks do you envision for how to render plots for web users?

The Octave Online Server source code is published under AGPL at the following URL. I’m happy to point to the parts of the code base relevant to plotting.

Thank you!

Just dropping in to say that the Gnuplot SVG-with-embedded-JS-to-support-mouseover-tooltips demo that OP linked is really cool, and this sort of thing looks really handy if one has interest in supporting Octave as a back-end that’s pushing graphical output to a web destination.

This is a place where Octave might even one-up Matlab, if one were interested in doing so: Matlab is not there yet with regards to producing interactive graphics that are embeddable in a web context.

On the other hand, I realize that supporting this sort of thing would be nontrivial.

1 Like

Octave as standalone application has already cool interactive graphics with the actively developed qt toolkit.

To what I recall from discussions and bug reports about graphic toolkits, the gnuplot toolkit will remain in Octave as long as it does not cause any trouble or additional maintanence burden. However, it is no longer actively developed. In other words, it is not expected to be a fully compatible replacement for the qt-toolkit for example and might miss new features are added to the qt-toolkit.

Looking at the gnuplot svg example

the technique itself (SVG+Javascript) is not bound to the gnuplot toolkit. gnuplot creates the example quite easy with an own command in gnuplot language, but the fancyness still comes from a web browser using an experimental Javascript library.

This code injection could theoretically be done by an Octave code (or another XML scripting language) postprocessing SVG graphics generated by any Octave plotting toolkit. In my opinion there is no strong reason to put more emphasis back on gnuplot again.

Can’t this rendering and printing to a file be done with the qt-toolkit as well and you enrich Octave-online with a code post processing the SVG graphics?

Thanks for discussing it at the meeting Online Developer Meeting (2021-12-28) - Octave :+1: