diff --git a/d2layouts/d2elklayout/layout.go b/d2layouts/d2elklayout/layout.go index b4c6dd464..886d3424a 100644 --- a/d2layouts/d2elklayout/layout.go +++ b/d2layouts/d2elklayout/layout.go @@ -87,7 +87,7 @@ type ConfigurableOpts struct { var DefaultOpts = ConfigurableOpts{ Algorithm: "layered", - NodeSpacing: 60.0, + NodeSpacing: 70.0, Padding: "[top=50,left=50,bottom=50,right=50]", EdgeNodeSpacing: 40.0, SelfLoopSpacing: 50.0, diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 2752d9a95..e5ec7590f 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -117,8 +117,8 @@ func arrowheadDimensions(arrowhead d2target.Arrowhead, strokeWidth float64) (wid widthMultiplier = 12 heightMultiplier = 12 case d2target.CfOne, d2target.CfMany, d2target.CfOneRequired, d2target.CfManyRequired: - widthMultiplier = 11 - heightMultiplier = 12 + widthMultiplier = 9 + heightMultiplier = 9 } clippedStrokeWidth := go2.Max(MIN_ARROWHEAD_STROKE_WIDTH, strokeWidth) @@ -265,7 +265,7 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s case d2target.CfOne, d2target.CfMany, d2target.CfOneRequired, d2target.CfManyRequired: attrs := fmt.Sprintf(`class="connection" stroke="%s" stroke-width="%d" fill="white"`, connection.Stroke, connection.StrokeWidth) - offset := 4.0 + float64(connection.StrokeWidth*2) + offset := 3.0 + float64(connection.StrokeWidth)*1.8 var modifier string if arrowhead == d2target.CfOneRequired || arrowhead == d2target.CfManyRequired { modifier = fmt.Sprintf(``, @@ -276,7 +276,7 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s } else { modifier = fmt.Sprintf(``, attrs, - offset/2.0+1.0, height/2.0, + offset/2.0+2.0, height/2.0, offset/2.0, ) } @@ -288,9 +288,9 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s attrs, modifier, width-3.0, height/2.0, width+offset, height/2.0, - offset+2.0, height/2.0, + offset+3.0, height/2.0, width+offset, 0., - offset+2.0, height/2.0, + offset+3.0, height/2.0, width+offset, height, ) } else { @@ -298,8 +298,8 @@ func arrowheadMarker(isTarget bool, id string, connection d2target.Connection) s attrs, modifier, width-3.0, height/2.0, width+offset, height/2.0, - offset*1.6, 0., - offset*1.6, height, + offset*2.0, 0., + offset*2.0, height, ) } default: diff --git a/e2etests/testdata/regression/dagre_broken_arrowhead/elk/board.exp.json b/e2etests/testdata/regression/dagre_broken_arrowhead/elk/board.exp.json index d937d693c..bd9a8407f 100644 --- a/e2etests/testdata/regression/dagre_broken_arrowhead/elk/board.exp.json +++ b/e2etests/testdata/regression/dagre_broken_arrowhead/elk/board.exp.json @@ -10,7 +10,7 @@ "y": 12 }, "width": 290, - "height": 541, + "height": 551, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -89,7 +89,7 @@ "type": "rectangle", "pos": { "x": 76, - "y": 337 + "y": 347 }, "width": 154, "height": 166, @@ -130,7 +130,7 @@ "type": "rectangle", "pos": { "x": 127, - "y": 191 + "y": 201 }, "width": 52, "height": 66, @@ -171,7 +171,7 @@ "type": "rectangle", "pos": { "x": 199, - "y": 191 + "y": 201 }, "width": 53, "height": 66, @@ -212,7 +212,7 @@ "type": "rectangle", "pos": { "x": 126, - "y": 387 + "y": 397 }, "width": 54, "height": 66, @@ -281,15 +281,15 @@ }, { "x": 88.5, - "y": 297 + "y": 307 }, { "x": 115, - "y": 297 + "y": 307 }, { "x": 115, - "y": 337 + "y": 347 } ], "animated": false, @@ -324,11 +324,11 @@ "route": [ { "x": 153.5, - "y": 257 + "y": 267 }, { "x": 153.5, - "y": 337 + "y": 347 } ], "animated": false, @@ -363,19 +363,19 @@ "route": [ { "x": 226, - "y": 257 + "y": 267 }, { "x": 226, - "y": 297 + "y": 307 }, { "x": 192, - "y": 297 + "y": 307 }, { "x": 192, - "y": 337 + "y": 347 } ], "animated": false, diff --git a/e2etests/testdata/regression/dagre_broken_arrowhead/elk/sketch.exp.svg b/e2etests/testdata/regression/dagre_broken_arrowhead/elk/sketch.exp.svg index 2bb759d8c..25a9c2e9f 100644 --- a/e2etests/testdata/regression/dagre_broken_arrowhead/elk/sketch.exp.svg +++ b/e2etests/testdata/regression/dagre_broken_arrowhead/elk/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="494" height="745" viewBox="-90 -90 494 745">

hey

+

hey

  • they
      @@ -804,8 +804,8 @@ width="299" height="571" viewBox="-90 -90 299 571">x

      linux: because a PC is a terrible thing to waste

      -
      a You don't have to know how the computer works,just how to work the computer. - - +
a You don't have to know how the computer works,just how to work the computer. + + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + - - + + xyThe top of the mountain

Cats, no less liquid than their shadows, offer no angles to the wind.

+xyThe top of the mountain

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-
JoeDonaldi am top lefti am top righti am bottom lefti am bottom right - +
JoeDonaldi am top lefti am top righti am bottom lefti am bottom right + poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

-
- +poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

+
+

Markdown: Syntax

+

Markdown: Syntax

  • Overview
      @@ -1053,8 +1053,8 @@ title for the link, surrounded in quotes. For example:

      Code

      Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:

      -
ab - +
ab +

Note: This document is itself written using Markdown; you +

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

-
ab - +
ab + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + +
    +
    • Overview
      • Philosophy
      • @@ -808,8 +808,8 @@ width="583" height="556" viewBox="-90 -90 583 556">
          +
          • Overview ok this is all measured
            • Philosophy
            • @@ -804,8 +804,8 @@ width="449" height="532" viewBox="-90 -90 449 532">
                +
                • Overview
                  • Philosophy
                  • @@ -829,8 +829,8 @@ width="551" height="968" viewBox="-90 -90 551 968">

                    List items may consist of multiple paragraphs. Each subsequent +

                    List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:

                      @@ -827,8 +827,8 @@ sit amet, consectetuer adipiscing elit.

                      Another item in the same list.

                  -
                ab - +
              ab +

              Markdown: Syntax

              -
              ab - +

              Markdown: Syntax

              +
              ab +

              Every frustum longs to be a cone

              +

              Every frustum longs to be a cone

              • A continuing flow of paper is sufficient to continue the flow of paper
              • Please remain calm, it's no use both of us being hysterical at the same time
              • Visits always give pleasure: if not on arrival, then on the departure

              Festivity Level 1: Your guests are chatting amiably with each other.

              -
              xy - +
              xy + container

              they did it in style

              +container

              they did it in style

              a header

              a line of text and an

              {
              @@ -805,8 +805,8 @@ width="516" height="646" viewBox="-90 -90 516 646">
              {
              +
              {
               	fenced: "block",
               	of: "json",
               }
               
              -
              ab - +
              ab +

              a line of text and an

              +

              a line of text and an

              {
               	indented: "block",
               	of: "json",
               }
               
              -
              ab - +
              ab +

              code

              -
              ab - +

              code

              +
              ab +

              A paragraph is simply one or more consecutive lines of text, separated +

              A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

              -
              ab - +
              ab +

              Here is an example of AppleScript:

              +

              Here is an example of AppleScript:

              tell application "Foo"
                   beep
               end tell
               

              A code block continues until it reaches a line that is not indented (or the end of the article).

              -
              ab - +
              ab + containerscloudtall cylinderclass- -num -int- -timeout -int- -pid -+ -getStatus() -Enum+ -getJobs() -Job[]+ -setTimeout(seconds int) -voidusersid -int -name -string -email -string -password -string -last_login -datetime -container

              markdown text expanded to 800x400

              -
              := 5 +containerscloudtall cylinderclass- +num +int- +timeout +int- +pid ++ +getStatus() +Enum+ +getJobs() +Job[]+ +setTimeout(seconds int) +voidusersid +int +name +string +email +string +password +string +last_login +datetime +container

              markdown text expanded to 800x400

              +
              := 5 := a + 7 -fmt.Printf("%d", b):= 5 +fmt.Printf("%d", b):= 5 := a + 7 -fmt.Printf("%d", b)circle containerdiamond containeroval containerhexagon containerdiamondcirclehexagonoval - +
              fmt.Printf("%d", b)
              circle containerdiamond containeroval containerhexagon containerdiamondcirclehexagonoval +