Extjs 如何在Ext.js中使用d3.js图形?

Extjs 如何在Ext.js中使用d3.js图形?,extjs,d3.js,Extjs,D3.js,有人能给我举一个最简单的例子,说明如何将d3.js图形嵌入ext.js吗?我做了很多研究:我甚至不确定这是否可能。还是这样?提前感谢。到目前为止,我使用的OK结果过于简化: Ext.define('desktop.controls.d3svg', { extend: 'Ext.container.Container', alias: 'widget.d3svg', listeners: { added: function() { this.onAdded();

有人能给我举一个最简单的例子,说明如何将d3.js图形嵌入ext.js吗?我做了很多研究:我甚至不确定这是否可能。还是这样?提前感谢。

到目前为止,我使用的OK结果过于简化:

Ext.define('desktop.controls.d3svg', {
extend: 'Ext.container.Container',
alias: 'widget.d3svg',

listeners: {

    added: function() {

        this.onAdded();

    }

},

onAdded: function() {

    // ext container has the outer and inner containers
    // use id for selection of inner container for appending svg
    var svg = d3.select('#' + this.id + '-innerCt').append("svg");

    this.svg = svg;

},

onResize: function(width, height) {

    // on the way to an example of using ext resize event and width
    // and height vars
    // this.svg.do_d3_resize_things.....

}

});

到目前为止,我在OK结果中使用的过于简化的版本:

Ext.define('desktop.controls.d3svg', {
extend: 'Ext.container.Container',
alias: 'widget.d3svg',

listeners: {

    added: function() {

        this.onAdded();

    }

},

onAdded: function() {

    // ext container has the outer and inner containers
    // use id for selection of inner container for appending svg
    var svg = d3.select('#' + this.id + '-innerCt').append("svg");

    this.svg = svg;

},

onResize: function(width, height) {

    // on the way to an example of using ext resize event and width
    // and height vars
    // this.svg.do_d3_resize_things.....

}

});