-
Notifications
You must be signed in to change notification settings - Fork 33
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
[FEAT] Render Collapsed Embedded Sub-Process #378
Conversation
a241bf9
to
a6954b5
Compare
a6954b5
to
5aa8371
Compare
5aa8371
to
0c767e5
Compare
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.
The stroke of the cross is not large enough which make it render as gray when it is small. I will try to do some tests with largest values later
Some pending questions
|
||
public static translateIconToShapeBottomCenter(canvas: mxgraph.mxXmlCanvas2D, shape: ShapeConfiguration, iconSize: Size): void { | ||
const insetW = (shape.w - iconSize.width) / 2; | ||
const insetH = shape.h - iconSize.height - 7; |
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.
❓ where does the -7
comes from? Is this something you found empirically when testing with various BPMN diagrams?
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.
Yes, I just test with different values.
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.
perhaps we can put it in some constant (TASK_SHAPE_BOTTOM_MARGIN)
I do not know If we would have other Flow elements with this plus icon?
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.
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.
The spec states
The Sub-Process marker MUST be a small square with a plus sign (+) inside. The square MUST be positioned at the bottom center of the shape.
A lot of BPMN vendor don't stick it to the bottom, so this seems valid
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.
@aibcmars the other flow using this marker will be the call activity and we aim to reuse the current marker implementation
if (StyleUtils.getBpmnIsExpanded(this.style) === 'false') { | ||
const subProcessKind = StyleUtils.getBpmnSubProcessKind(this.style); | ||
if (subProcessKind === ShapeBpmnSubProcessKind.EMBEDDED) { | ||
const paintParameter = IconPainter.buildPaintParameter((c as unknown) as mxgraph.mxXmlCanvas2D, x, y, w, h, (this as unknown) as mxgraph.mxShape, 0.17, false, 1.5); |
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.
❓ same question about the 0.17
and 1.5
magic numbers
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.
Yes, I just test with different values.
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.
magic numbers for ratios are OK I think - it is more problem of the conversion from SVG -> mxGraph
(however as I remember the ratio params were somewhere in the XML file after generation)
perhaps just adding a comment from where they come can be sufficient
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 calculate myself these numbers, so there is no comment to add.
Co-authored-by: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com>
@csouchet I give a try with a stroke of all_activity_types.bpmnB.1.0 |
I think 3 is too big. Maybe, a value between 2 and 3 is better. |
@csouchet new comparison with B.1.0, stroke |
With stroke of |
ok for 2 with "not rounded" option |
|
||
public static translateIconToShapeBottomCenter(canvas: mxgraph.mxXmlCanvas2D, shape: ShapeConfiguration, iconSize: Size): void { | ||
const insetW = (shape.w - iconSize.width) / 2; | ||
const insetH = shape.h - iconSize.height - 7; |
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.
perhaps we can put it in some constant (TASK_SHAPE_BOTTOM_MARGIN)
I do not know If we would have other Flow elements with this plus icon?
|
||
public static translateIconToShapeBottomCenter(canvas: mxgraph.mxXmlCanvas2D, shape: ShapeConfiguration, iconSize: Size): void { | ||
const insetW = (shape.w - iconSize.width) / 2; | ||
const insetH = shape.h - iconSize.height - 7; |
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.
if (StyleUtils.getBpmnIsExpanded(this.style) === 'false') { | ||
const subProcessKind = StyleUtils.getBpmnSubProcessKind(this.style); | ||
if (subProcessKind === ShapeBpmnSubProcessKind.EMBEDDED) { | ||
const paintParameter = IconPainter.buildPaintParameter((c as unknown) as mxgraph.mxXmlCanvas2D, x, y, w, h, (this as unknown) as mxgraph.mxShape, 0.17, false, 1.5); |
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.
magic numbers for ratios are OK I think - it is more problem of the conversion from SVG -> mxGraph
(however as I remember the ratio params were somewhere in the XML file after generation)
perhaps just adding a comment from where they come can be sufficient
Closes #305
Example with sub-process without label bounds
using all_activity_types.bpmn
With BPMN.io:

Example with B.1.0 from migw-test-suite