mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	#6088 Updated offset calculations
This commit is contained in:
		
				
					committed by
					
						
						Ashish Jain
					
				
			
			
				
	
			
			
			
						parent
						
							9868f3a4c3
						
					
				
				
					commit
					1e672868c4
				
			@@ -900,6 +900,153 @@ flowchart LR
 | 
			
		||||
    n7@{ shape: rect}
 | 
			
		||||
    n8@{ shape: rect}
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('6088-1: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
      flowchart LR
 | 
			
		||||
      subgraph S2
 | 
			
		||||
      subgraph s1["APA"]
 | 
			
		||||
      D{"Use the editor"}
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      D -- Mermaid js --> I{"fa:fa-code Text"}
 | 
			
		||||
            D --> I
 | 
			
		||||
            D --> I
 | 
			
		||||
 | 
			
		||||
      end
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('6088-2: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
      flowchart LR
 | 
			
		||||
      a
 | 
			
		||||
      subgraph s0["APA"]
 | 
			
		||||
      subgraph s8["APA"]
 | 
			
		||||
      subgraph s1["APA"]
 | 
			
		||||
        D{"X"}
 | 
			
		||||
        E[Q]
 | 
			
		||||
      end
 | 
			
		||||
      subgraph s3["BAPA"]
 | 
			
		||||
        F[Q]
 | 
			
		||||
        I
 | 
			
		||||
      end
 | 
			
		||||
            D --> I
 | 
			
		||||
            D --> I
 | 
			
		||||
            D --> I
 | 
			
		||||
 | 
			
		||||
      I{"X"}
 | 
			
		||||
      end
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('6088-3: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
      flowchart LR
 | 
			
		||||
      a
 | 
			
		||||
        D{"Use the editor"}
 | 
			
		||||
 | 
			
		||||
      D -- Mermaid js --> I{"fa:fa-code Text"}
 | 
			
		||||
      D-->I
 | 
			
		||||
      D-->I
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('6088-4: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
flowchart LR
 | 
			
		||||
 subgraph s1["Untitled subgraph"]
 | 
			
		||||
        n1["Evaluate"]
 | 
			
		||||
        n2["Option 1"]
 | 
			
		||||
        n3["Option 2"]
 | 
			
		||||
        n4["fa:fa-car Option 3"]
 | 
			
		||||
  end
 | 
			
		||||
 subgraph s2["Untitled subgraph"]
 | 
			
		||||
        n5["Evaluate"]
 | 
			
		||||
        n6["Option 1"]
 | 
			
		||||
        n7["Option 2"]
 | 
			
		||||
        n8["fa:fa-car Option 3"]
 | 
			
		||||
  end
 | 
			
		||||
    A["Start"] -- Some text --> B("Continue")
 | 
			
		||||
    B --> C{"Evaluate"}
 | 
			
		||||
    C -- One --> D["Option 1"]
 | 
			
		||||
    C -- Two --> E["Option 2"]
 | 
			
		||||
    C -- Three --> F["fa:fa-car Option 3"]
 | 
			
		||||
    n1 -- One --> n2
 | 
			
		||||
    n1 -- Two --> n3
 | 
			
		||||
    n1 -- Three --> n4
 | 
			
		||||
    n5 -- One --> n6
 | 
			
		||||
    n5 -- Two --> n7
 | 
			
		||||
    n5 -- Three --> n8
 | 
			
		||||
    n1@{ shape: diam}
 | 
			
		||||
    n2@{ shape: rect}
 | 
			
		||||
    n3@{ shape: rect}
 | 
			
		||||
    n4@{ shape: rect}
 | 
			
		||||
    n5@{ shape: diam}
 | 
			
		||||
    n6@{ shape: rect}
 | 
			
		||||
    n7@{ shape: rect}
 | 
			
		||||
    n8@{ shape: rect}
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      it('6088-5: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
flowchart LR
 | 
			
		||||
    A{A} --> B & C
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
      });
 | 
			
		||||
      it('6088-6: should handle diamond shape intersections', () => {
 | 
			
		||||
        imgSnapshotTest(
 | 
			
		||||
          `---
 | 
			
		||||
config:
 | 
			
		||||
  layout: elk
 | 
			
		||||
---
 | 
			
		||||
flowchart LR
 | 
			
		||||
    A{A} --> B & C
 | 
			
		||||
    subgraph "subbe"
 | 
			
		||||
      A
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
`,
 | 
			
		||||
          { flowchart: { titleTopMargin: 0 } }
 | 
			
		||||
        );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user