Lode Diagram Shape

I tried to implement some diagram with shapes from https://ej2.syncfusion.com/react/documentation/diagram/shapes/ but the shapes dosent seem to appear. I am trying to return the DiagramComponent as a functional class in React to display diagram with shapes. I am using javascript to do so.


Attached is the functional class i tried to export.


Attachment: FunctionBlock_34bc127c.zip

3 Replies

AR Aravind Ravi Syncfusion Team May 12, 2022 01:01 PM UTC

Hi Breandon,


We have created a react functional component sample to render shapes. Please find the sample in below link


Sample: https://stackblitz.com/edit/react-x9nxdx?file=index.js


Regards

Aravind Ravi



BR Breandon May 13, 2022 12:02 AM UTC

Hi Aravind Ravi,


Thank you. Just a couple of questions

1) The samplebase js being imported is not actually used right?

2) Suppose I want to put the functional component in another class, where would I put the "document.getElement..." in line 76?


Because right now it still did'nt really work for me

Regards,

Breandon



AR Aravind Ravi Syncfusion Team May 13, 2022 07:44 AM UTC

Hi Breandon,

Please find the response for queries in below table


The samplebase js being imported is not actually used right?

Yes, the samplebase is not used in the sample. You can remove the samplebase from the sample.

 

Suppose I want to put the functional component in another class, where would I put the "document.getElement..." in line 76?

After you define the functional component in another class at last define the rendering part. Without using the render function we cannot able to render the react component. In the render function, you need to pass the component that you need to render and where the component should be rendered. Please refer to the below code snippet

 

//index.html

<body class="bootstrap5">

    <div id='sample'>

</body>

 

//index.js

render(<DiagramControl />, document.getElementById('sample'));

 

In the above code snippet, in HTML we have rendered a sample div. In the index.js file, we have passed the DiagramControl component and sample div , in that div we want to render the component


Regards

Aravind Ravi 


Loader.
Up arrow icon