how to use force-graph in angular?

Discussão em 'Angular' iniciado por MengYunlong, Outubro 29, 2024.

  1. MengYunlong

    MengYunlong Guest

    how to use force-graph in angular?

    I'm trying to use force graph in angular8,but i not found angular force graph package in NPM,

    I tried the following: 1、install depend

    npm install d3 --save npm install @types/d3 --save npm install force-graph --save

    2、 import ForceGraph

    import ForceGraph from "force-graph";

    3、used in my code this.graph = ForceGraph()(chartHtml);

    However, an error was reported during compilation

    ERROR in ./node_modules/force-graph/dist/force-graph.mjs 1212:94-100 Can't import the named export 'Easing' from non EcmaScript module (only default export is available) ERROR in ./node_modules/force-graph/dist/force-graph.mjs 1249:40-46 Can't import the named export 'Easing' from non EcmaScript module (only default export is available) ERROR in ./node_modules/force-graph/dist/force-graph.mjs 1345:22-27 Can't import the named export 'Group' from non EcmaScript module (only default export is available) ERROR in ./node_modules/force-graph/dist/force-graph.mjs 1212:35-40 Can't import the named export 'Tween' from non EcmaScript module (only default export is available) ERROR in ./node_modules/force-graph/dist/force-graph.mjs 1245:35-40 Can't import the named export 'Tween' from non EcmaScript module (only default export is available)

    I don't know how to solve, hope to get your help

    Continue reading...

Compartilhe esta Página