process-analytics / bpmn-visualization-js

A TypeScript library for visualizing process execution data on BPMN diagrams
https://process-analytics.github.io/bpmn-visualization-js/
Apache License 2.0
215 stars 29 forks source link

[FEAT] Review Gateway rendering #716

Open tbouffard opened 3 years ago

tbouffard commented 3 years ago

Is your feature request related to a problem? Please describe. Review if this will be better to have rounded gateway for consistency with other shapes (we tend to use rounded elements for shapes and icons)

Describe the solution you'd like Consider something like kogito/kie-tools does

image

Additional context This should be possible to do this with mxGraph quadTo or arcTo canvas functions.

⚠️ Thanks to discuss with us on this issue to propose your different renderings before to implement one of them.

AhmadMSadek commented 1 year ago

Hello, I'm interested in this issue. Thanks.

csouchet commented 1 year ago

Hi 👋🏻 Thank you for your interest. I assigned you this issue 🙂 If you need any helps, don't hesitate to contact us 😉

tbouffard commented 1 year ago

@AhmadMSadek Hello, do you still intend to work on this issue? We haven't seen any activity in the last 2 months.

tbouffard commented 1 year ago

No answer, so assign the issue to myself.

tbouffard commented 1 year ago

According to the implementation of mxRhombus from which the GatewayShape inherits, we could add style configuration to achieve what is requested in this issue. Style configuration

See https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/shape/mxRhombus.js#L54-L64

Notice that the RhombusPerimeter doesn't consider rounded shape, see https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/view/mxPerimeter.js#L259. So the terminal points of the edges won't be placed on the edges of the gateway anymore. There will be a space between the terminal points and the stroke of the Gateway in some cases. As we disabled perimeter projections until we implement #1870, this will be visible only when the BPMN diagram doesn't define edge waypoints (which is mandatory according to the BPMN specification). As this use case is managed as best effort in bpmn-visualization, we could live with that IMHO.