因此,如果的package.json您已经有喜欢的依赖性:
"dependencies": {
...
"d3": "^3.5.17",
...
}
然后你可以在/tools/config/seed.config.ts,并添加去 'D3': '$ {this.NPM_BASE} D3/d3.min.js'在SYSTEM_CONFIG_DEV对象,如:
protected SYSTEM_CONFIG_DEV: any = {
defaultJSExtensions: true,
packageConfigPaths: [
`${this.NPM_BASE}*/package.json`,
`${this.NPM_BASE}**/package.json`,
`${this.NPM_BASE}@angular/*/package.json`
],
paths: {
[this.BOOTSTRAP_MODULE]: `${this.APP_BASE}${this.BOOTSTRAP_MODULE}`,
'@angular/core': `${this.NPM_BASE}@angular/core/bundles/core.umd.js`,
'@angular/common': `${this.NPM_BASE}@angular/common/bundles/common.umd.js`,
'@angular/compiler': `${this.NPM_BASE}@angular/compiler/bundles/compiler.umd.js`,
'@angular/forms': `${this.NPM_BASE}@angular/forms/bundles/forms.umd.js`,
'@angular/http': `${this.NPM_BASE}@angular/http/bundles/http.umd.js`,
'@angular/router': `${this.NPM_BASE}@angular/router/index.js`,
'@angular/platform-browser': `${this.NPM_BASE}@angular/platform-browser/bundles/platform-browser.umd.js`,
'@angular/platform-browser-dynamic': `${this.NPM_BASE}@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js`,
'rxjs/*': `${this.NPM_BASE}rxjs/*`,
'd3': '${this.NPM_BASE}d3/d3.min.js',
'app/*': `/app/*`,
'*': `${this.NPM_BASE}*`
},
packages: {
rxjs: { defaultExtension: false }
}
让我知道它是否有帮助。谢谢!
你能否尝试从[这里]下载软件包(https://www.npmjs。com/package/ng2-nvd3) –
我安装了它,设置了discreteBarChart演示程序,但它在浏览器中完全不显示,尽管没有浏览器错误,没有编译器错误。但是在我将更多的时间投入NG2-NVD3工作之前,我最好停下来:由于我需要构建高度自定义的可视化,NVD3对我来说不会有多大用处。 – Devaro