-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix-11422 关系图边增加forceIgnore属性,不参加节点位置计算 #11445
Conversation
src/chart/graph/forceHelper.js
Outdated
@@ -95,6 +95,9 @@ export function forceLayout(nodes, edges, opts) { | |||
var nLen = nodes.length; | |||
for (var i = 0; i < edges.length; i++) { | |||
var e = edges[i]; | |||
if (e.forceIgnore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested using ignoreFoceLayout
instead of forceIgnore
src/data/Graph.js
Outdated
* @return {module:echarts/data/Graph.Edge} | ||
*/ | ||
graphProto.addEdge = function (n1, n2, dataIndex) { | ||
graphProto.addEdge = function (n1, n2, dataIndex, forceIgnore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data used in forceHelper is initialized
https://github.com/apache/incubator-echarts/blob/master/src/chart/graph/forceLayout.js#L90
There is no need to store this ignoreFoceLayout
property in the Graph structure.
test/graph-force.html
Outdated
@@ -0,0 +1,130 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a more specific name to describe what test scene this is created for. Like force-edge-ignoreLayout.html
Hi @TYzzt . Thanks for your contribution. I've left the comments for change requests. |
Thank you for your reply. I have modified the code |
@pissang Will this feature be available in the next release? |
@TYzzt Yes, it will be included in 4.5.0. Which will be released at the beginning of next month |
#11422