cytoscape.js - spacing between nodes





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I am using TypeScript to create a cytoscape graph. I am looking for a way to increase the spacing between nodes. I have tried to change the value of spacingFactor, but that did not change anything that I can see.










share|improve this question























  • Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

    – Stephan T.
    Jan 3 at 5:59











  • I edited my answer, please review it and see if it helps :) thx

    – Stephan T.
    Jan 8 at 10:13











  • @StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

    – bdparrish
    Jan 8 at 14:02











  • Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

    – Stephan T.
    Jan 8 at 18:41




















1















I am using TypeScript to create a cytoscape graph. I am looking for a way to increase the spacing between nodes. I have tried to change the value of spacingFactor, but that did not change anything that I can see.










share|improve this question























  • Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

    – Stephan T.
    Jan 3 at 5:59











  • I edited my answer, please review it and see if it helps :) thx

    – Stephan T.
    Jan 8 at 10:13











  • @StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

    – bdparrish
    Jan 8 at 14:02











  • Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

    – Stephan T.
    Jan 8 at 18:41
















1












1








1








I am using TypeScript to create a cytoscape graph. I am looking for a way to increase the spacing between nodes. I have tried to change the value of spacingFactor, but that did not change anything that I can see.










share|improve this question














I am using TypeScript to create a cytoscape graph. I am looking for a way to increase the spacing between nodes. I have tried to change the value of spacingFactor, but that did not change anything that I can see.







typescript cytoscape.js






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 3 at 2:52









bdparrishbdparrish

2,20712446




2,20712446













  • Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

    – Stephan T.
    Jan 3 at 5:59











  • I edited my answer, please review it and see if it helps :) thx

    – Stephan T.
    Jan 8 at 10:13











  • @StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

    – bdparrish
    Jan 8 at 14:02











  • Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

    – Stephan T.
    Jan 8 at 18:41





















  • Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

    – Stephan T.
    Jan 3 at 5:59











  • I edited my answer, please review it and see if it helps :) thx

    – Stephan T.
    Jan 8 at 10:13











  • @StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

    – bdparrish
    Jan 8 at 14:02











  • Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

    – Stephan T.
    Jan 8 at 18:41



















Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

– Stephan T.
Jan 3 at 5:59





Can you give us more information please? Which layout do you use? Do you have a snippet? Thanks :)

– Stephan T.
Jan 3 at 5:59













I edited my answer, please review it and see if it helps :) thx

– Stephan T.
Jan 8 at 10:13





I edited my answer, please review it and see if it helps :) thx

– Stephan T.
Jan 8 at 10:13













@StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

– bdparrish
Jan 8 at 14:02





@StephanT. - None of those suggestions helped. I could not see a significant change in the graph.

– bdparrish
Jan 8 at 14:02













Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

– Stephan T.
Jan 8 at 18:41







Which layout did you test them with? I tested them all with the defined layout myself and it worked for each layout (if you change the values, the graph does change quite a bit). Either you are using another Layout or you use the wrong values...

– Stephan T.
Jan 8 at 18:41














1 Answer
1






active

oldest

votes


















0














It always depends on the layout you use. The following snippet shows you how to use the spacingFactor property, other spacing propertys are found in the official documentation, normally these things are quite easy to find there. If you specify which layout you want, I can also help you with that specific layout.



Dagre:



this.cytoscape.layout({
name: "dagre",
spacingFactor: 12
}).run();


Concentric:



this.cytoscape.layout({
name: "concentric",
minNodeSpacing: 12
}).run();


Cose:



this.cytoscape.layout({
name: 'cose-bilkent',
animate: false,
idealEdgeLength: 200
});


Spread:



this.cytoscape.layout({
name: 'spread',
minDist: 20
});


Klay:



don't use klay






share|improve this answer


























  • I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

    – bdparrish
    Jan 3 at 13:22













  • Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

    – Stephan T.
    Jan 3 at 17:13












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015729%2fcytoscape-js-spacing-between-nodes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














It always depends on the layout you use. The following snippet shows you how to use the spacingFactor property, other spacing propertys are found in the official documentation, normally these things are quite easy to find there. If you specify which layout you want, I can also help you with that specific layout.



Dagre:



this.cytoscape.layout({
name: "dagre",
spacingFactor: 12
}).run();


Concentric:



this.cytoscape.layout({
name: "concentric",
minNodeSpacing: 12
}).run();


Cose:



this.cytoscape.layout({
name: 'cose-bilkent',
animate: false,
idealEdgeLength: 200
});


Spread:



this.cytoscape.layout({
name: 'spread',
minDist: 20
});


Klay:



don't use klay






share|improve this answer


























  • I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

    – bdparrish
    Jan 3 at 13:22













  • Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

    – Stephan T.
    Jan 3 at 17:13
















0














It always depends on the layout you use. The following snippet shows you how to use the spacingFactor property, other spacing propertys are found in the official documentation, normally these things are quite easy to find there. If you specify which layout you want, I can also help you with that specific layout.



Dagre:



this.cytoscape.layout({
name: "dagre",
spacingFactor: 12
}).run();


Concentric:



this.cytoscape.layout({
name: "concentric",
minNodeSpacing: 12
}).run();


Cose:



this.cytoscape.layout({
name: 'cose-bilkent',
animate: false,
idealEdgeLength: 200
});


Spread:



this.cytoscape.layout({
name: 'spread',
minDist: 20
});


Klay:



don't use klay






share|improve this answer


























  • I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

    – bdparrish
    Jan 3 at 13:22













  • Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

    – Stephan T.
    Jan 3 at 17:13














0












0








0







It always depends on the layout you use. The following snippet shows you how to use the spacingFactor property, other spacing propertys are found in the official documentation, normally these things are quite easy to find there. If you specify which layout you want, I can also help you with that specific layout.



Dagre:



this.cytoscape.layout({
name: "dagre",
spacingFactor: 12
}).run();


Concentric:



this.cytoscape.layout({
name: "concentric",
minNodeSpacing: 12
}).run();


Cose:



this.cytoscape.layout({
name: 'cose-bilkent',
animate: false,
idealEdgeLength: 200
});


Spread:



this.cytoscape.layout({
name: 'spread',
minDist: 20
});


Klay:



don't use klay






share|improve this answer















It always depends on the layout you use. The following snippet shows you how to use the spacingFactor property, other spacing propertys are found in the official documentation, normally these things are quite easy to find there. If you specify which layout you want, I can also help you with that specific layout.



Dagre:



this.cytoscape.layout({
name: "dagre",
spacingFactor: 12
}).run();


Concentric:



this.cytoscape.layout({
name: "concentric",
minNodeSpacing: 12
}).run();


Cose:



this.cytoscape.layout({
name: 'cose-bilkent',
animate: false,
idealEdgeLength: 200
});


Spread:



this.cytoscape.layout({
name: 'spread',
minDist: 20
});


Klay:



don't use klay







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 17:35

























answered Jan 3 at 6:03









Stephan T.Stephan T.

1,3151921




1,3151921













  • I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

    – bdparrish
    Jan 3 at 13:22













  • Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

    – Stephan T.
    Jan 3 at 17:13



















  • I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

    – bdparrish
    Jan 3 at 13:22













  • Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

    – Stephan T.
    Jan 3 at 17:13

















I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

– bdparrish
Jan 3 at 13:22







I have tried cose, dagre, spread, concentric, and klay, but none seem to be responding to spacingFactor changes. This is how I am adding it to the code... this.cytoscape.layout({ name: this.layout, spacingFactor: this.spacingFactor }).run();

– bdparrish
Jan 3 at 13:22















Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

– Stephan T.
Jan 3 at 17:13





Well, you have just tried this one property then, dagre for example has a very easy solution to this (rankSep, nodeSep and edgeSep....) I will edit the question with the relevant properties for each of these layouts and remove the code snippet, but this is normally doable by searching through the docs and trying out different properties.

– Stephan T.
Jan 3 at 17:13




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015729%2fcytoscape-js-spacing-between-nodes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith