I suspect this is because the LegendNode is looking in the wrong place on the context. It always checks legend.node instead of legend['bindType']. See here.
Sandbox - https://codesandbox.io/s/legend-bug-repro-3mk71p?file=/App.tsx
You can see that when the bindType is edge there is an exception thrown. But if you set that same value to node then things go smoothly.
As mentioned before, that seems related to this line here.
Expected behavior
Should be able to render the same way in the DOM for both Nodes & Edges.
Describe the bug
When I pass the BindType='edge' into the Legend control, it throws an exception.
TypeError: Cannot read properties of undefined (reading 'options')
Example
I suspect this is because the LegendNode is looking in the wrong place on the context. It always checks
legend.node
instead oflegend['bindType']
. See here.The value gets set on
legend['bindType']
in the parent component hereYour Example Website or App
https://codesandbox.io/s/legend-bug-repro-3mk71p?file=/App.tsx
Steps to Reproduce the Bug or Issue
Sandbox - https://codesandbox.io/s/legend-bug-repro-3mk71p?file=/App.tsx You can see that when the
bindType
isedge
there is an exception thrown. But if you set that same value tonode
then things go smoothly. As mentioned before, that seems related to this line here.Expected behavior
Should be able to render the same way in the DOM for both Nodes & Edges.
Screenshots or Videos
Platform
Additional context
No response