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<
194
194
? ( id ?: string ) => id && fullGraph . source ( id )
195
195
: ( id ?: string ) => id && fullGraph . target ( id ) ;
196
196
197
- if ( getNodeColor && nodesColor . type !== "data" )
197
+ if ( getNodeColor ) {
198
+ const nodesValues = mergeStaticDynamicData ( nodeData , dynamicNodeData ) ;
198
199
getColor = ( _ , edgeId ?: string ) => {
199
200
const node = nodeForColor ( edgeId ) ;
200
- return node ? getNodeColor ( itemsValues [ node ] ) : DEFAULT_NODE_COLOR ;
201
+ return node ? getNodeColor ( nodesValues [ node ] ) : DEFAULT_NODE_COLOR ;
201
202
} ;
202
- else if ( nodesColor . type === "data" )
203
+ } else if ( nodesColor . type === "data" ) {
203
204
// special case when node are colored by data have to reach nodeRenderingData instead of normal getNodeColor
204
205
getColor = ( _ , edgeId ?: string ) => {
205
206
const node = nodeForColor ( edgeId ) ;
206
207
return node && nodeRenderingData [ node ] && nodeRenderingData [ node ] . color
207
208
? nodeRenderingData [ node ] . color || DEFAULT_NODE_COLOR
208
209
: DEFAULT_NODE_COLOR ;
209
210
} ;
210
- else getColor = ( ) => DEFAULT_EDGE_COLOR ;
211
+ } else {
212
+ getColor = ( ) => DEFAULT_EDGE_COLOR ;
213
+ }
211
214
}
212
215
213
216
if ( getColor && shadingDef ) {
You can’t perform that action at this time.
0 commit comments