Use the echarts force-oriented diagram to report to TypeError Cannot read property off of undefined

use echats force-oriented diagram to report to TypeError Cannot read property off of undefined

change the configuration (vue environment) in series

related codes

{

                    // name: "Les Miserables",
                    type: "graph",
                    layout: "force",   //**none**
                    data: this.graph.nodes,
                    links: this.graph.links,
                    categories: this.categories,
                    // draggable: true,
                    roam: true,
                    // symbolSize: 30,
                    edgeLength: [100,1000],
                    edgeSymbol: ["none", "arrow"],       //
                    focusNodeAdjacency: true,
                    itemStyle: {                  //
                        normal: {                  //
                            borderColor: "-sharpfff",
                            borderWidth: 1,
                            shadowBlur: 10,
                            shadowColor: "rgba(0, 0, 0, 0.3)",
                            fontSize: "8px"
                        }
                    },
                    ...

The

figure does not come out, and the above error is reported, and fixed: true, will also report the above error when locating a node in it. Is it related to the vue framework

?
Oct.09,2021

when the layout is none, the initial coordinates are set for the node, but an error is still reported, and the graph can be displayed normally


you try it.
force: {

    edgeLength: [100,1000],

},


does not know the specific reason, but the test result is as the subject said. This error will occur when layout: 'none' , but not force/circular .
but I stumbled upon the addition of coordinateSystem: 'cartesian2d' also solved this error.

Menu