You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/09/17 04:29:43 UTC
[GitHub] [incubator-echarts] zd5043039119 commented on issue #12407: Graph options : TypeError: el is undefined
zd5043039119 commented on issue #12407:
URL: https://github.com/apache/incubator-echarts/issues/12407#issuecomment-693812285
Hi @Ovilia
I believe Jayesh23 means the code in GraphView.js, line 181
```javascript
data.graph.eachEdge(function (edge) {
var el = edge.getGraphicEl();
el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]);
el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]);
if (edge.getModel().get('focusNodeAdjacency')) {
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
graphView._clearTimer();
api.dispatchAction({
type: 'focusNodeAdjacency',
seriesId: seriesModel.id,
edgeDataIndex: edge.dataIndex
});
});
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
graphView._dispatchUnfocus(api);
});
}
});
```
When set the node property fixed = true, it will happens when use the demo
https://echarts.apache.org/examples/zh/editor.html?c=graph-force
and change add 1 line like
```javascript
graph.nodes.forEach(function (node) {
node.itemStyle = null;
node.symbolSize = 10;
node.value = node.symbolSize;
node.category = node.attributes.modularity_class;
// Use random x, y
node.x = node.y = null;
node.draggable = true;
node.fixed = true; // add this line
});
```
it will throw the exception
```
VM186 echarts.min.js:22 Uncaught TypeError: Cannot read property '__focusNodeAdjacency' of undefined
at VM186 echarts.min.js:22
at $_.J_.eachEdge (VM186 echarts.min.js:22)
at e.render (VM186 echarts.min.js:22)
at jh.progress (VM186 echarts.min.js:22)
at ac (VM186 echarts.min.js:22)
at jh.qh.perform (VM186 echarts.min.js:22)
at VM186 echarts.min.js:22
at e.<anonymous> (VM186 echarts.min.js:22)
at Array.forEach (<anonymous>)
at R (VM186 echarts.min.js:22)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org