EyeSee _ show composite diagram on Glamour+Seaside

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

EyeSee _ show composite diagram on Glamour+Seaside

hoattn
Dear all,
     I have a question about the library EyeSee and Glamour Seaside:
     I can use EyeSee to show the composite Diagram(you can see plotVector: aSymbol) and it run           very well on Pharo + Moose.  
     Now, my goal is representation of this diagram on Glamour Seaside(using browser, display on Glamour+Pharo and on the web Glamour+Seaside). But I don't find any solution for resolve this problem.  
       
The code on Pharo + EyeSee:
The data that I use is a type Dictionary : a Dictionary 'result'
a result :  key #I           value: a vector I ( I1, I2 , I3)
              key #S          value: a vector S (S1, S2, S3)

From this data, I return key and value and call a method plotVector:  
        result keysAndValuesDo: [ :key :eachSeries | eachSeries sqrt plotVector: key]


Function plotVector to show diagram:

plotVector: aSymbol
    | cqdiag f Ylabel nbSpecies listColor diagRenderer |
    cqdiag := ESCompositeDiagram new.
    nbSpecies := (data at: 1) size.
    listColor := self initializeListColors.
    Ylabel := 'Number of Individuals of ',aSymbol asString.
    1 to: nbSpecies do:[:i|
        |diag|
        f := [ :x | (self atIndex: x) at: i ].
        diag := (ESDiagramRenderer new lineDiagram)
            y: f;
            defaultColor: (listColor at: i);
            yAxisLabel: Ylabel;
            regularAxis;
            startLineAtZero;
            models: index.
            cqdiag add: diag.
        ].
    cqdiag width: 1200.
    cqdiag height: 500.
    cqdiag preferredAxisMaxY: (self preferredDataMax).
    diagRenderer := ESDiagramRenderer new.
    diagRenderer diagram: cqdiag.
    ^ diagRenderer open
My goal is represent this composite diagram (a ESDiagramRenderer  ---> n lineDiagram) on Seaside + Glamour. I looked the examples of eyeseeDiagram on GLMBasicExample and SGLBasicExample but I haven't idea to resolve my problem. Could you help me, please!
Best regards,
Reply | Threaded
Open this post in threaded view
|

Re: EyeSee _ show composite diagram on Glamour+Seaside

Tudor Girba-2
Hi,

I am not sure I understand. The same code that works in Pharo should also work in Seaside. Does it work in Pharo? Does it not work in Seaside?

Doru




On Thu, Jun 6, 2013 at 8:25 AM, hoattn <[hidden email]> wrote:
Dear all,
     I have a question about the library EyeSee and Glamour Seaside:
     I can use EyeSee to show the composite Diagram(you can see plotVector:
aSymbol)         and it run           very well on Pharo + Moose.
     Now, my goal is representation of this diagram on Glamour Seaside(using
browser, display on Glamour+Pharo and on the web Glamour+Seaside). But I
don't find any solution for resolve this problem.

The code on Pharo + EyeSee:
The data that I use is a type Dictionary : a Dictionary 'result'
a result :  key #I           value: a vector I ( I1, I2 , I3)
              key #S          value: a vector S (S1, S2, S3)

>From this data, I return key and value and call a method plotVector:
        result keysAndValuesDo: [ :key :eachSeries | eachSeries sqrt plotVector:
key]


Function plotVector to show diagram:
<http://forum.world.st/file/n4691887/CompositeDiagram%23S.png>
plotVector: aSymbol
    | cqdiag f Ylabel nbSpecies listColor diagRenderer |
    cqdiag := ESCompositeDiagram new.
    nbSpecies := (data at: 1) size.
    listColor := self initializeListColors.
    Ylabel := 'Number of Individuals of ',aSymbol asString.
    1 to: nbSpecies do:[:i|
        |diag|
        f := [ :x | (self atIndex: x) at: i ].
        diag := (ESDiagramRenderer new lineDiagram)
            y: f;
            defaultColor: (listColor at: i);
            yAxisLabel: Ylabel;
            regularAxis;
            startLineAtZero;
            models: index.
            cqdiag add: diag.
        ].
    cqdiag width: 1200.
    cqdiag height: 500.
    cqdiag preferredAxisMaxY: (self preferredDataMax).
    diagRenderer := ESDiagramRenderer new.
    diagRenderer diagram: cqdiag.
    ^ diagRenderer open
My goal is represent this composite diagram (a ESDiagramRenderer  ---> n
lineDiagram) on Seaside + Glamour. I looked the examples of eyeseeDiagram on
GLMBasicExample and SGLBasicExample but I haven't idea to resolve my
problem. Could you help me, please!
Best regards,



--
View this message in context: http://forum.world.st/EyeSee-show-composite-diagram-on-Glamour-Seaside-tp4691887.html
Sent from the Moose mailing list archive at Nabble.com.

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: EyeSee _ show composite diagram on Glamour+Seaside

hoattn
Cheers Tudor,
   I poorly explained. I want to ask you an idea : how to represent the data and code on Glamour Seaside?

I give you an example:
Normally, i create a method like this on Pharo image:
plot: aSymbol
        (data at: 1) size > 1
                | diag f Ylabel |
                f := [ :x | (self atIndex: x) at: 1 ].
                Ylabel := 'Number of Individuals of ',aSymbol asString.
                diag := ESDiagramRenderer new.
                diag lineDiagram
                        y: f;
                        defaultColor: Color blue;
                        yAxisLabel: Ylabel;
                        regularAxis;
                        startLineAtZero;
                        width: 1000;
                        height: 500;
                        models: index.
                ^ diag open

        In order to represent this diagram on Glamour(Pharo image) and on the web(Seaside localhost),
       i create a browser and transmit data:
browser transmit
from: #graph1;
to: #visual;
andShow: [ :a |
        a eyesee
                        title: 'Visualisation';
                        display: [:data | data ];
                        diagram: [:renderer :data |
                               renderer lineDiagram
                                                y: [ :x | (data atIndex: x) at: 1 ];
                                                models: data index;
                                                width: 900;
                                                height: 250;
                                                yAxisLabel: 'Number of individuals';
                                                regularAxis;
                                                valueAxis;
                                                defaultColor: Color red

                        ]
        ].
^ browser

But it is difficult to represent a composite diagram(the part in bold), i donn't find any solution to represent data.
i code this diagram:
plotVector: aSymbol
        | cqdiag f Ylabel nbSpecies listColor diagRenderer |
        cqdiag := ESCompositeDiagram new.                      <------composite diagram
        nbSpecies := (data at: 1) size.                  <-----get data
        listColor := self initializeListColors.
        Ylabel := 'Number of Individuals of ',aSymbol asString.
        1 to: nbSpecies do:[:i|                                <---------a loop
                |diag|
                f := [ :x | (self atIndex: x) at: i ].
                diag := (ESDiagramRenderer new lineDiagram)
                        y: f;
                        defaultColor: (listColor at: i);
                        yAxisLabel: Ylabel;
                        regularAxis;
                        startLineAtZero;
                        models: index.
                        cqdiag add: diag.
                ].
        cqdiag width: 1200.
        cqdiag height: 500.
        cqdiag preferredAxisMaxY: (self preferredDataMax).
        diagRenderer := ESDiagramRenderer new.
        diagRenderer diagram: cqdiag.
        ^ diagRenderer open
       
Now, i want to rewrite this code using a browser and runs it on localhost Seaside. You know a example of composite diagram or how to represent this diagram ?

Best regards.
Thanks avance.
ttnhoa