Skip to content

Commit 33f2c1e

Browse files
committed
Improve robustness for edge header title
1 parent b7a03c6 commit 33f2c1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chart/graph/util/NodeUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ const getSelectedNodeProperty = (entity: any, sourceOrTarget: string, propertySe
3636
}
3737
};
3838

39-
const getEdgeHelper = (entity: any, selection: any) => {
39+
const getRelPatternString = (entity: any, selection: any) => {
4040
const sourceTitle = getSelectedNodeProperty(entity, 'source', selection);
4141
const targetTitle = getSelectedNodeProperty(entity, 'target', selection);
42-
return `(${sourceTitle} --> ${targetTitle})`;
42+
return `(${sourceTitle ? sourceTitle : '[no value]'} --> ${targetTitle ? targetTitle : '[no value]'})`;
4343
};
4444

4545
export const getEntityHeader = (entity: any, selection: any) => {
46-
return entity.labels?.join(', ') || `${entity.type} ${getEdgeHelper(entity, selection)}`;
46+
return entity.labels?.join(', ') || `${entity.type} ${getRelPatternString(entity, selection)}`;
4747
};
4848

4949
export const drawDataURIOnCanvas = (node, strDataURI, canvas, defaultNodeSize) => {

0 commit comments

Comments
 (0)