Skip to content

Commit

Permalink
Add suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Nov 8, 2024
1 parent e7b9366 commit 410f1d0
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,27 +248,20 @@ export default function transformProps(
}
const sourceName = link[source] as string;
const targetName = link[target] as string;
let sourceCategoryName;
let targetCategoryName;
let sourceNodeColor = colorFn('node');
let targetNodeColor = colorFn('node');
const sourceCategoryName = sourceCategory
? getCategoryName(sourceCategory, link[sourceCategory])
: undefined;
const targetCategoryName = targetCategory
? getCategoryName(targetCategory, link[targetCategory])
: undefined;
const sourceNodeColor = sourceCategoryName
? colorFn(sourceCategoryName)
: colorFn('node');
const targetNodeColor = targetCategoryName
? colorFn(targetCategoryName)
: colorFn('node');
const linkColor = colorFn('link');

if (sourceCategory) {
sourceCategoryName = getCategoryName(
sourceCategory,
link[sourceCategory],
);
sourceNodeColor = colorFn(sourceCategoryName);
}
if (targetCategory) {
targetCategoryName = getCategoryName(
targetCategory,
link[targetCategory],
);
targetNodeColor = colorFn(targetCategoryName);
}

const sourceNode = getOrCreateNode(
sourceName,
source,
Expand Down

0 comments on commit 410f1d0

Please sign in to comment.