lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear Lua friends,

I have recently prepared a beta release of the new Elementary Plot library.
It is something I created from the code of a previous project, the Lua
graphics toolkit.
The more important difference is that the new project is completely
separated from the Lua implementation and it comes with a very clean
and simple C and C++ interface.
I have added the Lua bindings by wrapping the C++ interface using the
sol2 library (https://github.com/ThePhD/sol2).

By providing a C and C++ interface the library is more widely usable
without sacrificing the Lua bindings.
The other improvement to the library is mostly invisible but I
improved the code so that it can be more easy in the future to make
enhancements or modifications.

The Elementary Plot library is published on Github:

https://github.com/franko/elementary-plotlib

and here is the project's homepage:

https://franko.github.io/elementary-plotlib/

and the User's manual:

https://franko.github.io/elementary-plotlib/manual/

The library works on Windows and on Linux and it offers integration
with the FOX Toolkit. It is the only toolkit supported for the moment.
Work to integrate with wxwidgets is ongoing.

The library has minimal dependencies. What is required is the AGG
library and Freetype library. If you want you can install it in a
blink of the eye using the little library helper (
https://github.com/franko/lhelper ) but you don't have to. The build
system is based on Meson and can be compiled using the meson commands
provided the required libraries are installed.

*****
Special note on Windows: the library may work with Visual Studio but I
have tested only using Mingw64 and the GCC or Clang compiler.

As of Mac OSX I am sorry, for the moment it is not supported.
*****

Here a simple example of a C++ application to draw a nice plot on the screen:

https://github.com/franko/elementary-plotlib/blob/master/samples/plot-function.cpp

The library also has a C API so it can be used from a C program like
in the following example:

https://github.com/franko/elementary-plotlib/blob/master/tests/test-plot-show-c.c

I have also prepared a sample that illustrate its utilisation with Lua:

https://github.com/franko/elementary-plotlib/blob/master/samples/lua-plot.cpp

The Lua support for the moment is not fully developed but the
essential is there.

In general terms please consider that for the moment the library lacks
some important features. In some way it is a starting point for a
further evolution.

If you are interested you may have a look, I am interested to have
some feedback from other programmers.

Kind regards
Francesco