Improve the handling of extenal packages in plot2d and plot3d extensions.
Closed, ResolvedPublic

Description

Languages like python and julia allow the user to use different packages for plotting:

python

  • matplotlib
  • seaborn
  • pylab
  • GR
  • plot.ly
  • ggplot
  • etc.

Julia:

  • Gadfly
  • PyPlot
  • Plots
  • GR
  • etc.

Octave

  • Gnuplot
  • FLTK
  • Qt

At the moment Cantor hard-codes the usage of PyLab for python and of GR for julia when creating a plot via the Plot2D/Plot3D menu entries ("plotting extensions"). These packages might not be available on the system or are not the packages which the user wants to be used. Ideally we should make this configurable for the user in the settings for each specific language and to use the propper and library specific syntax in the implentations of Extension::plotFunction2d/3d() functions.

To further improve the user experience we should:

  • check internally for the presence of some well-known and widely used plotting packages like the ones mentioned above
  • in the settings dialog provide a list/combobox with all found packages for easier selection of the package to be used
  • use a reasonble default package - define an order of popularity of packages and use the first one found in this list
  • in case no known/supported packages are found, don't show the plot menu entries.
asemke created this task.Aug 22 2018, 3:31 PM
filipesaraiva added a subscriber: Cantor.
sirgienko updated the task description. (Show Details)Dec 15 2018, 2:50 PM

Well, I want to add some details for this task which I have found while I have worked on this task.

On this moment, the task is partially completed. Support of different package is done in Julia and Python. Octave don't need different support, because the graphics is creating via common function for all graphical backends.
Also the target

  1. use a reasonble default package - define an order of popularity of packages and use the first one found in this list

also have done.
But there are problems other targets.

  1. in the settings dialog provide a list/combobox with all found packages for easier selection of the package to be used

Can't be done at all on current settings achitecture. Cantor can't modify UI elements from settings on fly, so this target

  1. check internally for the presence of some well-known and widely used plotting packages like the ones mentioned above

Also become mostly unusefull, because even if we know, that some package not installed, we can't remove it from list of packages in Settings.
Although the target

  1. in case no known/supported packages are found, don't show the plot menu entries.

can be usefull, there are huge technical problems. For example, Julia don't give access user for checking installed modules, so actually, you need try to import to find out if package is installed or not. Import popular package like GR, Plots, etc could lasts 2-6 seconds. So, for Julia, with 5 packages supported by the plot extension, the full test of precense could lasts ~15 seconds. Which of course will totally unacceptable for user. Also, the problem precens in Python backend too, but less catostrofic - a few seconds on checking instead of 15.

So, I think, we should close the task as solved with idea, that presence of used in plot extension graphic package is an area of user responsibility.

sirgienko closed this task as Resolved.Aug 14 2020, 1:14 AM
sirgienko claimed this task.