Skip to content

Commit

Permalink
#5237 Fix for issue from failing test, self loops to/from clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jul 18, 2024
1 parent 15c85ef commit 63850fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export const adjustClustersAndEdges = (graph, depth) => {
domId: specialId1,
id: specialId1,
labelStyle: '',
label: edge.label,
label: '',
padding: 0,
shape: 'labelRect',
style: '',
Expand All @@ -342,14 +342,16 @@ export const adjustClustersAndEdges = (graph, depth) => {
const edge2 = structuredClone(edge);
edge1.label = '';
edge1.arrowTypeEnd = 'none';
edge1.id = e.name + '-cyclic-special-1';
edgeMid.arrowTypeEnd = 'none';
edgeMid.id = e.name + '-cyclic-special-mid';
edge2.label = '';
edge1.fromCluster = e.v;
edge2.toCluster = e.v;

graph.setEdge(v, specialId1, edge1, e.name + '-cyclic-special');
graph.setEdge(specialId1, specialId2, edgeMid, e.name + '-cyclic-special');
graph.setEdge(specialId2, w, edge2, e.name + '-cyclic-special');
edge2.id = e.name + '-cyclic-special-2';
graph.setEdge(v, specialId1, edge1, e.name + '-cyclic-special-0');
graph.setEdge(specialId1, specialId2, edgeMid, e.name + '-cyclic-special-1');
graph.setEdge(specialId2, w, edge2, e.name + '-cyclic-special-2');
} else if (clusterDb[e.v] || clusterDb[e.w]) {
log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name);
v = getAnchorId(e.v);
Expand All @@ -375,7 +377,7 @@ export const adjustClustersAndEdges = (graph, depth) => {
log.trace(clusterDb);

// Remove references to extracted cluster
// graph.edges().forEach(edge => {
// graph.edges().forEach((edge) => {
// if (isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId)) {
// graph.removeEdge(edge);
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const labelRect = async (parent: SVGElement, node: Node) => {
const rect = shapeSvg.insert('rect', ':first-child');

// Hide the rect we are only after the label
const totalWidth = 0;
const totalHeight = 0;
const totalWidth = 0.1;
const totalHeight = 0.1;
rect.attr('width', totalWidth).attr('height', totalHeight);
shapeSvg.attr('class', 'label edgeLabel');

Expand All @@ -40,6 +40,8 @@ export const labelRect = async (parent: SVGElement, node: Node) => {
// }

updateNodeBounds(node, rect);
// node.width = 1;
// node.height = 1;

node.intersect = function (point) {
return intersect.rect(node, point);
Expand Down

0 comments on commit 63850fd

Please sign in to comment.