From 1e9b43e28bd7f997a375e940c0372f5ce5b2e617 Mon Sep 17 00:00:00 2001 From: pissang Date: Sun, 11 Jun 2017 22:06:57 +0800 Subject: [PATCH] Fix fixed property in nodes not work bug. Fix #5966 --- src/chart/graph/forceLayout.js | 1 + test/force3.html | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/chart/graph/forceLayout.js b/src/chart/graph/forceLayout.js index 9e8370488..10464a531 100644 --- a/src/chart/graph/forceLayout.js +++ b/src/chart/graph/forceLayout.js @@ -57,6 +57,7 @@ define(function (require) { return { w: rep, rep: rep, + fixed: nodeData.getItemModel(idx).get('fixed'), p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point }; }); diff --git a/test/force3.html b/test/force3.html index aa80e551c..d8112bd78 100644 --- a/test/force3.html +++ b/test/force3.html @@ -35,7 +35,13 @@ renderer: 'canvas' }); - var data = []; + var data = [{ + fixed: true, + x: chart.getWidth() / 2, + y: chart.getHeight() / 2, + symbolSize: 20, + id: '-1' + }]; var edges = []; chart.setOption({ series: [{ -- GitLab