Repository navigation
Is there a way to access arbitrary node data inside MiniMap nodeComponent prop? #5430
Replies: 1 comment
|
Checked this against the MiniMap source ( So your workaround isn't really a workaround, it's the intended mechanism, <MiniMap
nodeColor={(node) => node.data.active ? 'blue' : 'transparent'}
nodeStrokeColor={(node) => node.data.active ? 'transparent' : 'blue'}
nodeComponent={({ x, y, color, strokeColor }) => (
<circle r={50} fill={color} stroke={strokeColor} strokeWidth={10} cx={x} cy={y} />
)}
/>That mirrors exactly what your current code does through a single |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to use arbitrary data to change the look of nodes in the mini map, something like this:
As a workaround I'm passing a custom
nodeColorand using that conditionally insidenodeComponent.Is there a better way to achieve this?
All reactions