Cytoscape Compound node order of insertion The Next CEO of Stack OverflowExample on matching direct children of the parent node in cytoscape.jsCytoscape.js - Is there a way to draw edges on top of compound nodes?Inserting nodes into D3 pack layout (pagination on zoom)Force positions of some nodes with CoSE Bilkent layoutcytoscape.js compound nodes ignoring layout?Grab compound nodes when a child node is grabbed cytoscape.jsCompound nodes layout issues - cytoscape jsCreate hierarchy layout in cytoscape js that allows parent child relationships?Cytoscape.js - how to use one layout for compound nodes and another for children of compound nodesAvoid overlapping compound nodes

How did people program for Consoles with multiple CPUs?

Solving system of ODEs with extra parameter

Make solar eclipses exceedingly rare, but still have new moons

Is French Guiana a (hard) EU border?

Can a Bladesinger Wizard use Bladesong with a Hand Crossbow?

What is the value of α and β in a triangle?

Newlines in BSD sed vs gsed

How to place nodes around a circle from some initial angle?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Writing differences on a blackboard

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Chain wire methods together in Lightning Web Components

Some questions about different axiomatic systems for neighbourhoods

0 rank tensor vs 1D vector

Why is quantifier elimination desirable for a given theory?

Why did CATV standarize in 75 ohms and everyone else in 50?

Why does the flight controls check come before arming the autobrake on the A320?

Can we say or write : "No, it'sn't"?

Can MTA send mail via a relay without being told so?

How a 64-bit process virtual address space is divided in Linux?

Is micro rebar a better way to reinforce concrete than rebar?

Unclear about dynamic binding

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Bartok - Syncopation (1): Meaning of notes in between Grand Staff



Cytoscape Compound node order of insertion



The Next CEO of Stack OverflowExample on matching direct children of the parent node in cytoscape.jsCytoscape.js - Is there a way to draw edges on top of compound nodes?Inserting nodes into D3 pack layout (pagination on zoom)Force positions of some nodes with CoSE Bilkent layoutcytoscape.js compound nodes ignoring layout?Grab compound nodes when a child node is grabbed cytoscape.jsCompound nodes layout issues - cytoscape jsCreate hierarchy layout in cytoscape js that allows parent child relationships?Cytoscape.js - how to use one layout for compound nodes and another for children of compound nodesAvoid overlapping compound nodes










1















I'm working with cytoscape (cola layout) and dynamic (insertion/removal) compound nodes and I was having an issue with parent nodes not displaying correctly. I realised that parent nodes needed to be inserted before child nodes but I'm wondering if there is an easier way to do this because everytime I insert a new node I need to go through my list of existing nodes and resort them to make sure parents are added before children.



Is there a way to set cytoscape to work in to passes so we don't have to sort nodes ? (1- node insertion, 2- draw layout) ?



Thanks for you help










share|improve this question



















  • 1





    Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

    – Stephan T.
    Mar 12 at 7:13
















1















I'm working with cytoscape (cola layout) and dynamic (insertion/removal) compound nodes and I was having an issue with parent nodes not displaying correctly. I realised that parent nodes needed to be inserted before child nodes but I'm wondering if there is an easier way to do this because everytime I insert a new node I need to go through my list of existing nodes and resort them to make sure parents are added before children.



Is there a way to set cytoscape to work in to passes so we don't have to sort nodes ? (1- node insertion, 2- draw layout) ?



Thanks for you help










share|improve this question



















  • 1





    Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

    – Stephan T.
    Mar 12 at 7:13














1












1








1








I'm working with cytoscape (cola layout) and dynamic (insertion/removal) compound nodes and I was having an issue with parent nodes not displaying correctly. I realised that parent nodes needed to be inserted before child nodes but I'm wondering if there is an easier way to do this because everytime I insert a new node I need to go through my list of existing nodes and resort them to make sure parents are added before children.



Is there a way to set cytoscape to work in to passes so we don't have to sort nodes ? (1- node insertion, 2- draw layout) ?



Thanks for you help










share|improve this question
















I'm working with cytoscape (cola layout) and dynamic (insertion/removal) compound nodes and I was having an issue with parent nodes not displaying correctly. I realised that parent nodes needed to be inserted before child nodes but I'm wondering if there is an easier way to do this because everytime I insert a new node I need to go through my list of existing nodes and resort them to make sure parents are added before children.



Is there a way to set cytoscape to work in to passes so we don't have to sort nodes ? (1- node insertion, 2- draw layout) ?



Thanks for you help







nodes parent cytoscape.js






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 12 at 10:35









Stephan T.

1,2951921




1,2951921










asked Mar 8 at 15:32









GpharandGpharand

63




63







  • 1





    Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

    – Stephan T.
    Mar 12 at 7:13













  • 1





    Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

    – Stephan T.
    Mar 12 at 7:13








1




1





Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

– Stephan T.
Mar 12 at 7:13






Hi @Gpharand, can you add your code? We can help you a lot better, if you provide a Minimal, Complete, and Verifiable example. So consider editing your question by adding a snippet. Thanks!

– Stephan T.
Mar 12 at 7:13













3 Answers
3






active

oldest

votes


















1














Just add the elements in one operation rather than several operations.



cy.add(manyEles);


versus



cy.add(ele1);
cy.add(ele2);
// ...
cy.add(eleN);





share|improve this answer























  • I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

    – Gpharand
    Mar 13 at 13:40











  • 1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

    – Gpharand
    Mar 13 at 13:47











  • As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

    – Gpharand
    Mar 17 at 20:43



















0














Ok so here's the code that update/load the data :



updateGraphData(data)
if(data)
this.cy.$('*').remove()
this.cy.add(data)
// this.cy.json(elements: data)

this.cy.makeLayout(ColaConfig.layout).run()
this.cy.resize()
this.cy.zoom(1)
this.cy.center()



and here's what in data :



[ 

"data":
"id":"b0489a7f-1794-3053-6bb5-f4fa5adcc129",
"label":"Kid A",
"conceptType":"Enfant",
"parent":"415f5871-9312-5857-99bc-8a523283ebd9",
"hidden":false,
"deprecated":false
,
"classes":"Enfant"
,

"data":
"id":"415f5871-9312-5857-99bc-8a523283ebd9",
"label":"I'm the parent",
"conceptType":"Parent",
"parent":"",
"hidden":false,
"deprecated":false
,
"classes":"Parent"
,

"data":
"id":"06e76ece-edee-5a55-1492-f4e22b5685d9",
"label":"Kid B",
"conceptType":"Enfant",
"parent":"415f5871-9312-5857-99bc-8a523283ebd9",
"hidden":false,
"deprecated":false
,
"classes":"Enfant"
,

"data":
"id":"415f5871-9312-5857-99bc-8a523283ebd9",
"label":"I'm the parent",
"conceptType":"Parent",
"parent":"",
"hidden":false,
"deprecated":false
,
"classes":"Parent"
,

"data":
"id":"6e65d053-a124-fc44-72b7-8563ee4ca63f",
"label":"Kid C",
"conceptType":"Enfant",
"parent":"415f5871-9312-5857-99bc-8a523283ebd9",
"hidden":false,
"deprecated":false
,
"classes":"Enfant"
,

"data":
"id":"415f5871-9312-5857-99bc-8a523283ebd9",
"label":"I'm the parent",
"conceptType":"Parent",
"parent":"",
"hidden":false,
"deprecated":false
,
"classes":"Parent"
,

"data":
"id":"415f5871-9312-5857-99bc-8a523283ebd9",
"label":"I'm the parent",
"conceptType":"Parent",
"parent":"orphan",
"hidden":false,
"deprecated":false
,
"classes":"Parent"

]


What I get :



What I get when I sort the nodes in my JSON (What I need)






share|improve this answer

























  • You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

    – maxkfranz
    Mar 25 at 15:18











  • Aside: In general on SO, you should update your question with more information rather than adding answers.

    – maxkfranz
    Mar 25 at 15:23


















0














this might help (colaConfig)



export default 
boxSelectionEnabled: true,
autounselectify: false,
userZoomingEnabled: false,
minZoom: 0.3,
maxZoom: 1.5,
wheelSensitivity: 0.1,

layout:
name: 'cola',
directed: false,
fit: false, // on every layout reposition of nodes, fit the viewport
animate: true, // whether to show the layout as it's running
boundingBox: x1:0, y1:0, w:0, h:0 ,
maxSimulationTime: 4000, // max length in ms to run the layout
avoidOverlap: true, // if true, prevents overlap of node bounding boxes
convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops
nodeDimensionsIncludeLabels: false,
// nodeSpacing: 40,//function( edge ) return edge.data('label').length * 5.5,
infinite: false,
refresh: 3, // number of ticks per frame; higher is faster but more jerky
,







share|improve this answer























    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%2f55066378%2fcytoscape-compound-node-order-of-insertion%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Just add the elements in one operation rather than several operations.



    cy.add(manyEles);


    versus



    cy.add(ele1);
    cy.add(ele2);
    // ...
    cy.add(eleN);





    share|improve this answer























    • I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

      – Gpharand
      Mar 13 at 13:40











    • 1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

      – Gpharand
      Mar 13 at 13:47











    • As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

      – Gpharand
      Mar 17 at 20:43
















    1














    Just add the elements in one operation rather than several operations.



    cy.add(manyEles);


    versus



    cy.add(ele1);
    cy.add(ele2);
    // ...
    cy.add(eleN);





    share|improve this answer























    • I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

      – Gpharand
      Mar 13 at 13:40











    • 1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

      – Gpharand
      Mar 13 at 13:47











    • As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

      – Gpharand
      Mar 17 at 20:43














    1












    1








    1







    Just add the elements in one operation rather than several operations.



    cy.add(manyEles);


    versus



    cy.add(ele1);
    cy.add(ele2);
    // ...
    cy.add(eleN);





    share|improve this answer













    Just add the elements in one operation rather than several operations.



    cy.add(manyEles);


    versus



    cy.add(ele1);
    cy.add(ele2);
    // ...
    cy.add(eleN);






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 12 at 19:24









    maxkfranzmaxkfranz

    8,76011626




    8,76011626












    • I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

      – Gpharand
      Mar 13 at 13:40











    • 1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

      – Gpharand
      Mar 13 at 13:47











    • As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

      – Gpharand
      Mar 17 at 20:43


















    • I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

      – Gpharand
      Mar 13 at 13:40











    • 1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

      – Gpharand
      Mar 13 at 13:47











    • As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

      – Gpharand
      Mar 17 at 20:43

















    I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

    – Gpharand
    Mar 13 at 13:40





    I'm actually using cy.json(element: data). I'm assuming that add() does more than just adding elements to the internal list of objects. Does it will check for parent attributes and deal with it ? (I'll provide my code asap)

    – Gpharand
    Mar 13 at 13:40













    1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

    – Gpharand
    Mar 13 at 13:47





    1) if I add a parent of child node that's already there and 2) if I had a child of a parent that already there ?

    – Gpharand
    Mar 13 at 13:47













    As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

    – Gpharand
    Mar 17 at 20:43






    As you can see below I did what you said, but I get the same result. I can sort / filter everything so it works but it feels like I'm redoing something you guys must have already solved ...

    – Gpharand
    Mar 17 at 20:43














    0














    Ok so here's the code that update/load the data :



    updateGraphData(data)
    if(data)
    this.cy.$('*').remove()
    this.cy.add(data)
    // this.cy.json(elements: data)

    this.cy.makeLayout(ColaConfig.layout).run()
    this.cy.resize()
    this.cy.zoom(1)
    this.cy.center()



    and here's what in data :



    [ 

    "data":
    "id":"b0489a7f-1794-3053-6bb5-f4fa5adcc129",
    "label":"Kid A",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"06e76ece-edee-5a55-1492-f4e22b5685d9",
    "label":"Kid B",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"6e65d053-a124-fc44-72b7-8563ee4ca63f",
    "label":"Kid C",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"orphan",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"

    ]


    What I get :



    What I get when I sort the nodes in my JSON (What I need)






    share|improve this answer

























    • You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

      – maxkfranz
      Mar 25 at 15:18











    • Aside: In general on SO, you should update your question with more information rather than adding answers.

      – maxkfranz
      Mar 25 at 15:23















    0














    Ok so here's the code that update/load the data :



    updateGraphData(data)
    if(data)
    this.cy.$('*').remove()
    this.cy.add(data)
    // this.cy.json(elements: data)

    this.cy.makeLayout(ColaConfig.layout).run()
    this.cy.resize()
    this.cy.zoom(1)
    this.cy.center()



    and here's what in data :



    [ 

    "data":
    "id":"b0489a7f-1794-3053-6bb5-f4fa5adcc129",
    "label":"Kid A",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"06e76ece-edee-5a55-1492-f4e22b5685d9",
    "label":"Kid B",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"6e65d053-a124-fc44-72b7-8563ee4ca63f",
    "label":"Kid C",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"orphan",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"

    ]


    What I get :



    What I get when I sort the nodes in my JSON (What I need)






    share|improve this answer

























    • You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

      – maxkfranz
      Mar 25 at 15:18











    • Aside: In general on SO, you should update your question with more information rather than adding answers.

      – maxkfranz
      Mar 25 at 15:23













    0












    0








    0







    Ok so here's the code that update/load the data :



    updateGraphData(data)
    if(data)
    this.cy.$('*').remove()
    this.cy.add(data)
    // this.cy.json(elements: data)

    this.cy.makeLayout(ColaConfig.layout).run()
    this.cy.resize()
    this.cy.zoom(1)
    this.cy.center()



    and here's what in data :



    [ 

    "data":
    "id":"b0489a7f-1794-3053-6bb5-f4fa5adcc129",
    "label":"Kid A",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"06e76ece-edee-5a55-1492-f4e22b5685d9",
    "label":"Kid B",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"6e65d053-a124-fc44-72b7-8563ee4ca63f",
    "label":"Kid C",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"orphan",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"

    ]


    What I get :



    What I get when I sort the nodes in my JSON (What I need)






    share|improve this answer















    Ok so here's the code that update/load the data :



    updateGraphData(data)
    if(data)
    this.cy.$('*').remove()
    this.cy.add(data)
    // this.cy.json(elements: data)

    this.cy.makeLayout(ColaConfig.layout).run()
    this.cy.resize()
    this.cy.zoom(1)
    this.cy.center()



    and here's what in data :



    [ 

    "data":
    "id":"b0489a7f-1794-3053-6bb5-f4fa5adcc129",
    "label":"Kid A",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"06e76ece-edee-5a55-1492-f4e22b5685d9",
    "label":"Kid B",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"6e65d053-a124-fc44-72b7-8563ee4ca63f",
    "label":"Kid C",
    "conceptType":"Enfant",
    "parent":"415f5871-9312-5857-99bc-8a523283ebd9",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Enfant"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"
    ,

    "data":
    "id":"415f5871-9312-5857-99bc-8a523283ebd9",
    "label":"I'm the parent",
    "conceptType":"Parent",
    "parent":"orphan",
    "hidden":false,
    "deprecated":false
    ,
    "classes":"Parent"

    ]


    What I get :



    What I get when I sort the nodes in my JSON (What I need)







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 17 at 20:32

























    answered Mar 17 at 20:25









    GpharandGpharand

    63




    63












    • You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

      – maxkfranz
      Mar 25 at 15:18











    • Aside: In general on SO, you should update your question with more information rather than adding answers.

      – maxkfranz
      Mar 25 at 15:23

















    • You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

      – maxkfranz
      Mar 25 at 15:18











    • Aside: In general on SO, you should update your question with more information rather than adding answers.

      – maxkfranz
      Mar 25 at 15:23
















    You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

    – maxkfranz
    Mar 25 at 15:18





    You have duplicate IDs and invalid parent values. The empty string is not a valid ID.

    – maxkfranz
    Mar 25 at 15:18













    Aside: In general on SO, you should update your question with more information rather than adding answers.

    – maxkfranz
    Mar 25 at 15:23





    Aside: In general on SO, you should update your question with more information rather than adding answers.

    – maxkfranz
    Mar 25 at 15:23











    0














    this might help (colaConfig)



    export default 
    boxSelectionEnabled: true,
    autounselectify: false,
    userZoomingEnabled: false,
    minZoom: 0.3,
    maxZoom: 1.5,
    wheelSensitivity: 0.1,

    layout:
    name: 'cola',
    directed: false,
    fit: false, // on every layout reposition of nodes, fit the viewport
    animate: true, // whether to show the layout as it's running
    boundingBox: x1:0, y1:0, w:0, h:0 ,
    maxSimulationTime: 4000, // max length in ms to run the layout
    avoidOverlap: true, // if true, prevents overlap of node bounding boxes
    convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops
    nodeDimensionsIncludeLabels: false,
    // nodeSpacing: 40,//function( edge ) return edge.data('label').length * 5.5,
    infinite: false,
    refresh: 3, // number of ticks per frame; higher is faster but more jerky
    ,







    share|improve this answer



























      0














      this might help (colaConfig)



      export default 
      boxSelectionEnabled: true,
      autounselectify: false,
      userZoomingEnabled: false,
      minZoom: 0.3,
      maxZoom: 1.5,
      wheelSensitivity: 0.1,

      layout:
      name: 'cola',
      directed: false,
      fit: false, // on every layout reposition of nodes, fit the viewport
      animate: true, // whether to show the layout as it's running
      boundingBox: x1:0, y1:0, w:0, h:0 ,
      maxSimulationTime: 4000, // max length in ms to run the layout
      avoidOverlap: true, // if true, prevents overlap of node bounding boxes
      convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops
      nodeDimensionsIncludeLabels: false,
      // nodeSpacing: 40,//function( edge ) return edge.data('label').length * 5.5,
      infinite: false,
      refresh: 3, // number of ticks per frame; higher is faster but more jerky
      ,







      share|improve this answer

























        0












        0








        0







        this might help (colaConfig)



        export default 
        boxSelectionEnabled: true,
        autounselectify: false,
        userZoomingEnabled: false,
        minZoom: 0.3,
        maxZoom: 1.5,
        wheelSensitivity: 0.1,

        layout:
        name: 'cola',
        directed: false,
        fit: false, // on every layout reposition of nodes, fit the viewport
        animate: true, // whether to show the layout as it's running
        boundingBox: x1:0, y1:0, w:0, h:0 ,
        maxSimulationTime: 4000, // max length in ms to run the layout
        avoidOverlap: true, // if true, prevents overlap of node bounding boxes
        convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops
        nodeDimensionsIncludeLabels: false,
        // nodeSpacing: 40,//function( edge ) return edge.data('label').length * 5.5,
        infinite: false,
        refresh: 3, // number of ticks per frame; higher is faster but more jerky
        ,







        share|improve this answer













        this might help (colaConfig)



        export default 
        boxSelectionEnabled: true,
        autounselectify: false,
        userZoomingEnabled: false,
        minZoom: 0.3,
        maxZoom: 1.5,
        wheelSensitivity: 0.1,

        layout:
        name: 'cola',
        directed: false,
        fit: false, // on every layout reposition of nodes, fit the viewport
        animate: true, // whether to show the layout as it's running
        boundingBox: x1:0, y1:0, w:0, h:0 ,
        maxSimulationTime: 4000, // max length in ms to run the layout
        avoidOverlap: true, // if true, prevents overlap of node bounding boxes
        convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops
        nodeDimensionsIncludeLabels: false,
        // nodeSpacing: 40,//function( edge ) return edge.data('label').length * 5.5,
        infinite: false,
        refresh: 3, // number of ticks per frame; higher is faster but more jerky
        ,








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 18 at 13:24









        GpharandGpharand

        63




        63



























            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%2f55066378%2fcytoscape-compound-node-order-of-insertion%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

            How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229