在创建树形图时,我在Angular 6中遇到问题!我正在关注d3plus的官方文档,但是我找不到如何在Angular 6中包含d3plus库。
出现此错误:
./ node_modules / d3plus / es / index.js中的错误
找不到模块:错误:无法解析'E:\ angularspringboot \ msspd-client \ node_modules \ d3plus \ es'中的'./build/package'
import * as d3plus from "d3plus";
this.sample_data = [
{"value": 100, "name": "alpha", "group": "group 1"},
{"value": 70, "name": "beta", "group": "group 2"},
{"value": 40, "name": "gamma", "group": "group 2"},
{"value": 15, "name": "delta", "group": "group 2"},
{"value": 5, "name": "epsilon", "group": "group 1"},
{"value": 1, "name": "zeta", "group": "group 1"}
];
d3plus.viz()
.container("#viz") // container DIV to hold the visualization
.data(this.sample_data) // data to use with the visualization
.type("tree_map") // visualization type
.id("name") // key for which our data is unique on
.size("value") // sizing of blocks
.draw() ;