@@ -140,7 +140,7 @@ export function makeGetColor<
140
140
T extends { itemType : "nodes" ; displayData : NodeDisplayData } | { itemType : "edges" ; displayData : EdgeDisplayData } ,
141
141
> (
142
142
itemType : T [ "itemType" ] ,
143
- { nodeData, edgeData, nodeRenderingData , fullGraph } : GraphDataset ,
143
+ { nodeData, edgeData, fullGraph } : GraphDataset ,
144
144
{ dynamicNodeData, dynamicEdgeData } : DynamicItemData ,
145
145
{ nodesColor, edgesColor, nodesShadingColor, edgesShadingColor } : AppearanceState ,
146
146
getters ?: VisualGetters ,
@@ -194,20 +194,15 @@ 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
- // special case when node are colored by data have to reach nodeRenderingData instead of normal getNodeColor
204
- getColor = ( _ , edgeId ?: string ) => {
205
- const node = nodeForColor ( edgeId ) ;
206
- return node && nodeRenderingData [ node ] && nodeRenderingData [ node ] . color
207
- ? nodeRenderingData [ node ] . color || DEFAULT_NODE_COLOR
208
- : DEFAULT_NODE_COLOR ;
209
- } ;
210
- else getColor = ( ) => DEFAULT_EDGE_COLOR ;
203
+ } else {
204
+ getColor = ( ) => DEFAULT_EDGE_COLOR ;
205
+ }
211
206
}
212
207
213
208
if ( getColor && shadingDef ) {
0 commit comments