Re: Interactive data plotting application
Hi Jozef, Such a widget already exists in GOffice (it provides the charting capability to gnumeric). It might miss some features you need but is easily extensible. https://git.gnome.org/browse/goffice/tree/goffice/gtk/go-graph-widget.c Best regards, Jean Le dimanche 10 janvier 2016 à 13:05 +0100, Jozef V.Molnár a écrit : > Dear subscribers, > > I need to develop a GTK3 widget for data plotting, drawing and > analysis > purposes. > I need the following features (many are standard requirements): > - have a grid sensitive to mouse (to invoke a configuring menu) > - add/remove plots > - plots sensitive to mouse (display the data coordinates) > - more than cursors (to perform measurements) > - cursors capable of find edges of data plots > - scrolling > > My idea was to use GtkLayout but I am open to any better advice. > > I have made a simple demo with GtkDrawingArea (I can send it per > request) where I can draw with Cairo but cannot receive events. If I > change the parent from GtkDrawingArea to GtkLayout, I can receive > events > but the draw function will not be called. > > I am new to GTK and need a suggestion on how to organize my objects: > - plotting area > - cursors > - grid > - plots > > all should be sensitive to mouse clicks to invoke configuration, move > up/down (plots), do measurements, display coordinates etc. > > I searched the internet a lot but did not find many examples. I tried > GoatPlot as base... > > I also would like to add this widget to a VBox and if I zoom in the X > axis, all widgets should zoom in the X axis (but not the Y axis). > > Finally I would like to be able to print/export the contents etc... > > I know this is time consuming (at least for me) but I would > appreciate > any help. > > Thank you in advance and best regards > Jozef Molnar > > > ___ > gtk-list mailing list > gtk-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list
Re: Interactive data plotting application
On Sun, 2016-01-10 at 14:21 +0100, Jean Bréfort wrote: > Such a widget already exists in GOffice Or you may search on github for terms like "gtk cairo", there are some hits. Such a widget would be nice, but I know that it is much work to make a really fine one. You intend to use plain C? A Questions is, if cairo drawing is fast enough in all cases. For my app http://ssalewski.de/PetEd.html.en it is fast enough, but I tried hard to draw new only what is really necessary. (And it is not only slow because I choosed Ruby language, performance is really restricted by cairo, but maybe I will be able to further improve performance.) You may also have a look at https://gitlab.com/ivor/GTK3-Cairo it was recently mentioned on gtk-list, but I had no time to look at that one. ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list
Re: Interactive data plotting application
There's a great package out there called plplot that seems to do a lot of what you want to do, but I've never tried integrating it into GTK. I have a package on github (https://github.com/ChrisMoller/aplplot) that shows plplot in use if you want a quick look at how its used. By the way, you can receive events from a drawing area, but you have to set the mask properly: gtk_widget_add_events (da, GDK_ENTER_NOTIFY_MASK| GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK| GDK_BUTTON_RELEASE_MASK) ; (If you need key events, you have to get them from some parent widget of the drawing area.) On 01/10/16 07:05, Jozef V.Molnár wrote: Dear subscribers, I need to develop a GTK3 widget for data plotting, drawing and analysis purposes. I need the following features (many are standard requirements): - have a grid sensitive to mouse (to invoke a configuring menu) - add/remove plots - plots sensitive to mouse (display the data coordinates) - more than cursors (to perform measurements) - cursors capable of find edges of data plots - scrolling My idea was to use GtkLayout but I am open to any better advice. I have made a simple demo with GtkDrawingArea (I can send it per request) where I can draw with Cairo but cannot receive events. If I change the parent from GtkDrawingArea to GtkLayout, I can receive events but the draw function will not be called. I am new to GTK and need a suggestion on how to organize my objects: - plotting area - cursors - grid - plots all should be sensitive to mouse clicks to invoke configuration, move up/down (plots), do measurements, display coordinates etc. I searched the internet a lot but did not find many examples. I tried GoatPlot as base... I also would like to add this widget to a VBox and if I zoom in the X axis, all widgets should zoom in the X axis (but not the Y axis). Finally I would like to be able to print/export the contents etc... I know this is time consuming (at least for me) but I would appreciate any help. Thank you in advance and best regards Jozef Molnar ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list
Re: Interactive data plotting application
hi, i've done all this in my data anlysis display app (pqlx), except for scrolling, and i've created an example of most of this using GTK3 and Cairo that you can find here: https://gitlab.com/ivor/GTK3-Cairo i use a drawing area inside a container widget, using Cairo for drawing, that is wholly sufficient for even my most complex requirements. cheers, richard p.s. the pqlx app, itself, is open-source and available when you're interested in seeing a complete implementation. you can find that here: https://ds.iris.edu/ds/nodes/dmc/software/downloads/pqlx/ file: src/utils/hlpr/plotPDFCairo.c (though this implemenation is GTK2) On Sun, Jan 10, 2016 at 7:05 AM, Jozef V.Molnár wrote: > Dear subscribers, > > I need to develop a GTK3 widget for data plotting, drawing and analysis > purposes. > I need the following features (many are standard requirements): > - have a grid sensitive to mouse (to invoke a configuring menu) > - add/remove plots > - plots sensitive to mouse (display the data coordinates) > - more than cursors (to perform measurements) > - cursors capable of find edges of data plots > - scrolling > > My idea was to use GtkLayout but I am open to any better advice. > > I have made a simple demo with GtkDrawingArea (I can send it per > request) where I can draw with Cairo but cannot receive events. If I > change the parent from GtkDrawingArea to GtkLayout, I can receive events > but the draw function will not be called. > > I am new to GTK and need a suggestion on how to organize my objects: > - plotting area > - cursors > - grid > - plots > > all should be sensitive to mouse clicks to invoke configuration, move > up/down (plots), do measurements, display coordinates etc. > > I searched the internet a lot but did not find many examples. I tried > GoatPlot as base... > > I also would like to add this widget to a VBox and if I zoom in the X > axis, all widgets should zoom in the X axis (but not the Y axis). > > Finally I would like to be able to print/export the contents etc... > > I know this is time consuming (at least for me) but I would appreciate > any help. > > Thank you in advance and best regards > Jozef Molnar > > > ___ > gtk-list mailing list > gtk-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-list > ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list
Re: Interactive data plotting application
On Sun, Jan 10, 2016 at 7:05 AM, Jozef V.Molnár wrote: I need to develop a GTK3 widget for data plotting, drawing and analysis purposes. I need the following features (many are standard requirements): - have a grid sensitive to mouse (to invoke a configuring menu) - add/remove plots - plots sensitive to mouse (display the data coordinates) - more than cursors (to perform measurements) - cursors capable of find edges of data plots - scrolling If you're working in Python, you should consider matplotlib [1], which has a GTK3 backend [2]. If you're not working in Python, you may still wish to see if you can wedge matplotlib into your system. It's rather powerful. As another possibility, you may wish to consider using a WebView and one of the many javascript plotting libraries out there. I'm aware of D3 and Bokeh off-hand, though I'm sure there are others. Robert [1] http://matplotlib.org/ [2] http://matplotlib.org/examples/user_interfaces/embedding_in_gtk3_panzoom.html [3] http://d3js.org/ [4] http://bokeh.pydata.org/en/latest/ ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list