Code Monkey home page Code Monkey logo

gdv's Introduction

General Information

Gdv is a graphical library, that adds some functionality to the GTK-library to present and visualize scientific and generally all kind of data.

Status

The project is in a very early development state. Some things are already working, some things need a lot of rework and on many necessary things, work has not even started yet.

A GTK-based data-visualization-library

The GDV-library tries to provide a simple data-visualization-library in the GTK-framework. It is the attempt to use powerful programming-features of the glib- and GTK-libraries such as object-oriented programming, referencing, introspection, widget-based geometry handling and theming by CSS-files in a library that is able to provide professional data-plots.

I wrote this library because I found the GTK-framework and the glib-features quite handy in everyday programming. For the advantages of these libraries I should refer to the gnome developer documentation. LibGdv should always orient on the native GTK-theming engine and geometry-management and of course it should be possible to use it within the GTK-builder and with gobject-introspection. The focus in the development should lie on a good and active integration in GTK to achieve a high portability and offer the features of user customization that GTK is able to offer. Of course it would be nice to see that these advantages are useful under non-scientific and non-engineering applications too.

Differences to other plotting libraries

A powerful alternative is libgoffice, but despite it's strengths and functionality it is far more specialized onto office-applications than on the merely technical side.

Further alternatives, that should be considered are GtkDataBox, GtkExtra, the GtkInstrumentationWidgets, slope and glinegraph. These libraries are to some part outdated and/or have a lack of functionality in terms of the current GTK-interfaces. Also in most cases they are limited to GTK+2.0 only. An further integration of these libraries into a recent interface-builder such as GtkBuilder or Glade is difficult.

However strongly simplified libraries such as slope are by far less processing intensive than the LibGdv and for applications with limited processing resources these libraries are good and reasonable alternatives that should be taken into consideration.

Another good solution is to write an own graph-widget for the specific application. As a base for such a widget the GtkDrawingArea can be used. This solution seems to be somehow the best praxis in many Gnome-Apps for the moment. As some good examples look at the load-graph widget in the gnome-system-monitor or the realtime-graph of gnome-builder.

More indirect alternatives such as an implementation of gnuplot in GTK or an implementation of a JavaScript based plotting library such as lotr2 via webkit2 in GTK is, beside its advantages, in my personal opinion no long-term solution, as tracking the interaction between the plotting and the user will be over complicated. A very nice approach in terms of usability and visual impression is using Matplotlib in combination with GObject-introspection. However the interaction with Gtk is similarly unilaterally limited as in the other give examples for indirect plotting.

This open gap of scientific and instrument-like data plotting widgets should be closed to make GTK a convenient option for scientific and technical applications.

A few words to the current development status

So far the master-branch is still in an very early state. It is just possible to draw simple linear 2d-plots and graphs without more specialized things. The examples given in the documentation show some basic functionality of the Gdv-library.

The good things

So far it is possible to plot data in different line and point styles with different colors in one or two-dimensions with either linear, semi-logarithmic or double-logarithmic graphs. Some other features and objects that are included are different kind of legends, tics, axes-labels and indicators, that can be used to mark a value on one particular axis.

These objects and their style-properties fully integrate in the theme-handling of GTK and therefor it is possible to use CSS-files for theme styling.

For the moment a rather minimalist but working geometry-handling on the basis of GTK is implemented:

automatic scaling

The bad things

So far, more specialized elements of data visualization such as three dimensional visualisation, error-bars, graph-meshes, histogram charts, radial-plots, pie charts, labels, arrows, fillings, time-formatted tic-labels and color effects are missing. Therfore, it can't really challenge existing scientific plotting libraries or programms.

It is not clear if values of angles should be assigned in deg. or in grad. Both implementations are used in GTK and GLib. However for the moment most angles are given in gradients to be consistent with the standard C math-libraries and most of the practical knowledge of the practical programmer.

The ugly

In some cases the coordinate-systems are not really obvious. Sometimes things are aligned relative of the drawing area, sometimes according to pixel-units and sometimes in data-units. This pain is caused by the mixture of influences from gnuplot and the gdk-rendering. These problems should be consistently solved as soon as possible.

The geometry-handling and height-for-width management is not perfectly designed. This is a problem arising from the different needs of the height-for-width management of GTK and LibGdv. It may induce also problems of aligning correct gdk-windows and arrangements for plotting-elements. An integration of these features should be considered for now as "experimental".

Due to the lack of stability in the development, Gdv does not provide a stable API so far. Changes in the concept and functionality require changes in the functions at this stage of the development. Therefore, changes of function definitions, methods and properties might occur even with the release of new micro-versions. Neither binary- nor interface-stability is guaranteed at the moment.

Annotation about the problems in geometry-handling:

Some problems could be eased if the baseline-alignment of gtk-widgets that is currently (since GTK version 3.10) just available for vertical alignment would be available for horizontal alignment too. However, this is hypothetical additional functionality of Gtk and a different story.

Gtk4 is available. As far as the interface-changes have been announced, this will lead to mayor design-changes inside libgdv. Currently, it is planned to add GTK4-support via a meson build option and do support both, a dedicated build for GTK-3 and GTK-4.

Documentation

There is a compiled html-version of the gdv reference manual is available online.

Please feel free to contact me via github or elsewhere, if you have any further suggestions or questions.

Installation

In order to build gdv you will need:

You will also need various dependencies, based on the platform you are building for:

Once you have all the necessary dependencies, you can build gdv by using Meson:

$ meson build
$ cd build
$ ninja

Building with asan can be achieved by simply using the configuration:

$ meson configure -Db_sanitize=address

If you need to build the documentation enter the following commands:

$ meson build
$ cd build
$ meson configure -Denable_gtk_doc=true
$ ninja
$ ninja gdv-doc

You can run the test suite using:

$ ninja test

And, finally, you can install gdv using:

$ sudo ninja install

Complete information about installing gdv and related libraries can be found in the file:

docs/reference/gdv/html/index.html

Or online

gdv's People

Contributors

emanuesson avatar

Stargazers

Yauhen Makei avatar Philipp Huth avatar José Fonte avatar theGtknerd avatar

Watchers

 avatar Philipp Huth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.