我正在尝试将交互式d3气泡图与angular 7集成在一起,但是在构建示例应用程序时,我总是可以得到
module not found error can't resolve 'd3' in '.../Angular_Example/angular-d3-graph-example-master/src/app/d3'
请帮助我,谢谢
import { Node, Link, ForceDirectedGraph } from './models';
import * as d3 from 'd3';
@Injectable()
export class D3Service {
constructor() { }
applyZoomableBehaviour(svgElement, containerElement) {
let svg, container, zoomed, zoom;
svg = d3.select(svgElement);
container = d3.select(containerElement);
zoomed = () => {
}
applyDraggableBehaviour(element, node: Node, graph: ForceDirectedGraph) {
}
}
getForceDirectedGraph(nodes: Node[], links: Link[], options: { width, height }) {
const sg = new ForceDirectedGraph(nodes, links, options);
return sg;
}
}
考虑到@mayuringole的反馈,以下是步骤: