diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index 08cc6ae46f..3b2d0cf3ca 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -126,6 +126,11 @@ class GraphView extends ChartView { const idx = node.dataIndex; const el = node.getGraphicEl() as Symbol; const itemModel = node.getModel(); + + if (!el) { + return; + } + // Update draggable el.off('drag').off('dragend'); const draggable = itemModel.get('draggable'); @@ -158,6 +163,10 @@ class GraphView extends ChartView { const el = edge.getGraphicEl() as Line; const focus = edge.getModel().get(['emphasis', 'focus']); + if (!el) { + return; + } + if (focus === 'adjacency') { getECData(el).focus = { edge: [edge.dataIndex], @@ -288,7 +297,7 @@ class GraphView extends ChartView { const nodeScale = getNodeGlobalScale(seriesModel); data.eachItemGraphicEl(function (el: Symbol, idx) { - el.setSymbolScale(nodeScale); + el && el.setSymbolScale(nodeScale); }); } diff --git a/test/graph-case.html b/test/graph-case.html new file mode 100644 index 0000000000..e6d311b41c --- /dev/null +++ b/test/graph-case.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +