GooData: diagrams for screen / printer / files

User projects written in or related to FreeBASIC.
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

GooData: diagrams for screen / printer / files

Postby TJF » Apr 20, 2012 20:52

I started a new project. The working title is GooData. It aims to create a library for presenting data in diagrams in a technical syle. The library should be similar to DisLin, but it should

  • be based on cairo for high-quality screen, file and printer output (win32 and LINUX)
  • use PangoCairo for system fonts and international characters (UTF-8)
  • be modular, so the user can arrange his page by using a custom set of items (with one or more diagrams on a page)
  • use GooCanvas for arranging the diagram items (in a graphical manner on the screen)

As of now the concept is done and I've about 2000 LOC for two new items

  • GooAxis and
  • GooCurve
Here's an overview of what they can do.

Screenshots and corresponding source code

Image 60 LOC:

Code: Select all

' This is file ex_line_markers.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net

VAR root = goo_canvas_group_new(Glob, _
            "line_width", line_group, _
             NULL)

VAR title = goo_canvas_text_new(root, _
            "<span size=""xx-large"">"_
            "Line Graph With Markers" _
           !"</span>\n", _
            0.0, 0.0, W, GOO_CANVAS_ANCHOR_SW, _
            "use_markup", TRUE, _
            "alignment", PANGO_ALIGN_CENTER, _
             NULL)

VAR grid = goo_canvas_rect_new(root, _
             0.0, 0.0, W, H, _
            "fill_color", "#F7F19E", _
            "stroke_pattern", NULL, _
             NULL)

VAR x = goo_axis_new(root, grid, Tx, GOO_AXIS_SOUTH, _
            "text_align", PANGO_ALIGN_RIGHT, _
            "offset", "-" & H / 2, _
            "borders", "-3.3 3.3", _
            "tick_length", "5 5", _
            "ticks", "-3 -2 -1 1 2 3", _
             NULL)

VAR y = goo_axis_new(root, grid, Ty, GOO_AXIS_WEST, _
            "text_align", PANGO_ALIGN_RIGHT, _
            "offset", "-" & W / 2, _
            "text_offset", 0., _
            "borders", "-1.15 1.15", _
            "ticks", "-1 -.5 .5 1", _
            "tick_length", "5 5", _
             NULL)

VAR zz = goo_curve_new(root, x, y, Dat, 0, 2, 0, _
            "marker_type", GOO_MARKER_CIRCLE, _
            NULL)

goo_curve_set_markers_properties(zz, _
_            "stroke_color", "green", _
            "stroke_color", "brown", _
            "fill_color", "green", _
             NULL)

VAR z = goo_curve_new(root, x, y, Dat, 0, 1, 0, _
            "marker_type", GOO_MARKER_RHOMBUS, _
            "marker_size", 10., _
             NULL)

goo_curve_set_markers_properties(z, _
            "stroke_color", "brown", _
            "fill_color", "red", _
             NULL)


Image 61 LOC:

Code: Select all

' This is file ex_box_area.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net

VAR root = goo_canvas_group_new(Glob, _
            "line_width", line_group, _
            "font", "Arial", _
             NULL)

VAR title = goo_canvas_text_new(root, _
            "<span size=""xx-large"">"_
            "Areas in a Grid Box" _
           !"</span>\n", _
            0.0, 0.0, W, GOO_CANVAS_ANCHOR_SW, _
            "use_markup", TRUE, _
            "alignment", PANGO_ALIGN_CENTER, _
             NULL)

VAR grid = goo_canvas_rect_new(root, _
            0.0, 0.0, W, H, _
            "line_width", line_group, _
             NULL)

VAR x = goo_axis_new(root, grid, Tx, GOO_GRIDAXIS_SOUTH, _
            "borders", "-3.3 3.3", _
            "ticks", "1", _
             NULL)

goo_axis_set_grid_properties(x, _
            "stroke_color", "lightgray", _
             NULL)

VAR y = goo_axis_new(root, grid, Ty, GOO_GRIDAXIS_WEST, _
            "text_offset", 7., _
            "borders", "-1.15 1.15", _
            "ticks", ".5", _
             NULL)

goo_axis_set_grid_properties(y, _
            "stroke_color", "lightgray", _
             NULL)

VAR zz = goo_curve_new(root, x, y, Dat, 0, 2, 0, _
            "stroke_color", "green", _
            "area", "y0", _
             NULL)

goo_curve_set_area_properties(zz, _
            "fill-color-rgba", &h00C00030, _
             NULL)

VAR z = goo_curve_new(root, x, y, Dat, 0, 1, 0, _
            "fill_color", "lightred", _
            "stroke_color", "red", _
            "area", "y0", _
             NULL)

goo_curve_set_area_properties(z, _
            "fill-color-rgba", &hC0000030, _
             NULL)


Image 86 LOC:

Code: Select all

' This is file ex_3d_perpens.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net

VAR root = goo_canvas_group_new(Glob, _
            "line_width", line_group, _
             NULL)

VAR title = goo_canvas_text_new(root, _
            "<span size=""xx-large"">"_
            "3D Effect, Perpendiculars, Background Pixbuf" _
           !"</span>\n", _
            0.0, 0.0, W, GOO_CANVAS_ANCHOR_SW, _
            "font", "Purisa Bold Italic", _
            "use_markup", TRUE, _
            "alignment", PANGO_ALIGN_CENTER, _
             NULL)

VAR pixbuf = gdk_pixbuf_new_from_file("FreeBasic.png", 0)
VAR grid = goo_canvas_rect_new(root, _
             0.0, 0.0, W, H, _
            "stroke_color", "yellow", _
            "fill_color", "lightyellow", _
            "line_width", line_group, _
             NULL)

VAR image = goo_canvas_image_new(root, _
            pixbuf, _
            0.0, 0.0, _
            "width", W, _
            "height", H, _
            "scale-to-fit", TRUE, _
             NULL)

VAR x = goo_axis_new(root, grid, Tx, GOO_AXIS_SOUTH, _
            "stroke_color", "yellow", _
            "fill_color", "yellow", _
            "offset", "25 27", _
            "borders", "-3.3 3.3", _
            "tick_length", "0.01", _
            "tick_angle", -30.0, _
            "ticks", "1", _
             NULL)

goo_axis_set_ticks_properties(x, _
            "stroke_color", "black", _
             NULL)

goo_axis_set_text_properties(x, _
            "fill_color", "black", _
             NULL)

VAR y = goo_axis_new(root, grid, Ty, GOO_AXIS_EAST, _
            "stroke_color", "yellow", _
            "fill_color", "yellow", _
            "offset", "25 -27", _
            "text_offset", 7., _
            "borders", "-1.15 1.15", _
            "ticks", ".5", _
            "tick_length", "0.01", _
            "tick_angle", -30.0, _
             NULL)

goo_axis_set_ticks_properties(y, _
            "stroke_color", "black", _
             NULL)

goo_axis_set_text_properties(y, _
            "fill_color", "black", _
             NULL)

VAR zz = goo_curve_new(root, x, y, Dat, 0, 2, 0, _
            "stroke_color", "green", _
            "perpendiculars", "C1", _
             NULL)

goo_curve_set_perpens_properties(zz, _
            "stroke_color_rgba", &hC0C0C090, _
             NULL)

VAR z = goo_curve_new(root, x, y, Dat, 0, 1, 0, _
            "stroke_color", "red", _
             NULL)

goo_canvas_item_set_simple_transform(root, W / 2, h / 2, 1.0, 30.0)


Anybody interested in

    A) using this library,
    B) participating in the project?

In case of B) I'm looking for

  • beta-testers with good ideas how to make the API more powerful and easier to use
  • authors for the documentation
  • programmers keen on (or able and willing to learn) GLib, Cairo, GooCanvas, ...
  • an PR expert for creating and maintaining a website with repository and Wiki (ie at sourceforge)
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Re: GooData: diagrams for screen / printer / files

Postby agamemnus » Apr 20, 2012 22:08

I would definitely use this library at some point. I've made crude graphing stuff in the past, for my own mini-projects...
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Re: GooData: diagrams for screen / printer / files

Postby TJF » Apr 22, 2012 18:10

@agamemnus

Thanks for your interest. I think I'll do some documentation work before I'll publish the first version (any help is welcome).

@All

Has anybody generated GNOME style html documentation for a FB project?
Sebastian
Posts: 131
Joined: Jun 18, 2005 14:01
Location: Europe / Germany
Contact:

Re: GooData: diagrams for screen / printer / files

Postby Sebastian » Apr 25, 2012 9:52

Hey TJF,

This is definitely a very neat, interesting project. I can think of several project ideas in which it was quite handy to have such a library.

Sebastian
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Re: GooData: diagrams for screen / printer / files

Postby TJF » Apr 29, 2012 17:43

@Sebastian

thanks for your 'thumb-up'.

I'm working on the documentation now (snapshot here) and hopefully I'll get a complete version for the first upload soon.

And hopefully the first upload will animate not only users but also developers to participate in this project ;-)
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Re: GooData: diagrams for screen / printer / files

Postby TJF » Nov 24, 2018 10:45

The source is now available at

https://github.com/dtjf/GooData
MrSwiss
Posts: 2929
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GooData: diagrams for screen / printer / files

Postby MrSwiss » Nov 24, 2018 20:09

@TJF,

your Libraries do all have a problem and that is, the licensing under GPLv3.
This may also be the reason, why it is so difficult (for you) to get any collaborators on
them. I'd not use any of them, if I could not use them in commercial applications,
without having to disclose its source (source of the application itself).

You might want to consider using the LGPL instead ... maybe even with exclusion, for
static linking? (like FB's lib's are)

Just my 2 cents.
Munair
Posts: 828
Joined: Oct 19, 2017 15:00
Location: 't Zand, NL
Contact:

Re: GooData: diagrams for screen / printer / files

Postby Munair » Nov 24, 2018 20:15

The MLGPL might be a good choice. It also applies to Lazarus code. Here is a copy:
http://www.basicstudio.org/mlgpl.html

Pay special attention to the modification, which is the last paragraph.
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Re: GooData: diagrams for screen / printer / files

Postby TJF » Nov 24, 2018 20:30

MrSwiss wrote:@TJF,

... the licensing under GPLv3.

You might want to consider using the LGPL instead ... maybe even with exclusion, for
static linking? (like FB's lib's are)

Just my 2 cents.
Thanks for your feedback, but what are you talking about?
Did you read the license file? Where did you find GPLv3 in that lib (or any other)?
MrSwiss
Posts: 2929
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GooData: diagrams for screen / printer / files

Postby MrSwiss » Nov 24, 2018 20:39

Code: Select all

' This is file ex_3d_perpens.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net
Isn't this clear enough?
TJF
Posts: 3382
Joined: Dec 06, 2009 22:27
Location: N47°, E15°

Re: GooData: diagrams for screen / printer / files

Postby TJF » Nov 24, 2018 20:47

MrSwiss wrote:

Code: Select all

' This is file ex_3d_perpens.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net
Isn't this clear enough?

This is example code, not the library.
MrSwiss
Posts: 2929
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GooData: diagrams for screen / printer / files

Postby MrSwiss » Nov 24, 2018 21:00

OK got it from GIT, it says 'Lesser GPL', which I find somewhat confusing,
should read 'LGPL', IMO. Apologies.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 7 guests