File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/gephi-lite/src/core/appearance Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -194,20 +194,23 @@ export function makeGetColor<
194194 ? ( id ?: string ) => id && fullGraph . source ( id )
195195 : ( id ?: string ) => id && fullGraph . target ( id ) ;
196196
197- if ( getNodeColor && nodesColor . type !== "data" )
197+ if ( getNodeColor ) {
198+ const nodesValues = mergeStaticDynamicData ( nodeData , dynamicNodeData ) ;
198199 getColor = ( _ , edgeId ?: string ) => {
199200 const node = nodeForColor ( edgeId ) ;
200- return node ? getNodeColor ( itemsValues [ node ] ) : DEFAULT_NODE_COLOR ;
201+ return node ? getNodeColor ( nodesValues [ node ] ) : DEFAULT_NODE_COLOR ;
201202 } ;
202- else if ( nodesColor . type === "data" )
203+ } else if ( nodesColor . type === "data" ) {
203204 // special case when node are colored by data have to reach nodeRenderingData instead of normal getNodeColor
204205 getColor = ( _ , edgeId ?: string ) => {
205206 const node = nodeForColor ( edgeId ) ;
206207 return node && nodeRenderingData [ node ] && nodeRenderingData [ node ] . color
207208 ? nodeRenderingData [ node ] . color || DEFAULT_NODE_COLOR
208209 : DEFAULT_NODE_COLOR ;
209210 } ;
210- else getColor = ( ) => DEFAULT_EDGE_COLOR ;
211+ } else {
212+ getColor = ( ) => DEFAULT_EDGE_COLOR ;
213+ }
211214 }
212215
213216 if ( getColor && shadingDef ) {
You can’t perform that action at this time.
0 commit comments