From 4f94ab10f8fdd6d455abaf4971babc90b6c1f9c2 Mon Sep 17 00:00:00 2001 From: Martin Stamm Date: Mon, 8 Nov 2021 18:39:03 +0100 Subject: [PATCH] chore(draw): remove passing attrs for rendering (#1528) This reverts #1515, as we don't plan to support the feature that requires it anymore. Closes #1527 --- lib/draw/BpmnRenderer.js | 661 ++++++++++++++++++--------------------- 1 file changed, 297 insertions(+), 364 deletions(-) diff --git a/lib/draw/BpmnRenderer.js b/lib/draw/BpmnRenderer.js index 2086de9a..ce652332 100644 --- a/lib/draw/BpmnRenderer.js +++ b/lib/draw/BpmnRenderer.js @@ -383,8 +383,8 @@ export default function BpmnRenderer( } function as(type) { - return function(parentGfx, element, attrs) { - return handlers[type](parentGfx, element, attrs); + return function(parentGfx, element) { + return handlers[type](parentGfx, element); }; } @@ -392,58 +392,58 @@ export default function BpmnRenderer( return handlers[type]; } - function renderEventContent(element, parentGfx, attrs) { + function renderEventContent(element, parentGfx) { var event = getSemantic(element); var isThrowing = isThrowEvent(event); if (event.eventDefinitions && event.eventDefinitions.length>1) { if (event.parallelMultiple) { - return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing); } else { - return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, isThrowing); } } if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) { - return renderer('bpmn:MessageEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:MessageEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) { - return renderer('bpmn:TimerEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:TimerEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) { - return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element, attrs); + return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element); } if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) { - return renderer('bpmn:SignalEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:SignalEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) { - return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) { - return renderer('bpmn:LinkEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:LinkEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) { - return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) { - return renderer('bpmn:CancelEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:CancelEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) { - return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, isThrowing); } if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) { - return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, attrs, isThrowing); + return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, isThrowing); } return null; @@ -466,20 +466,20 @@ export default function BpmnRenderer( return text; } - function renderEmbeddedLabel(parentGfx, element, align, attrs) { + function renderEmbeddedLabel(parentGfx, element, align) { var semantic = getSemantic(element); return renderLabel(parentGfx, semantic.name, { box: element, align: align, padding: 5, - style: assign({ + style: { fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor) - }, attrs) + } }); } - function renderExternalLabel(parentGfx, element, attrs) { + function renderExternalLabel(parentGfx, element) { var box = { width: 90, @@ -496,22 +496,21 @@ export default function BpmnRenderer( textRenderer.getExternalStyle(), { fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor) - }, - attrs + } ) }); } - function renderLaneLabel(parentGfx, text, element, attrs) { + function renderLaneLabel(parentGfx, text, element) { var textBox = renderLabel(parentGfx, text, { box: { height: 30, width: element.height }, align: 'center-middle', - style: assign({ + style: { fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor) - }, attrs) + } }); var top = -1 * element.height; @@ -538,11 +537,11 @@ export default function BpmnRenderer( return drawCircle(parentGfx, element.width, element.height, attrs); }, - 'bpmn:StartEvent': function(parentGfx, element, attrs) { - attrs = assign({ + 'bpmn:StartEvent': function(parentGfx, element) { + var attrs = { fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }; var semantic = getSemantic(element); @@ -561,7 +560,7 @@ export default function BpmnRenderer( return circle; }, - 'bpmn:MessageEventDefinition': function(parentGfx, element, attrs, isThrowing) { + 'bpmn:MessageEventDefinition': function(parentGfx, element, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_MESSAGE', { xScaleFactor: 0.9, yScaleFactor: 0.9, @@ -576,24 +575,20 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(element, defaultStrokeColor) : getFillColor(element, defaultFillColor); var stroke = isThrowing ? getFillColor(element, defaultFillColor) : getStrokeColor(element, defaultStrokeColor); - attrs = assign({ + var messagePath = drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: stroke - }, attrs); - - var messagePath = drawPath(parentGfx, pathData, attrs); + }); return messagePath; }, - 'bpmn:TimerEventDefinition': function(parentGfx, element, attrs) { - var outerAttrs = assign({ + 'bpmn:TimerEventDefinition': function(parentGfx, element) { + var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, { strokeWidth: 2, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, outerAttrs); + }); var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', { xScaleFactor: 0.75, @@ -606,13 +601,11 @@ export default function BpmnRenderer( } }); - var innerAttrs = assign({ + drawPath(parentGfx, pathData, { strokeWidth: 2, strokeLinecap: 'square', stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - drawPath(parentGfx, pathData, innerAttrs); + }); for (var i = 0;i < 12; i++) { @@ -630,25 +623,17 @@ export default function BpmnRenderer( var width = element.width / 2; var height = element.height / 2; - var lineAttrs = assign({ + drawPath(parentGfx, linePathData, { strokeWidth: 1, strokeLinecap: 'square', transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')', stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - drawPath(parentGfx, linePathData, lineAttrs); + }); } return circle; }, - 'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs, isThrowing) { - attrs = assign({ - strokeWidth: 1, - fill: fill, - stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - + 'bpmn:EscalationEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_ESCALATION', { xScaleFactor: 1, yScaleFactor: 1, @@ -662,14 +647,13 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - return drawPath(parentGfx, pathData, attrs); - }, - 'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs) { - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, + fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - + }); + }, + 'bpmn:ConditionalEventDefinition': function(parentGfx, event) { var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', { xScaleFactor: 1, yScaleFactor: 1, @@ -681,9 +665,12 @@ export default function BpmnRenderer( } }); - return drawPath(parentGfx, pathData, attrs); + return drawPath(parentGfx, pathData, { + strokeWidth: 1, + stroke: getStrokeColor(event, defaultStrokeColor) + }); }, - 'bpmn:LinkEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:LinkEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_LINK', { xScaleFactor: 1, yScaleFactor: 1, @@ -697,15 +684,13 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:ErrorEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_ERROR', { xScaleFactor: 1.1, yScaleFactor: 1.1, @@ -719,15 +704,13 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:CancelEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:CancelEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', { xScaleFactor: 1.0, yScaleFactor: 1.0, @@ -741,19 +724,17 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + var path = drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - var path = drawPath(parentGfx, pathData, attrs); + }); rotate(path, 45); return path; }, - 'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:CompensateEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', { xScaleFactor: 1, yScaleFactor: 1, @@ -767,15 +748,13 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:SignalEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:SignalEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_SIGNAL', { xScaleFactor: 0.9, yScaleFactor: 0.9, @@ -789,15 +768,13 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill, stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs, isThrowing) { + 'bpmn:MultipleEventDefinition': function(parentGfx, event, isThrowing) { var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', { xScaleFactor: 1.1, yScaleFactor: 1.1, @@ -811,14 +788,12 @@ export default function BpmnRenderer( var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none'; - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: fill - }, attrs); - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs) { + 'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event) { var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', { xScaleFactor: 1.2, yScaleFactor: 1.2, @@ -830,54 +805,47 @@ export default function BpmnRenderer( } }); - attrs = assign({ + return drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getStrokeColor(event, defaultStrokeColor), stroke: getStrokeColor(event, defaultStrokeColor) - }, attrs); - - - return drawPath(parentGfx, pathData, attrs); + }); }, - 'bpmn:EndEvent': function(parentGfx, element, attrs) { - var outerAttrs = assign({ + 'bpmn:EndEvent': function(parentGfx, element) { + var circle = renderer('bpmn:Event')(parentGfx, element, { strokeWidth: 4, fill: getFillColor(element, defaultFillColor), - stroke: getStrokeColor(element, defaultStrokeColor), - }, attrs); + stroke: getStrokeColor(element, defaultStrokeColor) + }); - var circle = renderer('bpmn:Event')(parentGfx, element, outerAttrs); - - renderEventContent(element, parentGfx, attrs); + renderEventContent(element, parentGfx, true); return circle; }, - 'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs) { - attrs = assign({ - fill: getFillColor(element, defaultFillColor), - stroke: getStrokeColor(element, defaultStrokeColor), - strokeWidth: 4 - }, attrs); - - var circle = drawCircle(parentGfx, element.width, element.height, 8, attrs); + 'bpmn:TerminateEventDefinition': function(parentGfx, element) { + var circle = drawCircle(parentGfx, element.width, element.height, 8, { + strokeWidth: 4, + fill: getStrokeColor(element, defaultStrokeColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); return circle; }, - 'bpmn:IntermediateEvent': function(parentGfx, element, attrs) { - var outerAttrs = assign({ + 'bpmn:IntermediateEvent': function(parentGfx, element) { + var outer = renderer('bpmn:Event')(parentGfx, element, { strokeWidth: 1, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - var outer = renderer('bpmn:Event')(parentGfx, element, outerAttrs); + }); /* inner */ - drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, assign({}, outerAttrs, { + drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, { + strokeWidth: 1, fill: getFillColor(element, 'none'), - })); + stroke: getStrokeColor(element, defaultStrokeColor) + }); - renderEventContent(element, parentGfx, attrs); + renderEventContent(element, parentGfx); return outer; }, @@ -895,21 +863,21 @@ export default function BpmnRenderer( return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, attrs); }, - 'bpmn:Task': function(parentGfx, element, attrs) { - attrs = assign({ + 'bpmn:Task': function(parentGfx, element) { + var attrs = { fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }; var rect = renderer('bpmn:Activity')(parentGfx, element, attrs); renderEmbeddedLabel(parentGfx, element, 'center-middle'); - attachTaskMarkers(parentGfx, element, attrs); + attachTaskMarkers(parentGfx, element); return rect; }, - 'bpmn:ServiceTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:ServiceTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var pathDataBG = pathMap.getScaledPath('TASK_TYPE_SERVICE', { abspos: { @@ -918,12 +886,11 @@ export default function BpmnRenderer( } }); - var serviceAttrs = assign({ + /* service bg */ drawPath(parentGfx, pathDataBG, { strokeWidth: 1, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* service bg */ drawPath(parentGfx, pathDataBG, serviceAttrs); + }); var fillPathData = pathMap.getScaledPath('TASK_TYPE_SERVICE_FILL', { abspos: { @@ -932,11 +899,10 @@ export default function BpmnRenderer( } }); - var fillAttrs = assign({ + /* service fill */ drawPath(parentGfx, fillPathData, { strokeWidth: 0, fill: getFillColor(element, defaultFillColor) - }, attrs); - /* service fill */ drawPath(parentGfx, fillPathData, fillAttrs); + }); var pathData = pathMap.getScaledPath('TASK_TYPE_SERVICE', { abspos: { @@ -945,12 +911,16 @@ export default function BpmnRenderer( } }); - /* service */ drawPath(parentGfx, pathData, serviceAttrs); + /* service */ drawPath(parentGfx, pathData, { + strokeWidth: 1, + fill: getFillColor(element, defaultFillColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); return task; }, - 'bpmn:UserTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:UserTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var x = 15; var y = 12; @@ -962,12 +932,11 @@ export default function BpmnRenderer( } }); - var userAttrs = assign({ + /* user path */ drawPath(parentGfx, pathData, { strokeWidth: 0.5, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* user path */ drawPath(parentGfx, pathData, userAttrs); + }); var pathData2 = pathMap.getScaledPath('TASK_TYPE_USER_2', { abspos: { @@ -976,7 +945,11 @@ export default function BpmnRenderer( } }); - /* user2 path */ drawPath(parentGfx, pathData2, userAttrs); + /* user2 path */ drawPath(parentGfx, pathData2, { + strokeWidth: 0.5, + fill: getFillColor(element, defaultFillColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); var pathData3 = pathMap.getScaledPath('TASK_TYPE_USER_3', { abspos: { @@ -985,12 +958,16 @@ export default function BpmnRenderer( } }); - /* user3 path */ drawPath(parentGfx, pathData3, userAttrs); + /* user3 path */ drawPath(parentGfx, pathData3, { + strokeWidth: 0.5, + fill: getStrokeColor(element, defaultStrokeColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); return task; }, - 'bpmn:ManualTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:ManualTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', { abspos: { @@ -999,17 +976,16 @@ export default function BpmnRenderer( } }); - var manualAttrs = assign({ + /* manual path */ drawPath(parentGfx, pathData, { strokeWidth: 0.5, // 0.25, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* manual path */ drawPath(parentGfx, pathData, manualAttrs); + }); return task; }, - 'bpmn:SendTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:SendTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', { xScaleFactor: 1, @@ -1022,25 +998,22 @@ export default function BpmnRenderer( } }); - /* send path */ - var pathAttrs = assign({ + /* send path */ drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getStrokeColor(element, defaultStrokeColor), stroke: getFillColor(element, defaultFillColor) - }, attrs); - - drawPath(parentGfx, pathData, pathAttrs); + }); return task; }, - 'bpmn:ReceiveTask' : function(parentGfx, element, attrs) { + 'bpmn:ReceiveTask' : function(parentGfx, element) { var semantic = getSemantic(element); - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + var task = renderer('bpmn:Task')(parentGfx, element); var pathData; if (semantic.instantiate) { - drawCircle(parentGfx, 28, 28, 20 * 0.22, assign({ strokeWidth: 1 }, attrs)); + drawCircle(parentGfx, 28, 28, 20 * 0.22, { strokeWidth: 1 }); pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', { abspos: { @@ -1062,18 +1035,16 @@ export default function BpmnRenderer( }); } - var receiveAttrs = assign({ + /* receive path */ drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - /* receive path */ drawPath(parentGfx, pathData, receiveAttrs); + }); return task; }, - 'bpmn:ScriptTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:ScriptTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', { abspos: { @@ -1082,16 +1053,15 @@ export default function BpmnRenderer( } }); - var scriptAttrs = assign({ + /* script path */ drawPath(parentGfx, pathData, { strokeWidth: 1, stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* script path */ drawPath(parentGfx, pathData, scriptAttrs); + }); return task; }, - 'bpmn:BusinessRuleTask': function(parentGfx, element, attrs) { - var task = renderer('bpmn:Task')(parentGfx, element, attrs); + 'bpmn:BusinessRuleTask': function(parentGfx, element) { + var task = renderer('bpmn:Task')(parentGfx, element); var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', { abspos: { @@ -1100,12 +1070,12 @@ export default function BpmnRenderer( } }); - var headerAttrs = assign({ + var businessHeaderPath = drawPath(parentGfx, headerPathData); + svgAttr(businessHeaderPath, { strokeWidth: 1, fill: getFillColor(element, '#aaaaaa'), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - drawPath(parentGfx, headerPathData, headerAttrs); + }); var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', { abspos: { @@ -1114,11 +1084,11 @@ export default function BpmnRenderer( } }); - var businessAttrs = assign({ + var businessPath = drawPath(parentGfx, headerData); + svgAttr(businessPath, { strokeWidth: 1, stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - drawPath(parentGfx, headerData, businessAttrs); + }); return task; }, @@ -1141,42 +1111,41 @@ export default function BpmnRenderer( renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle'); if (expanded) { - attachTaskMarkers(parentGfx, element, attrs); + attachTaskMarkers(parentGfx, element); } else { - attachTaskMarkers(parentGfx, element, attrs, ['SubProcessMarker']); + attachTaskMarkers(parentGfx, element, ['SubProcessMarker']); } return rect; }, - 'bpmn:AdHocSubProcess': function(parentGfx, element, attrs) { - return renderer('bpmn:SubProcess')(parentGfx, element, attrs); + 'bpmn:AdHocSubProcess': function(parentGfx, element) { + return renderer('bpmn:SubProcess')(parentGfx, element); }, - 'bpmn:Transaction': function(parentGfx, element, attrs) { - var outer = renderer('bpmn:SubProcess')(parentGfx, element, attrs); + 'bpmn:Transaction': function(parentGfx, element) { + var outer = renderer('bpmn:SubProcess')(parentGfx, element); var innerAttrs = styles.style([ 'no-fill', 'no-events' ], { stroke: getStrokeColor(element, defaultStrokeColor) }); - /* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, assign(innerAttrs, attrs)); + /* inner path */ drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS - 2, INNER_OUTER_DIST, innerAttrs); return outer; }, - 'bpmn:CallActivity': function(parentGfx, element, attrs) { - attrs = assign({ + 'bpmn:CallActivity': function(parentGfx, element) { + return renderer('bpmn:SubProcess')(parentGfx, element, { strokeWidth: 5 - }, attrs); - - return renderer('bpmn:SubProcess')(parentGfx, element, attrs); + }); }, - 'bpmn:Participant': function(parentGfx, element, attrs) { - var outerAttrs = assign({ + 'bpmn:Participant': function(parentGfx, element) { + + var attrs = { fillOpacity: DEFAULT_FILL_OPACITY, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }; - var lane = renderer('bpmn:Lane')(parentGfx, element, outerAttrs); + var lane = renderer('bpmn:Lane')(parentGfx, element, attrs); var expandedPool = isExpanded(element); @@ -1184,9 +1153,9 @@ export default function BpmnRenderer( drawLine(parentGfx, [ { x: 30, y: 0 }, { x: 30, y: element.height } - ], assign({ + ], { stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs)); + }); var text = getSemantic(element).name; renderLaneLabel(parentGfx, text, element); } else { @@ -1204,7 +1173,7 @@ export default function BpmnRenderer( var participantMultiplicity = !!(getSemantic(element).participantMultiplicity); if (participantMultiplicity) { - renderer('ParticipantMultiplicityMarker')(parentGfx, element, attrs); + renderer('ParticipantMultiplicityMarker')(parentGfx, element); } return lane; @@ -1225,23 +1194,20 @@ export default function BpmnRenderer( return rect; }, - 'bpmn:InclusiveGateway': function(parentGfx, element, attrs) { - var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs); + 'bpmn:InclusiveGateway': function(parentGfx, element) { + var diamond = renderer('bpmn:Gateway')(parentGfx, element); - - var circleAttrs = assign({ + /* circle path */ + drawCircle(parentGfx, element.width, element.height, element.height * 0.24, { strokeWidth: 2.5, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - /* circle path */ - drawCircle(parentGfx, element.width, element.height, element.height * 0.24, circleAttrs); + }); return diamond; }, - 'bpmn:ExclusiveGateway': function(parentGfx, element, attrs) { - var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs); + 'bpmn:ExclusiveGateway': function(parentGfx, element) { + var diamond = renderer('bpmn:Gateway')(parentGfx, element); var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', { xScaleFactor: 0.4, @@ -1255,17 +1221,17 @@ export default function BpmnRenderer( }); if ((getDi(element).isMarkerVisible)) { - drawPath(parentGfx, pathData, assign({ + drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getStrokeColor(element, defaultStrokeColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs)); + }); } return diamond; }, - 'bpmn:ComplexGateway': function(parentGfx, element, attrs) { - var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs); + 'bpmn:ComplexGateway': function(parentGfx, element) { + var diamond = renderer('bpmn:Gateway')(parentGfx, element); var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', { xScaleFactor: 0.5, @@ -1278,17 +1244,16 @@ export default function BpmnRenderer( } }); - var innerAttrs = assign({ + /* complex path */ drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getStrokeColor(element, defaultStrokeColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* complex path */ drawPath(parentGfx, pathData, innerAttrs); + }); return diamond; }, - 'bpmn:ParallelGateway': function(parentGfx, element, attrs) { - var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs); + 'bpmn:ParallelGateway': function(parentGfx, element) { + var diamond = renderer('bpmn:Gateway')(parentGfx, element); var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', { xScaleFactor: 0.6, @@ -1301,27 +1266,25 @@ export default function BpmnRenderer( } }); - var innerAttrs = assign({ + /* parallel path */ drawPath(parentGfx, pathData, { strokeWidth: 1, fill: getStrokeColor(element, defaultStrokeColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* parallel path */ drawPath(parentGfx, pathData, innerAttrs); + }); return diamond; }, - 'bpmn:EventBasedGateway': function(parentGfx, element, attrs) { + 'bpmn:EventBasedGateway': function(parentGfx, element) { var semantic = getSemantic(element); - var diamond = renderer('bpmn:Gateway')(parentGfx, element, attrs); + var diamond = renderer('bpmn:Gateway')(parentGfx, element); - var outerAttrs = assign({ + /* outer circle path */ drawCircle(parentGfx, element.width, element.height, element.height * 0.20, { strokeWidth: 1, fill: 'none', stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* outer circle path */ drawCircle(parentGfx, element.width, element.height, element.height * 0.20, outerAttrs); + }); var type = semantic.eventGatewayType; var instantiate = !!semantic.instantiate; @@ -1339,12 +1302,13 @@ export default function BpmnRenderer( } }); - var innerAttrs = assign({ + var attrs = { strokeWidth: 2, fill: getFillColor(element, 'none'), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - /* event path */ drawPath(parentGfx, pathData, innerAttrs); + }; + + /* event path */ drawPath(parentGfx, pathData, attrs); } if (type === 'Parallel') { @@ -1360,7 +1324,7 @@ export default function BpmnRenderer( } }); - var parallelPath = drawPath(parentGfx, pathData, attrs); + var parallelPath = drawPath(parentGfx, pathData); svgAttr(parallelPath, { strokeWidth: 1, fill: 'none' @@ -1368,12 +1332,12 @@ export default function BpmnRenderer( } else if (type === 'Exclusive') { if (!instantiate) { - var innerCircleAttrs = assign({ + var innerCircle = drawCircle(parentGfx, element.width, element.height, element.height * 0.26); + svgAttr(innerCircle, { strokeWidth: 1, fill: 'none', stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - drawCircle(parentGfx, element.width, element.height, element.height * 0.26, innerCircleAttrs); + }); } drawEvent(); @@ -1382,28 +1346,26 @@ export default function BpmnRenderer( return diamond; }, - 'bpmn:Gateway': function(parentGfx, element, attrs) { - attrs = assign({ + 'bpmn:Gateway': function(parentGfx, element) { + var attrs = { fill: getFillColor(element, defaultFillColor), fillOpacity: DEFAULT_FILL_OPACITY, stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }; return drawDiamond(parentGfx, element.width, element.height, attrs); }, - 'bpmn:SequenceFlow': function(parentGfx, element, attrs) { - attrs = attrs || {}; - + 'bpmn:SequenceFlow': function(parentGfx, element) { var pathData = createPathFromConnection(element); - var fill = attrs.fill || getFillColor(element, defaultFillColor), - stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor); + var fill = getFillColor(element, defaultFillColor), + stroke = getStrokeColor(element, defaultStrokeColor); - attrs = assign({ + var attrs = { strokeLinejoin: 'round', markerEnd: marker('sequenceflow-end', fill, stroke), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs || {}); + }; var path = drawPath(parentGfx, pathData, attrs); @@ -1457,52 +1419,41 @@ export default function BpmnRenderer( return drawLine(parentGfx, element.waypoints, attrs); }, - 'bpmn:DataInputAssociation': function(parentGfx, element, attrs) { - attrs = attrs || {}; + 'bpmn:DataInputAssociation': function(parentGfx, element) { + var fill = getFillColor(element, defaultFillColor), + stroke = getStrokeColor(element, defaultStrokeColor); - var fill = attrs.fill || getFillColor(element, defaultFillColor), - stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor); - - attrs = assign({ + return renderer('bpmn:Association')(parentGfx, element, { markerEnd: marker('association-end', fill, stroke) - }, attrs); - - return renderer('bpmn:Association')(parentGfx, element, attrs); + }); }, - 'bpmn:DataOutputAssociation': function(parentGfx, element, attrs) { - attrs = attrs || {}; + 'bpmn:DataOutputAssociation': function(parentGfx, element) { + var fill = getFillColor(element, defaultFillColor), + stroke = getStrokeColor(element, defaultStrokeColor); - var fill = attrs.fill || getFillColor(element, defaultFillColor), - stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor); - - - attrs = assign({ + return renderer('bpmn:Association')(parentGfx, element, { markerEnd: marker('association-end', fill, stroke) - }, attrs); - - return renderer('bpmn:Association')(parentGfx, element, attrs); + }); }, - 'bpmn:MessageFlow': function(parentGfx, element, attrs) { - attrs = attrs || {}; + 'bpmn:MessageFlow': function(parentGfx, element) { var semantic = getSemantic(element), di = getDi(element); - var fill = attrs.fill || getFillColor(element, defaultFillColor), - stroke = attrs.stroke || getStrokeColor(element, defaultStrokeColor); + var fill = getFillColor(element, defaultFillColor), + stroke = getStrokeColor(element, defaultStrokeColor); var pathData = createPathFromConnection(element); - - attrs = assign({ + var attrs = { markerEnd: marker('messageflow-end', fill, stroke), markerStart: marker('messageflow-start', fill, stroke), strokeDasharray: '10, 12', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: '1.5px', - stroke: stroke - }, attrs); + stroke: getStrokeColor(element, defaultStrokeColor) + }; var path = drawPath(parentGfx, pathData, attrs); @@ -1549,7 +1500,7 @@ export default function BpmnRenderer( return path; }, - 'bpmn:DataObject': function(parentGfx, element, attrs) { + 'bpmn:DataObject': function(parentGfx, element) { var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', { xScaleFactor: 1, yScaleFactor: 1, @@ -1561,56 +1512,46 @@ export default function BpmnRenderer( } }); - var outerAttrs = assign({ + var elementObject = drawPath(parentGfx, pathData, { fill: getFillColor(element, defaultFillColor), fillOpacity: DEFAULT_FILL_OPACITY, stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - var elementObject = drawPath(parentGfx, pathData, outerAttrs); + }); var semantic = getSemantic(element); if (isCollection(semantic)) { - renderDataItemCollection(parentGfx, element, attrs); + renderDataItemCollection(parentGfx, element); } return elementObject; }, 'bpmn:DataObjectReference': as('bpmn:DataObject'), - 'bpmn:DataInput': function(parentGfx, element, attrs) { + 'bpmn:DataInput': function(parentGfx, element) { var arrowPathData = pathMap.getRawPath('DATA_ARROW'); // page - var elementObject = renderer('bpmn:DataObject')(parentGfx, element, attrs); + var elementObject = renderer('bpmn:DataObject')(parentGfx, element); - var innerAttrs = assign({ strokeWidth: 1 }, attrs); - /* input arrow path */ drawPath(parentGfx, arrowPathData, innerAttrs); + /* input arrow path */ drawPath(parentGfx, arrowPathData, { strokeWidth: 1 }); return elementObject; }, - 'bpmn:DataOutput': function(parentGfx, element, attrs) { + 'bpmn:DataOutput': function(parentGfx, element) { var arrowPathData = pathMap.getRawPath('DATA_ARROW'); // page - var elementObject = renderer('bpmn:DataObject')(parentGfx, element, attrs); + var elementObject = renderer('bpmn:DataObject')(parentGfx, element); - var arrowAttrs = assign({ + /* output arrow path */ drawPath(parentGfx, arrowPathData, { strokeWidth: 1, fill: 'black' - }, attrs); - /* output arrow path */ drawPath(parentGfx, arrowPathData, arrowAttrs); + }); return elementObject; }, - 'bpmn:DataStoreReference': function(parentGfx, element, attrs) { - attrs = assign({ - strokeWidth: 2, - fill: getFillColor(element, defaultFillColor), - fillOpacity: DEFAULT_FILL_OPACITY, - stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - + 'bpmn:DataStoreReference': function(parentGfx, element) { var DATA_STORE_PATH = pathMap.getScaledPath('DATA_STORE', { xScaleFactor: 1, yScaleFactor: 1, @@ -1622,20 +1563,25 @@ export default function BpmnRenderer( } }); - var elementStore = drawPath(parentGfx, DATA_STORE_PATH, attrs); + var elementStore = drawPath(parentGfx, DATA_STORE_PATH, { + strokeWidth: 2, + fill: getFillColor(element, defaultFillColor), + fillOpacity: DEFAULT_FILL_OPACITY, + stroke: getStrokeColor(element, defaultStrokeColor) + }); return elementStore; }, - 'bpmn:BoundaryEvent': function(parentGfx, element, attrs) { + 'bpmn:BoundaryEvent': function(parentGfx, element) { var semantic = getSemantic(element), cancel = semantic.cancelActivity; - attrs = assign({ + var attrs = { strokeWidth: 1, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }; if (!cancel) { attrs.strokeDasharray = '6'; @@ -1656,32 +1602,30 @@ export default function BpmnRenderer( /* inner path */ drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, innerAttrs); - renderEventContent(element, parentGfx, attrs); + renderEventContent(element, parentGfx); return outer; }, - 'bpmn:Group': function(parentGfx, element, attrs) { + 'bpmn:Group': function(parentGfx, element) { - attrs = assign({ + var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, { stroke: getStrokeColor(element, defaultStrokeColor), strokeWidth: 1, strokeDasharray: '8,3,1,3', fill: 'none', pointerEvents: 'none' - }, attrs); - - var group = drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, attrs); + }); return group; }, 'label': function(parentGfx, element) { return renderExternalLabel(parentGfx, element); }, - 'bpmn:TextAnnotation': function(parentGfx, element, attrs) { - var style = assign({}, attrs, { + 'bpmn:TextAnnotation': function(parentGfx, element) { + var style = { 'fill': 'none', 'stroke': 'none' - }); + }; var textElement = drawRect(parentGfx, element.width, element.height, 0, 0, style); @@ -1696,10 +1640,9 @@ export default function BpmnRenderer( } }); - var pathAttrs = assign({ + drawPath(parentGfx, textPathData, { stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - drawPath(parentGfx, textPathData, pathAttrs); + }); var text = getSemantic(element).text || ''; renderLabel(parentGfx, text, { @@ -1713,13 +1656,7 @@ export default function BpmnRenderer( return textElement; }, - 'ParticipantMultiplicityMarker': function(parentGfx, element, attrs) { - attrs = assign({ - strokeWidth: 2, - fill: getFillColor(element, defaultFillColor), - stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - + 'ParticipantMultiplicityMarker': function(parentGfx, element) { var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', { xScaleFactor: 1, yScaleFactor: 1, @@ -1731,15 +1668,18 @@ export default function BpmnRenderer( } }); - drawMarker('participant-multiplicity', parentGfx, markerPath, attrs); - }, - 'SubProcessMarker': function(parentGfx, element, attrs) { - attrs = assign({ + drawMarker('participant-multiplicity', parentGfx, markerPath, { + strokeWidth: 2, fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - - var markerRect = drawRect(parentGfx, 14, 14, 0, assign({ strokeWidth: 1 }, attrs)); + }); + }, + 'SubProcessMarker': function(parentGfx, element) { + var markerRect = drawRect(parentGfx, 14, 14, 0, { + strokeWidth: 1, + fill: getFillColor(element, defaultFillColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); // Process marker is placed in the middle of the box // therefore fixed values can be used here @@ -1756,14 +1696,12 @@ export default function BpmnRenderer( } }); - drawMarker('sub-process', parentGfx, markerPath, attrs); - }, - 'ParallelMarker': function(parentGfx, element, attrs, position) { - attrs = assign({ + drawMarker('sub-process', parentGfx, markerPath, { fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - + }); + }, + 'ParallelMarker': function(parentGfx, element, position) { var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', { xScaleFactor: 1, yScaleFactor: 1, @@ -1775,13 +1713,12 @@ export default function BpmnRenderer( } }); - drawMarker('parallel', parentGfx, markerPath, attrs); - }, - 'SequentialMarker': function(parentGfx, element, attrs, position) { - attrs = assign({ + drawMarker('parallel', parentGfx, markerPath, { fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); + }); + }, + 'SequentialMarker': function(parentGfx, element, position) { var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', { xScaleFactor: 1, yScaleFactor: 1, @@ -1793,15 +1730,12 @@ export default function BpmnRenderer( } }); - drawMarker('sequential', parentGfx, markerPath, attrs); - }, - 'CompensationMarker': function(parentGfx, element, attrs, position) { - attrs = assign({ - strokeWidth: 1, + drawMarker('sequential', parentGfx, markerPath, { fill: getFillColor(element, defaultFillColor), stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - + }); + }, + 'CompensationMarker': function(parentGfx, element, position) { var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', { xScaleFactor: 1, yScaleFactor: 1, @@ -1813,17 +1747,13 @@ export default function BpmnRenderer( } }); - drawMarker('compensation', parentGfx, markerMath, attrs); - }, - 'LoopMarker': function(parentGfx, element, attrs, position) { - attrs = assign({ + drawMarker('compensation', parentGfx, markerMath, { strokeWidth: 1, fill: getFillColor(element, defaultFillColor), - stroke: getStrokeColor(element, defaultStrokeColor), - strokeLinecap: 'round', - strokeMiterlimit: 0.5 - }, attrs); - + stroke: getStrokeColor(element, defaultStrokeColor) + }); + }, + 'LoopMarker': function(parentGfx, element, position) { var markerPath = pathMap.getScaledPath('MARKER_LOOP', { xScaleFactor: 1, yScaleFactor: 1, @@ -1835,15 +1765,15 @@ export default function BpmnRenderer( } }); - drawMarker('loop', parentGfx, markerPath, attrs); - }, - 'AdhocMarker': function(parentGfx, element, attrs, position) { - attrs = assign({ + drawMarker('loop', parentGfx, markerPath, { strokeWidth: 1, - fill: getStrokeColor(element, defaultStrokeColor), - stroke: getStrokeColor(element, defaultStrokeColor) - }, attrs); - + fill: getFillColor(element, defaultFillColor), + stroke: getStrokeColor(element, defaultStrokeColor), + strokeLinecap: 'round', + strokeMiterlimit: 0.5 + }); + }, + 'AdhocMarker': function(parentGfx, element, position) { var markerPath = pathMap.getScaledPath('MARKER_ADHOC', { xScaleFactor: 1, yScaleFactor: 1, @@ -1855,11 +1785,15 @@ export default function BpmnRenderer( } }); - drawMarker('adhoc', parentGfx, markerPath, attrs); + drawMarker('adhoc', parentGfx, markerPath, { + strokeWidth: 1, + fill: getStrokeColor(element, defaultStrokeColor), + stroke: getStrokeColor(element, defaultStrokeColor) + }); } }; - function attachTaskMarkers(parentGfx, element, attrs, taskMarkers) { + function attachTaskMarkers(parentGfx, element, taskMarkers) { var obj = getSemantic(element); var subprocess = taskMarkers && taskMarkers.indexOf('SubProcessMarker') !== -1; @@ -1884,15 +1818,15 @@ export default function BpmnRenderer( } forEach(taskMarkers, function(marker) { - renderer(marker)(parentGfx, element, attrs, position); + renderer(marker)(parentGfx, element, position); }); if (obj.isForCompensation) { - renderer('CompensationMarker')(parentGfx, element, attrs, position); + renderer('CompensationMarker')(parentGfx, element, position); } if (obj.$type === 'bpmn:AdHocSubProcess') { - renderer('AdhocMarker')(parentGfx, element, attrs, position); + renderer('AdhocMarker')(parentGfx, element, position); } var loopCharacteristics = obj.loopCharacteristics, @@ -1901,23 +1835,20 @@ export default function BpmnRenderer( if (loopCharacteristics) { if (isSequential === undefined) { - renderer('LoopMarker')(parentGfx, element, attrs, position); + renderer('LoopMarker')(parentGfx, element, position); } if (isSequential === false) { - renderer('ParallelMarker')(parentGfx, element, attrs, position); + renderer('ParallelMarker')(parentGfx, element, position); } if (isSequential === true) { - renderer('SequentialMarker')(parentGfx, element, attrs, position); + renderer('SequentialMarker')(parentGfx, element, position); } } } - function renderDataItemCollection(parentGfx, element, attrs) { - attrs = assign({ - strokeWidth: 2 - }, attrs); + function renderDataItemCollection(parentGfx, element) { var yPosition = (element.height - 18) / element.height; @@ -1932,7 +1863,9 @@ export default function BpmnRenderer( } }); - /* collection path */ drawPath(parentGfx, pathData, attrs); + /* collection path */ drawPath(parentGfx, pathData, { + strokeWidth: 2 + }); } @@ -1958,20 +1891,20 @@ BpmnRenderer.prototype.canRender = function(element) { return is(element, 'bpmn:BaseElement'); }; -BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs) { +BpmnRenderer.prototype.drawShape = function(parentGfx, element) { var type = element.type; var h = this.handlers[type]; /* jshint -W040 */ - return h(parentGfx, element, attrs); + return h(parentGfx, element); }; -BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs) { +BpmnRenderer.prototype.drawConnection = function(parentGfx, element) { var type = element.type; var h = this.handlers[type]; /* jshint -W040 */ - return h(parentGfx, element, attrs); + return h(parentGfx, element); }; BpmnRenderer.prototype.getShapePath = function(element) {