2 years ago

#36208

test-img

Nicolas Figay

cytoscape-d3-force layout and radial force

I'm experimenting the d3-force layout extension with cytoscape.js at https://observablehq.com/@nfigay/cytoscape-3d-force-layout-testing-for-a-notebook, trying to take advantage of radial force, as shown in the following observable notebook at https://observablehq.com/@nfigay/a-tutorial-to-using-d3-force-from-someone-who-just-learned-ho#radial_sect.

However, despite multiple attempt, I didn't find how to obtain a similar simulation, it seems that a central force applies.

var cy = cytoscape({
    container: document.getElementById("myGraph"),
    layout: {
      name: "d3-force",
      animate: true,
      fixedAfterDragging: false,
      linkId: function id(d) {
        return d.id;
      },
      //linkDistance: 80,
      // manyBodyStrength: -800,
      radialX: 0,
      radialY: 0,
      radialRadius: 200,
      radialStrength: 1,
      //  xStrength: 0.0001,
      //  yStrength: 0.0001,
      //manyBodyStrength: -800,
      //collideRadius: 10,
      //collideStrength: 1,
      fit: false,
      ready: function () {},
      stop: function () {},
      tick: function (progress) {
        console.log("progress - ", progress);
      },
      randomize: false,
      infinite: false
    },

results on a set of nodes what is expected

Did someone already used radial force with this layout successfully?

javascript

cytoscape.js

0 Answers

Your Answer

Accepted video resources