diff --git a/README.md b/README.md index 4ef3f9a..d553e08 100644 --- a/README.md +++ b/README.md @@ -175,11 +175,11 @@ Bar -> Baz ### Simultaneous Actions (Beta!) -Simultaneous Actions preview - This is a work-in-progress feature. There are situations where this can lead to [ugly / unreadable overlapping content](https://github.com/davidje13/SequenceDiagram/issues/13). +Simultaneous Actions preview + ``` begin A, B, C, D A -> C diff --git a/screenshots/AgentAliases.png b/screenshots/AgentAliases.png index 0724670..4874eaa 100644 Binary files a/screenshots/AgentAliases.png and b/screenshots/AgentAliases.png differ diff --git a/screenshots/AlternativeAgentOrdering.png b/screenshots/AlternativeAgentOrdering.png index 9c32147..36d15e4 100644 Binary files a/screenshots/AlternativeAgentOrdering.png and b/screenshots/AlternativeAgentOrdering.png differ diff --git a/screenshots/ConnectionTypes.png b/screenshots/ConnectionTypes.png index a57f090..635302a 100644 Binary files a/screenshots/ConnectionTypes.png and b/screenshots/ConnectionTypes.png differ diff --git a/screenshots/Logic.png b/screenshots/Logic.png index 8bbe4c3..ee38587 100644 Binary files a/screenshots/Logic.png and b/screenshots/Logic.png differ diff --git a/screenshots/MultilineText.png b/screenshots/MultilineText.png index d22f46e..668af85 100644 Binary files a/screenshots/MultilineText.png and b/screenshots/MultilineText.png differ diff --git a/screenshots/NotesAndState.png b/screenshots/NotesAndState.png index b78ffa7..13704b1 100644 Binary files a/screenshots/NotesAndState.png and b/screenshots/NotesAndState.png differ diff --git a/screenshots/ShortLivedAgents.png b/screenshots/ShortLivedAgents.png index c61f0c0..c02aa07 100644 Binary files a/screenshots/ShortLivedAgents.png and b/screenshots/ShortLivedAgents.png differ diff --git a/screenshots/SimpleUsage.png b/screenshots/SimpleUsage.png index f8d0d82..8759381 100644 Binary files a/screenshots/SimpleUsage.png and b/screenshots/SimpleUsage.png differ diff --git a/screenshots/SimultaneousActions.png b/screenshots/SimultaneousActions.png index ea4665b..fe84688 100644 Binary files a/screenshots/SimultaneousActions.png and b/screenshots/SimultaneousActions.png differ diff --git a/scripts/sequence/components/Connect.js b/scripts/sequence/components/Connect.js index ab5d4c5..91a0cc9 100644 --- a/scripts/sequence/components/Connect.js +++ b/scripts/sequence/components/Connect.js @@ -74,6 +74,7 @@ define([ const config = env.theme.connect; const from = env.agentInfos.get(agentNames[0]); + const dx = config.arrow.width; const dy = config.arrow.height / 2; const short = getArrowShort(env.theme); @@ -88,7 +89,7 @@ define([ const x0 = ( lineX + short + - config.arrow.width + + dx + config.label.padding ); @@ -112,12 +113,14 @@ define([ ); const y1 = y0 + r * 2; + const space = short + dx / 2; + env.shapeLayer.appendChild(svg.make('path', Object.assign({ 'd': ( - 'M ' + (lineX + (options.left ? short : 0)) + ' ' + y0 + + 'M ' + (lineX + (options.left ? space : 0)) + ' ' + y0 + ' L ' + x1 + ' ' + y0 + ' A ' + r + ' ' + r + ' 0 0 1 ' + x1 + ' ' + y1 + - ' L ' + (lineX + (options.right ? short : 0)) + ' ' + y1 + ' L ' + (lineX + (options.right ? space : 0)) + ' ' + y1 ), }, config.lineAttrs[options.line]))); @@ -125,7 +128,7 @@ define([ drawHorizontalArrowHead(env.shapeLayer, { x: lineX + short, y: y0, - dx: config.arrow.width, + dx, dy, attrs: config.arrow.attrs, }); @@ -135,7 +138,7 @@ define([ drawHorizontalArrowHead(env.shapeLayer, { x: lineX + short, y: y1, - dx: config.arrow.width, + dx, dy, attrs: config.arrow.attrs, }); @@ -149,6 +152,7 @@ define([ const from = env.agentInfos.get(agentNames[0]); const to = env.agentInfos.get(agentNames[1]); + const dx = config.arrow.width; const dy = config.arrow.height / 2; const dir = (from.x < to.x) ? 1 : -1; const short = getArrowShort(env.theme); @@ -174,10 +178,12 @@ define([ SVGTextBlockClass: env.SVGTextBlockClass, }); + const space = short + dx / 2; + env.shapeLayer.appendChild(svg.make('line', Object.assign({ - 'x1': x0 + (options.left ? short : 0) * dir, + 'x1': x0 + (options.left ? space : 0) * dir, 'y1': y, - 'x2': x1 - (options.right ? short : 0) * dir, + 'x2': x1 - (options.right ? space : 0) * dir, 'y2': y, }, config.lineAttrs[options.line]))); @@ -185,7 +191,7 @@ define([ drawHorizontalArrowHead(env.shapeLayer, { x: x0 + short * dir, y, - dx: config.arrow.width * dir, + dx: dx * dir, dy, attrs: config.arrow.attrs, }); @@ -195,7 +201,7 @@ define([ drawHorizontalArrowHead(env.shapeLayer, { x: x1 - short * dir, y, - dx: -config.arrow.width * dir, + dx: -dx * dir, dy, attrs: config.arrow.attrs, }); diff --git a/scripts/sequence/sequence_integration_spec.js b/scripts/sequence/sequence_integration_spec.js index 0a772c5..e5d50e2 100644 --- a/scripts/sequence/sequence_integration_spec.js +++ b/scripts/sequence/sequence_integration_spec.js @@ -74,12 +74,12 @@ defineDescribe('Sequence Integration', [ const content = getSimplifiedContent(renderer); expect(content).toContain( - '' + '' ); // Agent 1 expect(content).toContain( - ' { titleMargin: 10, outerMargin: 5, agentMargin: 10, - actionMargin: 5, + actionMargin: 3, agentLineHighlightRadius: 4, agentCap: { @@ -42,7 +42,9 @@ define(['core/ArrayUtilities', 'svg/SVGShapes'], (array, SVGShapes) => { bar: { attrs: { 'fill': '#000000', - 'height': 5, + 'stroke': '#000000', + 'stroke-width': 1, + 'height': 4, }, }, none: { @@ -66,12 +68,12 @@ define(['core/ArrayUtilities', 'svg/SVGShapes'], (array, SVGShapes) => { }, }, arrow: { - width: 4, - height: 8, + width: 5, + height: 10, attrs: { 'fill': '#000000', - 'stroke': '#000000', - 'stroke-width': 1, + 'stroke': 'none', + 'stroke-width': 0, 'stroke-linejoin': 'miter', }, },