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

chore: [POC] Markers rendering improvements #2724

Closed
wants to merge 39 commits into from

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented May 31, 2023

DISCLAIMER: this is a POC, so it is not intended to be merged

Summary

Initially, this PR was created to experiment with marker enhancements in order to implement the rendering of the Ad-Hoc Subprocess.
Finally, this POC provides a solution to implement at least:

The experiments already leads to the creation of the following Pull Requests:

Conclusions and decisions

Decisions taken with @csouchet on 2024-04-04

Implement the following

  • enforce marker width + review width value: value 12, see chore: [POC] Markers rendering improvements #2724 (comment)
  • marker stroke width: value 1, see chore: [POC] Markers rendering improvements #2724 (comment)
  • center maker vertically
  • markers spacing: : value 4, see chore: [POC] Markers rendering improvements #2724 (comment)
  • marker bottom margin: remain unchanged, to not overlap the lines of the Transaction Sub-Process
  • loop marker: reduce width and keep the existing design
  • adhoc subprocess icon: use the icon of this POC
  • rename StyleDefault elements: including the margin bottom, no need to include ICON in the name if we use MARKER. All names should be review (for example, there is no need to prefix them by DEFAULT, these are properties of an object name StyleDefault, so the "default" purpose is already included).
  • update values in ShapeBpmnMarkerKind
  • enrich the BPMN diagram used for visual tests (more usage of compensation) to prepare next developments

Details of topics covered

This PR experiment fixes and improvements for the following topics:

  MULTI_INSTANCE_PARALLEL = 'parallel multi instance',
  MULTI_INSTANCE_SEQUENTIAL = 'sequential multi instance',

Identified issues that this POC tries to cover

Too large spacing between 2 markers

This POC provides a fix for this. The implementation to generalize markers positioning for 3 markers and more also uses the same logic.
Previously, the translation includes SHAPE_ACTIVITY_MARKER_ICON_SIZE instead of SHAPE_ACTIVITY_MARKER_ICON_SIZE/2. The following schema explains why the value has to be divided by 2 👇🏿

⚠️ In the following schema

  • MARKER_WIDTH = SHAPE_ACTIVITY_MARKER_ICON_SIZE
  • MARKER_SPACING = SHAPE_ACTIVITY_MARKER_ICON_MARGIN

schema_bug_fix_marker-size_applied_twice_03

Prior fix With the fix
PR_2724_2markers_margin_01_too_large PR_2724_2markers_margin_02_fixed

The current value of StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE is not accurate

When using a spacing of 0, the 2 markers should be stacked together but this is not the case.
The "width" is configured to 20 whereas the actual icon size is currently 16. So it is larger by 4.

spacing 0 spacing -2
PR_2724_2markers_marker-size_01_zero PR_2724_2markers_marker-size_02_minus-two

Unable to use markers shape not defined with 16x16 dimensions

The following screenshots demonstrate the problem by replacing the "loop marker" by some icons with specific dimensions

  • paintDoubleLeftArrowheadsIcon (compensation): width 105 / height 53.5
  • paintCircleIcon (icon of the inclusive gateway and terminate event) dynamic size (base on the dimensions in paintParameter.shapeConfig)
  • paintAsteriskIcon (icon of the complex gatweay): dimensions 1x1

Notice that the dimensions of the "loop marker" are not 16x16 but "width: 22.49, height: 21.62". They are closed to 16x16 so the problem is not very visible

paintDoubleLeftArrowheadsIcon paintCircleIcon paintAsteriskIcon
non_16x16_markers_01_compensation non_16x16_markers_02_circle non_16x16_markers_03_asterisk

This POC proposes an experimental implementation to use a fixed width for markers.
See #2724 (comment)

@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 May 31, 2023
@tbouffard tbouffard mentioned this pull request May 31, 2023
7 tasks
@tbouffard tbouffard force-pushed the poc/marker_rendering_improvements branch from e252415 to 65cdea9 Compare March 1, 2024 17:51
…epare generalization

# Conflicts:
#	src/component/mxgraph/shape/activity-shapes.ts

# Conflicts:
#	src/component/mxgraph/shape/activity-shapes.ts
@tbouffard tbouffard force-pushed the poc/marker_rendering_improvements branch from 65cdea9 to 57f08f0 Compare March 4, 2024 15:18
@tbouffard tbouffard force-pushed the poc/marker_rendering_improvements branch 2 times, most recently from 34d7d1e to 9c4e975 Compare March 4, 2024 16:42
@tbouffard
Copy link
Member Author

tbouffard commented Mar 5, 2024

Markers positioning - generalization

Here, the compensation marker is arbitrary added to the list of markers defined in the BPMN diagram. The adhoc marker is displayed using an pentagon.
Screenshots generated with http://localhost:10001/dev/public/index.html?url=/test/fixtures/bpmn/bpmn-rendering/markers.01.positioning.bpmn

3 markers 4 markers
PR_2724_generalization_01_3-markers PR_2724_generalization_02_4-markers

@tbouffard
Copy link
Member Author

tbouffard commented Mar 5, 2024

Experiment usage of fixed size markers (reuse compensation marker)

Reuse the existing "compensation" paint function and enforce that its width is "16" (absolute width of the other existing markers).

Here, the compensation marker is arbitrary added to the list of markers defined in the BPMN diagram. The adhoc marker is displayed using an pentagon.
Screenshots generated with http://localhost:10001/dev/public/index.html?url=/test/fixtures/bpmn/bpmn-rendering/markers.01.positioning.bpmn

compensation_marker_position_04

- Tasks: compensation, comp + seq
- expanded Subprocess: compensation, compensation + loop
- Transaction: compensation + parallel
@tbouffard
Copy link
Member Author

tbouffard commented Mar 7, 2024

Update markers.01.positioning BPMN diagram to prepare the support of the compensation marker

Rendering with bpmn-js in https://cdn.statically.io/gh/process-analytics/bpmn-visualization-examples/v0.43.0/examples/misc/compare-with-bpmn-js/index.html

markers 01 positioning_more_compensation_markers_usage

…width)

Useful for compensation and adhoc markers
@tbouffard
Copy link
Member Author

Markers positioning - allow to center the marker vertically

compensation_marker_position_05_centered

@tbouffard
Copy link
Member Author

Test an adhoc marker icon proposal

Test the rendering with https://thenounproject.com/icon/tilde-651893/ which is proposed in #356 (comment)

adhoc_marker_centered_vertically

@tbouffard
Copy link
Member Author

tbouffard commented Mar 14, 2024

Using fixed width and experimenting smaller spacing

This is an experiment for #465, #475, #992.

Enforce width of 16 and vertical align is centered.
The code that paint the loop marker has been adapted: the declared dimensions were wrong and the painted loop was not centered

all markers with width set to 16, centered vertically and original spacing (set to 5)

This includes the changes of the "painted loop"

markers_fixed_width_01_loop_updated_spacing_5

spacing set to 4

markers_fixed_width_02_spacing_4

spacing set to 3

markers_fixed_width_03_spacing_3

spacing set to 2

markers_fixed_width_04_spacing_2

spacing set to 0

This demonstrates that there is no longer extra spacing added because of markers with non fixed sized.

markers_fixed_width_05_spacing_0

@tbouffard
Copy link
Member Author

Experiment smaller marker width to give more place to the activity label

By reducing the width, this reduces the height.

width 16 width 12
markers_width_experiment_01_16_original markers_width_experiment_02_12

The following shows the impact on B.1.0 from miwg-test-suite
The spacing is set to 4.

width 16 (as shown in #992) width 12
B.1.0 call activity markers_width_experiment_03_12_B 1 0

@tbouffard
Copy link
Member Author

Experiment alternative stroke width

spacing: 4
width: 12

stroke width 1.5 stroke width 1
markers_width_12_02_stroke-width_value_1 5 markers_width_12_01_stroke-width_value_1

@tbouffard tbouffard removed the WIP 🚧 Pull request in progress and/or not ready for review. Used in addition to marking it as draft label Mar 20, 2024
@tbouffard
Copy link
Member Author

Closing, decisions taken and listed here are now tracked in #3146.

@tbouffard tbouffard closed this Aug 16, 2024
@tbouffard tbouffard deleted the poc/marker_rendering_improvements branch August 16, 2024 15:38
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 decision record poc 💫 Experimentation to discuss about future implementation. Not intended to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant