Set borderRadius for nodes in react-diagram

    I want to set the borderRadius = 10px for nodes, how do I do that, I'm using the DiagramComponent from @syncfusion/ej2-react-diagrams ?

Image_4120_1694669481561

2 Replies

BM Balasubramanian Manikandan Syncfusion Team September 15, 2023 01:32 PM UTC

We will validate and update with more details on sept 20th, 2023.



BM Balasubramanian Manikandan Syncfusion Team September 20, 2023 09:21 AM UTC

Set the width and height for the nodes in 'nodeDefaults,' and then specify the 'cornerRadius' for the shape. This will fulfill your requirement. We have rendered a sample and attached a code example and a sample below for your reference.


Code Snippet

  //sets node default value

  function nodeDefaults(obj, diagram) {

    obj.style = { fill: '#916DAF', strokeColor: 'none' };

    obj.annotations = [{ content: obj.data.Name, style: { color: 'white' } }];

    obj.height = 30;

    obj.width = 75;

    obj.shape.cornerRadius = 10;

    return obj;

  }


Sample

https://stackblitz.com/edit/react-ex1ggw-vj3kuo?file=index.js


Loader.
Up arrow icon