diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index a9b33e87b..05a02147d 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -32,7 +32,7 @@ var dagreJS string const ( MIN_SEGMENT_LEN = 10 - MIN_RANK_SEP = 80 + MIN_RANK_SEP = 60 ) type ConfigurableOpts struct { diff --git a/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg b/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg index 6e4e30c89..88a6f7541 100644 --- a/d2renderers/d2sketch/testdata/all_shapes/sketch.exp.svg +++ b/d2renderers/d2sketch/testdata/all_shapes/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="1410" height="712" viewBox="-102 -102 1410 712">1https://d2lang.com -2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! -3https://terrastruct.com +}]]>1https://d2lang.com +2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! +3https://terrastruct.com 1Total abstinence is easier than perfect moderation -2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! +}]]>1Total abstinence is easier than perfect moderation +2Gee, I feel kind of LIGHT in the head now,knowing I can't make my satellite dish PAYMENTS! \ No newline at end of file diff --git a/e2etests/testdata/regression/elk_loop_panic/dagre/board.exp.json b/e2etests/testdata/regression/elk_loop_panic/dagre/board.exp.json index 411f09e45..c39ae2088 100644 --- a/e2etests/testdata/regression/elk_loop_panic/dagre/board.exp.json +++ b/e2etests/testdata/regression/elk_loop_panic/dagre/board.exp.json @@ -9,8 +9,8 @@ "x": 0, "y": 0 }, - "width": 306, - "height": 166, + "width": 226, + "height": 126, "opacity": 1, "strokeDash": 0, "strokeWidth": 2, @@ -39,7 +39,7 @@ "underline": false, "labelWidth": 13, "labelHeight": 36, - "labelPosition": "INSIDE_TOP_CENTER", + "labelPosition": "OUTSIDE_TOP_CENTER", "zIndex": 0, "level": 1 }, @@ -47,8 +47,8 @@ "id": "x.a", "type": "rectangle", "pos": { - "x": 50, - "y": 50 + "x": 30, + "y": 30 }, "width": 53, "height": 66, @@ -88,8 +88,8 @@ "id": "x.b", "type": "rectangle", "pos": { - "x": 203, - "y": 50 + "x": 143, + "y": 30 }, "width": 53, "height": 66, @@ -153,56 +153,56 @@ "labelPercentage": 0, "route": [ { - "x": 103, - "y": 68.38440111420613 + "x": 83, + "y": 44.193548387096776 }, { - "x": 129.66666666666669, - "y": 53.67688022284123 + "x": 99, + "y": 32.83870967741935 }, { - "x": 138, - "y": 50 + "x": 104, + "y": 30 }, { - "x": 140.5, - "y": 50 + "x": 105.5, + "y": 30 }, { - "x": 143, - "y": 50 + "x": 107, + "y": 30 }, { - "x": 146.33333333333331, - "y": 56.6 + "x": 109, + "y": 36.6 }, { - "x": 148.83333333333331, - "y": 66.5 + "x": 110.5, + "y": 46.5 }, { - "x": 151.33333333333334, - "y": 76.4 + "x": 112, + "y": 56.400000000000006 }, { - "x": 151.33333333333334, - "y": 89.6 + "x": 112, + "y": 69.6 }, { - "x": 148.83333333333331, - "y": 99.5 + "x": 110.5, + "y": 79.5 }, { - "x": 146.33333333333331, - "y": 109.4 + "x": 109, + "y": 89.4 }, { - "x": 129.66666666666669, - "y": 112.32311977715878 + "x": 99, + "y": 93.16129032258064 }, { - "x": 103, - "y": 97.61559888579387 + "x": 83, + "y": 81.80645161290323 } ], "isCurve": true, diff --git a/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg b/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg index 873e458b3..78a1cd8a7 100644 --- a/e2etests/testdata/regression/elk_loop_panic/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/elk_loop_panic/dagre/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="510" height="370" viewBox="-102 -102 510 370">

Oldest message

-

Offset

-

Last message

-

Next message will be
+

Oldest message

+

Offset

+

Last message

+

Next message will be
inserted here

-
M0M1M2M3M4M5M6 - +
M0M1M2M3M4M5M6 +

Oldest message

-

Offset

-

Last message

-

Next message will be
+

Oldest message

+

Offset

+

Last message

+

Next message will be
inserted here

-
M0M1M2M3M4M5M6 - +
M0M1M2M3M4M5M6 +

hey

+

hey

  • they
      @@ -804,8 +804,8 @@ width="299" height="651" viewBox="-102 -102 299 651">

      hey

      +

      hey

      • they
          @@ -804,8 +804,8 @@ width="299" height="651" viewBox="-90 -90 299 651">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. - - +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. + + 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 + + + + + + + + + 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 + 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

      +
      + 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 +

      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 +

      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 + + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + +
        +
        • Overview
          • Philosophy
          • @@ -808,8 +808,8 @@ width="583" height="636" viewBox="-102 -102 583 636">
              +
              • Overview
                • Philosophy
                • @@ -808,8 +808,8 @@ width="583" height="636" viewBox="-90 -90 583 636">
                    +
                    • Overview ok this is all measured
                      • Philosophy
                      • @@ -804,8 +804,8 @@ width="449" height="612" viewBox="-102 -102 449 612">
                          +
                          • Overview ok this is all measured
                            • Philosophy
                            • @@ -804,8 +804,8 @@ width="449" height="612" viewBox="-90 -90 449 612">
                                +
                                • Overview
                                  • Philosophy
                                  • @@ -829,8 +829,8 @@ width="551" height="1048" viewBox="-102 -102 551 1048">
                                      +
                                      • Overview
                                        • Philosophy
                                        • @@ -829,8 +829,8 @@ width="551" height="1048" viewBox="-90 -90 551 1048">

                                          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 +

                                    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 +

                              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 +

                              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

                              -

                              a header

                              +container

                              they did it in style

                              +

                              a header

                              a line of text and an

                              {
                               	indented: "block",
                              @@ -805,8 +805,8 @@ width="516" height="686" viewBox="-102 -102 516 686">container

                              they did it in style

                              -

                              a header

                              +container

                              they did it in style

                              +

                              a header

                              a line of text and an

                              {
                               	indented: "block",
                              @@ -805,8 +805,8 @@ width="566" height="736" viewBox="-90 -90 566 736">markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              +markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                              -
                              - +
                              + markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              +markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                              -
                              - +
                              + markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              +markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                              -
                              - +
                              + markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              +markdown

                              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

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

                              a line of text and an

                              +

                              a line of text and an

                              {
                               	indented: "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 +

                              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 +

                              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 +

                              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 + bearmama bearpapa bear - +bearmama bearpapa bear + bearmama bearpapa bear - +bearmama bearpapa bear + 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 + 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 +