Skip to content

Commit

Permalink
included the source and target of node
Browse files Browse the repository at this point in the history
  • Loading branch information
m-o-n-i-s-h committed Aug 16, 2023
1 parent 05c400b commit c294ad7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/chart/graph/util/NodeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ export const parseNodeIconConfig = (iconStyle) => {
}
};

const getTitleOfNodes = (entity: any, sourceOrTarget: string) => {
return entity[sourceOrTarget]?.properties?.title
}

export const getEntityHeader = (entity) => {
return (entity.labels && entity.labels.join(', ')) || entity.type;
return entity.labels && `${getTitleOfNodes(entity, 'source')} >> ${entity.labels.join(', ')} >> ${getTitleOfNodes(entity, 'target')}`
|| `${entity.type} (${getTitleOfNodes(entity, 'source')} --> ${getTitleOfNodes(entity, 'target')})`;
};

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

0 comments on commit c294ad7

Please sign in to comment.