-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add data-source-id, data-target-id on Link #234
Conversation
It helps finding links between nodes (i.e. on node mouseOver find the links related to this node.
Hi @lazToum, Great call on adding this, thank you! Could you please briefly add a test for this here https://github.com/bkrem/react-d3-tree/blob/master/src/Link/tests/index.test.js#L58 ? A single test along the lines of Let me know if there are any issues! |
Something like this?
I also added one more in case a source/target does not have an "id" key. |
Yup this is looking good thank you! 👍 I'm fine with merging like this but I'm wondering what the fallback scenario (no |
Well it is only needed if a Link is used as a standalone element like in the test file where one can supply only the x,y props of the source and target. But you are correct, inside a Tree instance this check is not necessary. Should I remove it? |
Yeah I think we can safely disregard this scenario. A node should always have an ID, and if it doesn't returning Thank you for taking this into consideration though 💯 Will merge, document & publish once that's done :) |
Great, thanks! |
* Add data-source-id, data-target-id on Link It helps finding links between nodes (i.e. on node mouseOver find the links related to this node. docs(link data attributes): adds documentation for Link data attributes
* Add data-source-id, data-target-id on Link It helps finding links between nodes (i.e. on node mouseOver find the links related to this node. docs(link data attributes): adds documentation for Link data attributes test: use identity assertion (`toBe`) instead of equality (`toEqual`)
Shipped as v1.15.0 Thank you again 👏 |
It helps finding links between nodes (i.e. on node mouseOver, find the links related to this node.)