-
Notifications
You must be signed in to change notification settings - Fork 17
create dot for collapsed node in trainrunSectionViewObject #669
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: mrd/new-nodes-management-system
Are you sure you want to change the base?
create dot for collapsed node in trainrunSectionViewObject #669
Conversation
Signed-off-by: Louis Greiner <[email protected]>
| // Count collapsed source nodes from all trainrun sections except the first one | ||
| return this.trainrunSections | ||
| .slice(1) // skip first section | ||
| .filter((section) => section.getSourceNode().getIsCollapsed()).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.
All intermediate nodes in this.trainrunSections are collapsed, do we need to check this again here?
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.
oh indeed
| // retrieve collapsed node count from view object | ||
| const collapsedNodeCount = trainrunSectionViewObject.getCollapsedIntermediateStopCount(); | ||
| const trainrunSection = trainrunSectionViewObject.trainrunSections[0]; | ||
| const numberOfStops = trainrunSection.getNumberOfStops() + collapsedNodeCount; |
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.
trainrunSection.getNumberOfStops() should always return 0 since the DTO import runs a migration to get rid of these, so I don't think we need to add that to the total?
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 think so too, it was meant to work without the work of Clara, which is not merged yet (and then require export/import), but I can remove it anyway, it will avoid this to be forgotten along the way 😄
|
I wonder if we really need this PR given #661 is almost the same code. Maybe adding a method to get the number of intermediate nodes is worthwhile, but otherwise the code seems pretty similar. Oh, I just realized we don't want to count non-stop intermediate nodes, even if they're collapsed? In other words, we only want to draw a small disc for stops? |
Create a visual Dot for each collapsed node in a trainrun sections chain (
trainrunSectionViewObject)Code picked from mrd/demo-intermediate-collapsed-dots
Might conflict a bit with #661