Add node cololr by type feature to node expansion
This commit is contained in:
@@ -330,7 +330,7 @@ const useLightrangeGraph = () => {
|
|||||||
}
|
}
|
||||||
}, [queryLabel, rawGraph, sigmaGraph])
|
}, [queryLabel, rawGraph, sigmaGraph])
|
||||||
|
|
||||||
// Data fetching logic
|
// Graph data fetching logic
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Skip if fetch is already in progress
|
// Skip if fetch is already in progress
|
||||||
if (fetchInProgressRef.current) {
|
if (fetchInProgressRef.current) {
|
||||||
@@ -514,7 +514,8 @@ const useLightrangeGraph = () => {
|
|||||||
for (const node of extendedGraph.nodes) {
|
for (const node of extendedGraph.nodes) {
|
||||||
// Generate random color values
|
// Generate random color values
|
||||||
seedrandom(node.id, { global: true });
|
seedrandom(node.id, { global: true });
|
||||||
const color = randomColor();
|
const nodeEntityType = node.properties?.entity_type as string | undefined;
|
||||||
|
const color = getNodeColorByType(nodeEntityType);
|
||||||
|
|
||||||
// Create a properly typed RawNodeType
|
// Create a properly typed RawNodeType
|
||||||
processedNodes.push({
|
processedNodes.push({
|
||||||
|
Reference in New Issue
Block a user