-
Notifications
You must be signed in to change notification settings - Fork 228
[WIP] Feature/multiple edges between same nodes #362
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
base: master
Are you sure you want to change the base?
Conversation
| const cacheLinksCount = new Map(); | ||
| const cacheIdCount = new Map(); | ||
| const _key = (s, t) => `${s}:${t}`; | ||
| const addLink = (s, t, id) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This cache implementation is messy, I would definitely get this refactored moving forward.
| * @memberof Link/helper | ||
| */ | ||
| function buildLinkPathDefinition({ source = {}, target = {} }, type = LINE_TYPES.STRAIGHT) { | ||
| function buildLinkPathDefinition({ id, source, target }, type = LINE_TYPES.STRAIGHT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- To avoid confusion, better rename
sourcetosourceInfosince it's an object and not the actual source identifier
| */ | ||
| function buildLinkPathDefinition({ source = {}, target = {} }, type = LINE_TYPES.STRAIGHT) { | ||
| function buildLinkPathDefinition({ id, source, target }, type = LINE_TYPES.STRAIGHT) { | ||
| addLink(source.source, target.target, id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Shouldn't call
addLinkifidis non-existent
|
The |
| handleOnMouseOverLink = () => | ||
| this.props.onMouseOverLink && this.props.onMouseOverLink(this.props.source, this.props.target); | ||
| // NOTE: this.props.id is optional, it might be undefined | ||
| this.props.onMouseOverLink && this.props.onMouseOverLink(this.props.source, this.props.target, this.props.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onClickLink is going to need the id passed to the callback so it can be identified.
- Double check that this API is working properly.
|
I have been using this feature for a while as our data expects multiple edges between the same node and have not noticed any obvious errors. This is in a user base of 500+ with a dataset of 650K+ entities. |
|
Any updates on this pull request? |
Hello all,
With this draft I purpose a change to solve #185 adding support for redundant links between nodes.
What do I Introduce in this PR
idproperty to uniquely identify links (alongside withsourceandtargert)How does it look like?
See for yourself a small dataset with redundant links looks like this.
I would like to have some of you trying this out before merging. Additionally, let me know if you think there's' a better way to achieve this.