question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with example and v.2.6.0

See original GitHub issue

Describe the bug I have an issue with link force not correctly working. After a few hours, I’ve decided to copy-pasta the data & the configuration from your example here to see if the issue was coming from my data : https://danielcaldas.github.io/react-d3-graph/sandbox/index.html?data=marvel

Here is what I’ve copied :

default.config.js :

module.exports = {
  automaticRearrangeAfterDropNode: true,
  collapsible: true,
  directed: true,
  focusAnimationDuration: 0.75,
  focusZoom: 1,
  freezeAllDragEvents: false,
  height: 400,
  highlightDegree: 2,
  highlightOpacity: 0.2,
  linkHighlightBehavior: true,
  maxZoom: 12,
  minZoom: 0.05,
  nodeHighlightBehavior: true,
  panAndZoom: false,
  staticGraph: false,
  staticGraphWithDragAndDrop: false,
  width: 800,
  d3: {
    alphaTarget: 0.05,
    gravity: -250,
    linkLength: 120,
    linkStrength: 2,
    disableLinkForce: false,
  },
  node: {
    color: "#d3d3d3",
    fontColor: "black",
    fontSize: 10,
    fontWeight: "normal",
    highlightColor: "red",
    highlightFontSize: 14,
    highlightFontWeight: "bold",
    highlightStrokeColor: "red",
    highlightStrokeWidth: 1.5,
    mouseCursor: "crosshair",
    opacity: 0.9,
    renderLabel: true,
    size: 200,
    strokeColor: "none",
    strokeWidth: 1.5,
    svg: "",
    symbolType: "circle",
  },
  link: {
    color: "lightgray",
    fontColor: "black",
    fontSize: 8,
    fontWeight: "normal",
    highlightColor: "red",
    highlightFontSize: 8,
    highlightFontWeight: "normal",
    labelProperty: "label",
    mouseCursor: "pointer",
    opacity: 1,
    renderLabel: false,
    semanticStrokeWidth: true,
    strokeWidth: 3,
    markerHeight: 6,
    markerWidth: 6,
    strokeDasharray: 0,
    strokeDashoffset: 0,
    strokeLinecap: "butt",
  },
};
const config = require("default.config.js");
const data = {
    nodes: [
      {
        id: "Marvel",
        svg: "http://marvel-force-chart.surge.sh/marvel_force_chart_img/marvel.png",
        size: 500,
      },
      ...
   }, links: [
      {
        source: "Marvel",
        target: "Heroes",
      },
      {
        source: "Marvel",
        target: "Villains",
      },
    ....
    },
   ]
};
...

return <div>
....
<Graph
        id="graph-id"
        ref={graphRef}
        data={data}
        config={config}
      />
</div>

With the exact same parameters as in the example, I’ve noticed all the nodes were displayed at the exact same spot. issue0

Then, I commented the property disableLinkForce: false,

And all the nodes started to appear in circle, which isn’t what i want (not same as in example provided in the link above). issue

Any clues what’s happening ?

Expected behavior Having the same result with grouped nodes, and gravity propertly working.

Environment:

  • OS: Windows
  • Browser Chrome
  • Version 89.0.4389.90
  • Node version 14.8.0
  • react-d3-graph version 2.6.0
  • d3 version 5.14.2
  • react version 16.11.0

Thanks for your future help !

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
oshhhcommented, Apr 25, 2021

@danielcaldas @antoninklopp any progress on this issue?

0reactions
ArnaudRibcommented, Apr 14, 2021

@antoninklopp @danielcaldas By the way, there also seems to be an issue with the useState and graph rendering.

In the sandbox, add

  const [test, setTest] = useState();
  useEffect(() => {
    setTest("hello world");
  }, []);

right below function App() {

And the graph will be completely messed up…

Sandbox forked with the issue : https://codesandbox.io/s/react-d3-graph-demo-forked-sf17b?file=/index.js:240-257

Capture Capture2

Read more comments on GitHub >

github_iconTop Results From Across the Web

MRTK 2.6 release notes - Mixed Reality - Microsoft Learn
This issue is fixed by updating Visual Studio 2019 to version 16.8 or later. If you are unable to update Visual Studio, please...
Read more >
changelist_2_0.txt - HSQLDB
version 2.6.0 main jar contains the module org.hsqldb and can be used as a ... Timestamp values -- fixed several minor issues --...
Read more >
Apache Hadoop 2.6.0 - MapReduce Tutorial
This document comprehensively describes all user-facing facets of the Hadoop MapReduce framework and serves as a tutorial.
Read more >
OpenDJ 2.6 > Installation Guide - ForgeRock Backstage
This guide shows you how to install OpenDJ directory services. The OpenDJ project offers open source LDAP directory services in Java.
Read more >
Trouble with installing cocoapods | Apple Developer Forums
You have to install development tools first. from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found