Skip to content
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

Merged
merged 4 commits into from
Oct 23, 2019

Conversation

TYzzt
Copy link
Contributor

@TYzzt TYzzt commented Oct 21, 2019

@@ -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) {
Copy link
Contributor

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

* @return {module:echarts/data/Graph.Edge}
*/
graphProto.addEdge = function (n1, n2, dataIndex) {
graphProto.addEdge = function (n1, n2, dataIndex, forceIgnore) {
Copy link
Contributor

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.

@@ -0,0 +1,130 @@

Copy link
Contributor

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

@pissang
Copy link
Contributor

pissang commented Oct 22, 2019

Hi @TYzzt . Thanks for your contribution. I've left the comments for change requests.

@TYzzt
Copy link
Contributor Author

TYzzt commented Oct 22, 2019

Thank you for your reply. I have modified the code

@TYzzt
Copy link
Contributor Author

TYzzt commented Oct 23, 2019

@pissang Will this feature be available in the next release?

@pissang pissang added this to the 4.5.0 milestone Oct 23, 2019
@pissang pissang merged commit 1bdb91a into apache:master Oct 23, 2019
@pissang
Copy link
Contributor

pissang commented Oct 23, 2019

@TYzzt Yes, it will be included in 4.5.0. Which will be released at the beginning of next month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants