On Fri, Jun 29, 2012 at 12:57 AM, Tobias Oetiker <t...@oetiker.ch> wrote:
> Hi Paragasu,
>
> Today paragasu wrote:
>
> > Protovis is a nice graph library. Very glad to find out there is
> > a QxProtovis contrib to integrate with Qooxdoo. All thanks to
> > Tobi Oetiker.
> >
> > Trying to lean protovis but the website says the library is no
> > longer maintained. It is now called D3 and it is even awesome
> > capabilities. I am wondering if there is anyone know how to port
> > this library to Qooxdoo.
> >
> d3 is much mor generic than protovis, but takeing the qxprotovis
> contrib as an example, porting d3 should not be much of a problem I
> think.
>
> cheers
> tobi
>
>
> > Thanks in advance for your helpful reply.
> >
> > Regards,
> > jeffry
> >
>
>
Hi Tobi,
Need you wise advice. I came across a problem. The graph won't get
displayed even when the dom being generated on qooxdoo (it is there when i
inspect with firebug). The same code inside the run function running when
put on separate plain html will work as expected.
i did include the d3.v2.min.js library in the source/index.html. Here is
the code of my first attempt,
qx.Class.define("myapplication.D3test",
{
extend: qx.ui.container.Composite,
construct: function()
{
this.base(arguments);
this.setLayout(new qx.ui.layout.VBox(5));
var canvas = new qx.ui.container.Composite(new qx.ui.layout.Grow());
var html = new qx.ui.embed.Html('<div id="d3"></div>');
canvas.add(html);
this.add(canvas);
html.addListener("appear", this._run, this);
},
members:
{
_run: function()
{
var div = d3.select('#d3');
var graph = div.append('svg:svg').attr('width',
400).attr('height', 400);
var pathinfo = [{x:0, y:60},
{x:50, y:110},
{x:90, y:70},
{x:140, y:100}];
var line = d3.svg.line()
.x(function(d){return d.x;})
.y(function(d){return d.y;})
.interpolate('linear');
graph.append('svg:path').attr('d', line(pathinfo))
.style('stroke-width', 2)
.style('stroke', 'steelblue')
.style('fill', 'none');
}
}
});
Regards,
paragasu
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel