-
Notifications
You must be signed in to change notification settings - Fork 56
fix: handle multiple missing elements #129
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: main
Are you sure you want to change the base?
fix: handle multiple missing elements #129
Conversation
| if (grid.getElementsTotal() != elements.length) { | ||
| while (grid.getElementsTotal() != elements.length) { | ||
| const gridElements = grid.getAllElements(); | ||
| const missingElements = elements.filter(el => !gridElements.includes(el) && !isBoundaryEvent(el)); |
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.
IvanTulaev
left a comment
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.
Can you remove unnecessary code?
|
|
||
| this.handleGrid(grid,visited,stack); | ||
|
|
||
| if (grid.getElementsTotal() != elements.length) { |
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.
logic duplicate of dfs start
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.
i couldn't get what you mean ?
| const gridElements = grid.getAllElements(); | ||
| const missingElements = elements.filter(el => !gridElements.includes(el) && !isBoundaryEvent(el)); | ||
| if (missingElements.length > 1) { | ||
| if (missingElements.length > 0) { |
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.
Only this is important
lib/Layouter.js
Outdated
| this.handleGrid(grid,visited,stack); | ||
| } | ||
| else | ||
| { |
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.
unnecessary
|
@bassem-mostafa, it's blilliant! 👍 |
barmac
left a comment
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.
Can you please add a test case to showcase the fix/make sure we don't break it in the future?
|
I don't have permissions to push :( |
|
snapshots closes #131 |

Proposed Changes
As you can see in the given screenshot: