moving nodeProps object to useEffect hook
@@ -75,6 +75,21 @@ export const GraphView = () => {
}, []);
useEffect(() => {
+ const nodeProps = {
+ shape: 'box',
+ size: 30,
+ margin: {
+ top: 10,
+ bottom: 10,
+ right: 10,
+ left: 10
+ },
+ borderWidth: theme.width,
+ font: {
+ size: 16
+ }
+ };
+
const convertToEdges = (transitions: Transition[]): DataSet<Edge, 'id'> => {
const edges = new DataSet<Edge, 'id'>();
@@ -175,21 +190,6 @@ export const GraphView = () => {
window.open(`${window.location.origin}/apm/editor.html${selectedNode?.script.path}`, '_blank');
};
- const nodeProps = {
- shape: 'box',
- size: 30,
- margin: {
- top: 10,
- bottom: 10,
- right: 10,
- left: 10
- },
- borderWidth: theme.width,
- font: {
- size: 16
- }
- };
-
return <>
<div ref={container} id="graph"/>
</>
