Skip to content
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

[POC] Alternative terminal point implementation for 'no orthogonal segments' #1863

Closed
wants to merge 6 commits into from

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Mar 14, 2022

⚠️ THIS IS A POC so it is not intended to be merged, please don't rebase nor force push. Tests are failing and won't be fixed ⚠️

Only use the implementation involving the perimeter projection when there is no waypoint. Otherwise, use the original first and last waypoints.
This avoids side effects when terminal waypoints are inside the shapes and - in some cases - outside shapes.

Drawbacks: as the terminal waypoints can be inside or outsides shapes, the rendering of such edge cases may be less pretty than before.

covers #295
covers #349
covers #715
covers #994
covers #1236
covers #1368

Details and notes

Benefits: this implementation avoids all side effects described in #1779 (comment)
It also fixes #715 and #1368 (see visual non regression test screenshots updated here)

About the created drawbacks: we could later implement a new floating point computation. Get the intersection of the perimeter with the existing last segment instead of doing a projection. That way, the point on the perimeter would be always aligned with the last existing segment and wouldn't create glitches with arrows like #351 (comment) (we have visual non regression test to detect such problems and fixes)
If we go on with this implementation, I will create a specific issue about the new behavior.

On this topic, bpmn-js manages inside terminal waypoints by always putting the shape on top of the edge and use opacity with the shape fill color. mxGraph provides a way to always put shapes on top of edges
See the documentation about keepEdgesInBackground and keepEdgesInForeground.

Notes:

Suggestion: if implementing the changes proposed here, we should recreate most of the screenshots and re-configure thresholds. This also applies for any implementation removing the orthogonal segments. Orthogonal segments slightly moved the edges which is no longer the case.

Initial implementation is not supporting collapsed elements

There is an impact of the implementation on the example collapsing/expanding the pools

Notice that is not an officially supported feature, it is just used in example. So we could decide to skip fixing the problem.

BPMN diagram of a non regression visual test to review

The diagram with.outside.flows used in fit test has non orthogonal segments and a terminal waypoints inside a shape (confirmed with the diagram xml content and display with bpmn-js).
I don't know if we wan to keep this: it may be interesting if we want to test the effect of the zoom/fit on segments and terminal waypoints computation. In this case, we may also add a terminal waypoint outside a shape.
If we keep it, snapshot changes will be required if we manage to fix such waypoints.

with outside flows-diff-02-actual

…gments'

Only use the implementation involving the perimeter projection when there is no
waypoint. Otherwise, use the original first and last waypoints.
This avoids side effects when terminal waypoints are inside the shapes and - in
some cases - outside shapes.

Drawbacks: as the terminal waypoints can be inside or outsides shapes, the
rendering of such edge cases may be less pretty than before.
@tbouffard tbouffard added WIP 🚧 Pull request in progress and/or not ready for review. Used in addition to marking it as draft BPMN rendering Something about the way the lib is rendering BPMN elements poc 💫 Experimentation to discuss about future implementation. Not intended to be merged labels Mar 14, 2022
@github-actions
Copy link

github-actions bot commented Mar 14, 2022

🎊 PR Preview b042a98 has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-demo_preview-pr-1863.surge.sh

🕐 Build time: 53.379s

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Mar 14, 2022

🎊 PR Preview b042a98 has been successfully built and deployed to https://process-analytics-bpmn-visualization-js-doc_preview-pr-1863.surge.sh

🕐 Build time: 46.272s

🤖 By surge-preview

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

90.6% 90.6% Coverage
0.0% 0.0% Duplication

add diagrams for expand/collapsed pools and subprocesses
page: manage collapse element query parameter
test: test the diagram rendering with and without collapsed elements
@tbouffard
Copy link
Member Author

tbouffard commented Mar 16, 2022

Decisions taken with @csouchet based on commit 991ab47

@tbouffard
Copy link
Member Author

tbouffard commented Mar 17, 2022

Final status of "Initial implementation is not supporting collapsed elements"

This is not something we can fix right away. Just removing the Segment Connector without the alternative implementation proposed in this PR shows that the waypoints inside the collapsed pools and sub-processes are still there. We would like to detect such waypoints from the list and remove them. Remember that the alternative implementation proposed by this PR is just about the terminal waypoints computation.
Everything acts as if the Segment Connector implementation is cleaver enough to remove waypoints inside the collapsed elements. To fix the issue, we need to do the same which is out of the scope of the POC.

Screenshots of the collapsed pools used in visual tests when using the new implementation (without Segment connector)

collapsing pools on the left of the diagram collapsing pools on the right of the diagram
pools-collapse-Participant_1-diff-02-actual pools-collapse-Participant_3-diff-02-actual
pools-collapse-Participant_2-diff-02-actual pools-collapse-Participant_4-diff-02-actual

@tbouffard
Copy link
Member Author

Issues created, so closing.

@tbouffard tbouffard closed this Mar 18, 2022
@tbouffard tbouffard deleted the poc/avoid_usage_of_mxgraph_perimeter branch March 18, 2022 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BPMN rendering Something about the way the lib is rendering BPMN elements poc 💫 Experimentation to discuss about future implementation. Not intended to be merged WIP 🚧 Pull request in progress and/or not ready for review. Used in addition to marking it as draft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Association Flow arrow sometimes displayed inside the terminal BPMN element
1 participant