|
|
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 |
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
- 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
[Updated on: Tue, 27 March 2012 00:02] Report message to a moderator
|
|
|
|
|
|
|
|
Re: New graph packages [message #36020 is a reply to message #35991] |
Thu, 19 April 2012 14:42 |
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 #36128 is a reply to message #36030] |
Tue, 01 May 2012 22:50 |
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 )
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 #36881 is a reply to message #36880] |
Mon, 16 July 2012 22:02 |
|
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 #38902 is a reply to message #37345] |
Sat, 26 January 2013 20:13 |
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
[Updated on: Sat, 26 January 2013 20:17] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun May 19 16:33:41 CEST 2024
Total time taken to generate the page: 0.01659 seconds
|
|
|