Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » New graph packages
Re: New graph packages [message #35826 is a reply to message #35680] Mon, 26 March 2012 23:53 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi all,

My graph package is taking form so I'm going to publish a first version.

The design guideline I followed was to make it the most configurable possible, in order to be able to do a lot of things (at least for 2D graphs)

GraphDraw is based on the followinf principles:
  • A coordinate manager is in charge of each graph<->screen conversion => a unique instance is used for plotting, grid/axis management
  • The plot can be decorated with "GraphElements" (Left, right, top, bottom, over the whole graph, ...) just like Ctrls. They are stacked on each side of the plot. You can create whatever class you need for you're graph (like drawing exclusion zones on a graph, ...) One nice feature of GraphElements is that they have a callback that is called when mouse clicks on it ==> In the example try clicking on the axis Razz
  • The Grid and Axis drawing are grouped in one class that can be overloaded (in fact it is a GraphElement)
  • The tick management is dedicated to a specific class: GridStepManager : it calculates the positions where ticks/grid needs to be drawn. The intent of this class is to allow custom step calculation (log, ...)

The main classes are:
  • CoordinateConverter : it manages the coordinate conversion and can be overloaded for custom needs
  • GraphLementFrame :
  • GridAxisDraw
  • GridStepManager
  • GraphDraw
  • EmptyGraphDraw |
  • StdGraphDraw | helper classes intended to ease the use



The code is pretty dirty and not cleaned at all ( lots and lots of templates, I will kick them out once architecture and optimisations are finished )
The easyest way to use it to use the 'StdGraphCtrl' as in the example

Many functions are missing (zoom, scroll, ...) but the code architecture is pretty much finished although a lot of work is still to be done .

The data management is 100% compatible with ScatterDraw since it uses the same interface.
You can put as many axis as you wan't

index.php?t=getfile&id=3695&private=0

[Updated on: Tue, 27 March 2012 00:02]

Report message to a moderator

Re: New graph packages [message #35827 is a reply to message #35826] Tue, 27 March 2012 00:00 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
And here is the code

I will put it in svn tomorrow
Re: New graph packages [message #35872 is a reply to message #35827] Thu, 29 March 2012 22:30 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hy,

I just tried to commit under svn and wasn't allowed to do so.
I thought anyone could commit to sandbox ??

Is the username important ???

Re: New graph packages [message #35885 is a reply to message #35872] Sat, 31 March 2012 10:51 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Didier wrote on Thu, 29 March 2012 16:30

Hy,

I just tried to commit under svn and wasn't allowed to do so.
I thought anyone could commit to sandbox ??

Is the username important ???




Yes. Sending your credentials via PM.

Mirek
Re: New graph packages [message #35917 is a reply to message #35885] Mon, 02 April 2012 23:36 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hy everyone,

Here comes another version with scrolling / and zooming

Since I still can't seem to be able to access svn ( even with login/password ) I publish it in the attached file.

The functions added are the following:
* ON AXIS:
-scroll : mouse wheel OR mouse left + move
-zoom : CTRL + mouse wheel
NB: when modifying an axis only the data linked to this axis is impacted
==> you can move/zoom only some plots while the others don't change Razz

* ON PLOT :
- scroll : mouse left + move
- zoom : CTRL + mouse wheel
- select zoom : CTRL + mouse left
NB: all the data plot is modified

* DRAWING :
- when zooming/scrolling a REFRESH_FAST has been introduced in order to have smooth quick refresh when scrolling or zooming.
Once finished, a REFRESH_COMPLETE is done
==> this gives great results on a BIG DATASET Cool


I also changed the example a bit, to show the possibilty of having N different axis (like Y & Y2) and their possibilty to scroll/zoom independently


NB: I know the LOG management is buggy, but it's not critical for the moment and I'll correct it later

Re: New graph packages [message #35991 is a reply to message #35917] Mon, 16 April 2012 21:38 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi all,

I finaly managed to commit to svn.

The new version has some more enhancements:

  • recovered function support (as in scatter ctrl)
  • cursor image management
  • fast draw corrections and enhancements
  • vertical/horizontal ZOOM/SCROLL can now select whole graph or only the selected axis


The ZOOM/SCROLL behaviour on key has been modified:
[CTRL] => ZOOM
[SHIFT] => apply function to selected axis only
[NO KEY]=> SCROLL

so it gives the following:
On plot:
[wheel] : +-20% SCROLL
[MOUSE LEFT] : SCROLL
[CTRL + wheel] : +-20% ZOOM
[CTRL + MOUSE LEFT] : select area for ZOOM

On axis:
[wheel] : +-20% SCROLL on whole plot
[MOUSE LEFT] : SCROLL on whole plot
[CTRL + wheel]: +-20% ZOOM on whole plot

[SHIFT + wheel] : +-20% SCROLL on selected axis only
[SHIFT + MOUSE LEFT] : SCROLL on selected axis only
[SHIFT + CTRL + wheel]: +-20% ZOOM on selected axis only

The cursor image is also adapted to reflect the function goiing top be done.

I also added an 'hourglass' cursor image when drawing is in progress
==> when drawing gets long on big datasets, the user knows he can't do anything else

The next work I will do is :

  • add legend management
  • do some documentation



Re: New graph packages [message #36020 is a reply to message #35991] Thu, 19 April 2012 14:42 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi Koldo,

While retreiving the DrawLegend code of ScatterCtrl to inject it into GraphDraw, I found a bug:

At ScatterDraw.cpp L192
if (series[i].opacity > 0 && series[j].seriesPlot)

sould be replace by:
if (series[i].opacity > 0 && series[i].seriesPlot)

j ==> i

[Updated on: Thu, 19 April 2012 14:43]

Report message to a moderator

Re: New graph packages [message #36030 is a reply to message #36020] Fri, 20 April 2012 08:00 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Done.

Best regards
Iñaki
Re: New graph packages [message #36128 is a reply to message #36030] Tue, 01 May 2012 22:50 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
My GraphDraw / GraphCtrl packages are progressing:

Here are the latest evolutions (all in svn sandbox):
  • Corrected all the series drawing in order to work with all ScatterDraw SeriesPlots
  • Corrected LOG (works with zoom/scroll)
  • Corrected SCALING
  • Added the copy/save image functions
  • Added a ScatterCtrl replacement (just to profit the ScatterCtrl_demo). It is not a full replacement (all mouse config is not replaced, but all the rest works )


RECALL: The intent of this package is to give the maximum of flexibility in graph, so it inherits a lot from ScatterCtrl while adding different code strucure and some enhancements:
  • add different drawing schemes easily : axis/grids/legend/... while keeping UI reactions factored
  • Zooming/Scrolling is a factored functionality
  • Code Structure is a "ctrl like" => the graph is made of a plot zone + other "ctrls" adding axis/grids/legends/labels/spaces/.... whatever you invent
  • You can put as many axis as you wan't (just as long as it's useful Wink )


Next modifications in the list:
  • Add zoom/scroll SLAVE mechanism ==> so you can synchronize several graphs together or make a global view that manages the local zoom/pan
  • Make a grid dedicated to LOG
  • Add axis text formating (printing dates, ...)
  • Documentation (not started yet)

[Updated on: Tue, 01 May 2012 22:51]

Report message to a moderator

Re: New graph packages [message #36433 is a reply to message #36128] Sun, 27 May 2012 12:24 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi all,

I just published some modifications under SVN:

  • Corrected compilation under WINDOWS ( sorry it didn't work before Sad )
  • Added Graph image buffering to speed up display when other windows overlap (or when Graph is in tabs) Cool


Re: New graph packages [message #36778 is a reply to message #36433] Tue, 03 July 2012 18:12 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Here are the latest changes I made in my Graph packages:

  • Some documentation borning (an UML graph has been added using PlantUML)
  • MaxSize of a graph can be limited so that the user cannot zoom out to much
  • Axis step text formating can be changed using a callback :
  • Added support for Date and Time axis : the value of the axis must be Date().Get() or Time().Get() ==> the grid steps are managed in order to deal with years/months/week(partial)/days/hours/minutes/seconds

GridAxisDraw::setAxisTextFormat(TypeFormatTextCbk v)
GridAxisDraw::setAxisDateFormat()
GridAxisDraw::setAxisTimeFormat()

CoordinateConverter::setGraphMaxRangeLimit(TypeGraphCoord v)
CoordinateConverter::setGraphMinRangeLimit(TypeGraphCoord v)
CoordinateConverter::resetGraphRangeLimits()


The grid step management for log10() axis is coming next



Re: New graph packages [message #36880 is a reply to message #35124] Mon, 16 July 2012 21:35 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

I would like to use this graphs/plots packages but it seems to be more than one package; for instance, in bazaar you can find PlotCtrl/PlotLib but there are others.

Any suggestion about which of them to use? Apart from PlotCtrl/PlotLib that you can find in Bazaar, how can you get the other packages?.

Thank you,

Javier
Re: New graph packages [message #36881 is a reply to message #36880] Mon, 16 July 2012 22:02 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

281264 wrote on Mon, 16 July 2012 21:35

Hi,

I would like to use this graphs/plots packages but it seems to be more than one package; for instance, in bazaar you can find PlotCtrl/PlotLib but there are others.

Any suggestion about which of them to use? Apart from PlotCtrl/PlotLib that you can find in Bazaar, how can you get the other packages?.

Thank you,

Javier

Hi Javier,

PlotLib/PlotCtrl are slowly getting obsolete now. Koldo adapted the main features from them into the ScatterCtrl, so you should probably use that (unless you have some very specific needs).

Both Koldos and Didiers packages can be found in sandbox under the names ScatterCtrl and GraphDraw, respectively.

Best regards,
Honza
Re: New graph packages [message #36882 is a reply to message #35124] Mon, 16 July 2012 22:29 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Honza,

Many thanks; I've found that ScatterCtrl is already a package and that there is a demo in Examples. Two questions:

Which of them to use?
Is there a simple way to get access to an application in Sandbox?

Cheers,

Javier.
Re: New graph packages [message #36883 is a reply to message #36882] Mon, 16 July 2012 23:56 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi All,

As promised I added LOG grid steps management but I also did the following:
  • kicked some template parameters (for GridStepManager() and GrodStepIterator() classes)
  • Grid text can now be set using QTF which gives the ability to make multilines, bold, ...in the grid lines
  • Enhanced Grid text drawing for Time

Note: All these features are build to work with zoom and scrolling, so the grid and text is adapted to the range Cool

Some bugs are still creeping around since all this is work in progress but overall working pretty good.

I Also need to post a Demo Package which I will try to do soon enough.

Here is an image showing the result with LOG10 scales and Time data

index.php?t=getfile&id=3803&private=0

  • Attachment: GraphCtrl.png
    (Size: 72.81KB, Downloaded 798 times)
Re: New graph packages [message #36915 is a reply to message #36883] Fri, 20 July 2012 16:23 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi,

I just uploaded some corrections:

  • Log10 management corrections
  • GraphCtrl/ScatterCtrl.h corrections


Now if you want to see GraphCtrl in action all you have to do is
  • open the Examples/ScatterCtrl_demo package
  • add GraphCtrl package to it
  • in ScatterCtrl_demo.h replace #include "ScatterCtrl/ScatterCtrl.h" by #include "GraphCtrl/ScatterCtrl.h"


Not all is equivalent, but everything compiles and you can see GraphCtrl in action.
Re: New graph packages [message #37339 is a reply to message #36915] Mon, 24 September 2012 11:43 Go to previous messageGo to next message
ratah is currently offline  ratah
Messages: 107
Registered: July 2010
Experienced Member
Hello everybody,

I try to use ScatterCtrl.
I have a data serie in the range [-10, 10].
How to set min range of my y axis?

SetRange(10, -10, 10)? or what?
I do not want FitXYData for this case.

Thank you
Re: New graph packages [message #37344 is a reply to message #37339] Mon, 24 September 2012 19:29 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi ratah,

If you are Using ScatterCtrl/ScatterCtrl or GraphCtrl/ScatterCtrl all you have to do is:

scatter.SetXYMin(xmin, ymin);
scatter.SetRange(xRange,yRange); with xRange=xMax-xMin and yRange=yMax-yMin

DO IT in this ORDER !!!if you are using ScatterCtrl/ScatterCtrl otherwise i doesn't work( if my memory is wright )

Or, if you are using GraphCtrl classes you can also do the following:
scatter.GetYCoordConverter().updateGraphSize(yMin, yMax);

There also is a class hierarchy doc in the GraphDraw package
index.php?t=getfile&id=3875&private=0
  • Attachment: GraphDraw.png
    (Size: 139.96KB, Downloaded 755 times)
Re: New graph packages [message #37345 is a reply to message #37339] Mon, 24 September 2012 21:13 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Ratah

Didier is right.

I would do:

scatter.SetXYMin(xmin, ymin).SetRange(-10, 10);


Best regards
Iñaki
Re: New graph packages [message #38902 is a reply to message #37345] Sat, 26 January 2013 20:13 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi all,

I just updated my GraphDraw/GraphCtrl Packages in the svn sandbox.
I added some predefined Graphs along with their description in '.usc' files to allow easy use in layout designer.

I tried to make the look in designer the closest possible to the real Graphs: so almost ALL parameters are modifiable directly in designer :
  • colors
  • fonts
  • width
  • margins
  • axis scale type : STD/LOG
  • Axis format type: STD/LOG/DATE/TIME
  • Labels (axis labels, title)
  • ... and more

Here is how the four predefined graphs look when dropped in the designer
index.php?t=getfile&id=4034&private=0

[Updated on: Sat, 26 January 2013 20:17]

Report message to a moderator

Previous Topic: New pick/clone notation now merged into trunk
Next Topic: Testing of migrated and upgraded forum
Goto Forum:
  


Current Time: Thu Mar 28 11:06:28 CET 2024

Total time taken to generate the page: 0.01576 seconds