react-force-graph
react-force-graph copied to clipboard
Custom Material given to linkMaterial not used
Not sure if this is a bug or if I misunderstand the property. It seems as the custom material given to linkMaterial is not used.
Example:
<ForceGraph3D
graphData={data}
nodeLabel="id"
linkWidth={edge => 3}
linkMaterial={link => {
new MeshLambertMaterial({
color: Math.random() * 0xffffff,
opacity: 1,
transparent: true
});
}}
/>
Output:
CodeSandbox: https://codesandbox.io/s/link-material-3cuz1?file=/src/index.js:805-809
@HansvdLaan you're not returning anything in your linkMaterial
function. If you change it to the following it should start working. 😃
linkMaterial={link => {
return new MeshLambertMaterial({
color: Math.random() * 0xffffff,
opacity: 1,
transparent: true
});
}}
.... 🤦♂️
Thanks!