Skip to content

Commit b0dae7a

Browse files
briantangMarkLogic Builder
authored andcommitted
DHFPROD-8813: Modeling Graph Entity Physics
1 parent 7cc351d commit b0dae7a

File tree

1 file changed

+7
-3
lines changed
  • marklogic-data-hub-central/ui/src/components/modeling/graph-view/graph-vis

1 file changed

+7
-3
lines changed

marklogic-data-hub-central/ui/src/components/modeling/graph-view/graph-vis/graph-vis.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,18 @@ const GraphVis: React.FC<Props> = (props) => {
6969

7070
const coordinatesExist = () => {
7171
let coordsExist = true;
72+
let newNodeCounter = 0;
7273
if (entitiesConfigExist(props.hubCentralConfig)) {
7374
let allEntityCoordinates = props.hubCentralConfig["modeling"]["entities"];
7475
for (const entity of props.entityTypes) {
7576
if (!allEntityCoordinates[entity.entityName]) {
76-
coordsExist = false;
77-
break;
77+
//count number of new nodes, if they only added one, no need for physics to stabilize entire graph on line 184
78+
newNodeCounter = newNodeCounter + 1;
7879
}
7980
}
81+
if (newNodeCounter > 2) {
82+
coordsExist = false;
83+
}
8084
} else {
8185
coordsExist = false;
8286
}
@@ -642,7 +646,7 @@ const GraphVis: React.FC<Props> = (props) => {
642646
physics: {
643647
enabled: physicsEnabled,
644648
barnesHut: {
645-
springLength: 160,
649+
springLength: 200,
646650
springConstant: 1,
647651
avoidOverlap: 1
648652
},

0 commit comments

Comments
 (0)