From b7790ba6b5cd862ace174725eda72b5eb5fd2eee Mon Sep 17 00:00:00 2001 From: yari-dewalt Date: Fri, 13 Sep 2024 12:40:59 -0700 Subject: [PATCH] Add diagrams for testing --- cypress/platform/yari.html | 264 ++++++++++++++++++++++++++++++++++++- 1 file changed, 259 insertions(+), 5 deletions(-) diff --git a/cypress/platform/yari.html b/cypress/platform/yari.html index 0046813eb..ec1ae90b4 100644 --- a/cypress/platform/yari.html +++ b/cypress/platform/yari.html @@ -13,6 +13,13 @@ } +
+

Basic Class

+
+          flowchart TD
+            Start --> Stop
+        
+

Complex Class

@@ -72,10 +79,10 @@
         

Additional Classifiers

(* Abstract | $ Static)

- classDiagram class Square~Shape~{ int id* List~int~ position* setPoints(List~int~ points)* - getPoints()* List~int~ } Square : -List~string~ messages* Square : + classDiagram class Square~Shape~ { int id* List~int~ position* setPoints(List~int~ + points)* getPoints()* List~int~ } Square : -List~string~ messages$ Square : +setMessages(List~string~ messages)* Square : +getMessages()$ List~string~ Square : - +getDistanceMatrix() List~List~int~~ int$ + +getDistanceMatrix() List~List~int~~$
@@ -85,6 +92,64 @@ class Animal~test~["Animal with a label"]
+
+

Spacing

+

(Fix ensures consistent spacing rules)

+

(No space or single space?)

+
+          classDiagram
+          class ClassName {
+          -attribute:type
+          -            attribute : type
+               test
+          
+          + GetAttribute() type                 
+          +     GetAttribute() type
+          }
+        
+
+
+

Annotation

+
+          classDiagram
+          class Shape
+          <<interface>> Shape
+          Shape : noOfVertices
+          Shape : draw()
+        
+
+
+

Long Class Name Text

+
+          classDiagram
+          class ThisIsATestForALongClassName {
+            <<interface>>
+            noOfLetters
+            delete()
+          }
+        
+
+
+

Long Annotation Text

+
+          classDiagram
+          class Shape
+          <<superlongannotationtext>> Shape
+          Shape : noOfVertices
+          Shape : draw()
+        
+
+
+

Long Member Text

+
+          classDiagram
+          class Shape
+          <<interface>> Shape
+          Shape : noOfVertices
+          Shape : longtexttestkeepgoingandgoing
+          Shape : draw()
+        
+

Link

@@ -101,6 +166,23 @@
           click Shape href "https://www.github.com" "This is a tooltip for a link"
         
+
+

Hand Drawn

+
+          ---
+          config:
+            look: handDrawn
+            htmlLabels: true
+          ---
+          classDiagram
+          class Hand {
+            +String beakColor
+            +swim()
+            +quack()
+          }
+          style Hand fill:#f9f,stroke:#29f,stroke-width:2px
+        
+

Neutral Theme

@@ -198,7 +280,28 @@
         
-

Styling with Class

+

Styling with classDef Statement

+
+          classDiagram
+          class Duck:::bold {
+            +String beakColor
+            +swim()
+            +quack()
+          }
+
+          class Dog {
+            +int numTeeth
+            +bark()
+          }
+
+          cssClass "Duck,Dog" pink
+
+          classDef pink fill:#f9f
+          classDef bold stroke:#333,stroke-width:6px,color:#fff
+        
+
+
+

Styling with Class in Stylesheet

           classDiagram
           class Duck {
@@ -265,6 +368,156 @@
               }
         
+
+

Relations

+
+          classDiagram
+            classA <|-- classB
+            classC *-- classD
+            classE o-- classF
+            classG <-- classH
+            classI -- classJ
+            classK <.. classL
+            classM <|.. classN
+            classO .. classP
+        
+
+
+

Two Way Relation

+
+          classDiagram
+          class Animal {
+            int size
+            walk()
+          }
+          class Zebra {
+            int size
+            walk()
+          }
+            Animal o--|> Zebra
+
+        
+
+
+

Relations with Labels

+
+          classDiagram
+            classA <|-- classB : implements
+            classC *-- classD : composition
+            classE o-- classF : aggregation
+        
+
+
+

Cardinality / Multiplicity

+
+          classDiagram
+            Customer "1" --> "*" Ticket
+            Student "1" --> "1..*" Course
+            Galaxy --> "many" Star : Contains
+        
+
+
+

Complex Relations with Theme

+
+          ---
+          config:
+            theme: forest
+            look: handDrawn
+          ---
+          classDiagram
+            direction RL
+            class Student {
+              -idCard : IdCard
+            }
+            class IdCard{
+              -id : int
+              -name : string
+            }
+            class Bike{
+              -id : int
+              -name : string
+            }
+            Student "1" --o "1" IdCard : carries
+            Student "1" --o "1" Bike : rides
+        
+
+
+

Notes

+
+          classDiagram
+            note "This is a general note"
+            note for MyClass "This is a note for a class"
+            class MyClass
+        
+
+
+

Namespaces

+
+          classDiagram
+            namespace BaseShapes {
+                class Triangle
+                class Rectangle {
+                  double width
+                  double height
+                }
+            }
+        
+
+
+

Full Example

+
+          ---
+          title: Animal example
+          ---
+          classDiagram
+              note "From Duck till Zebra"
+              Animal <|--|> Duck
+              note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
+              Animal <|-- Fish
+              Animal <|--|> Zebra
+              Animal : +int age
+              Animal : +String gender
+              Animal: +isMammal()
+              Animal: +mate()
+              class Duck{
+                  +String beakColor
+                  +swim()
+                  +quack()
+              }
+              class Fish{
+                  -int sizeInFeet
+                  -canEat()
+              }
+              class Zebra{
+                  +bool is_wild
+                  +run()
+              }
+        
+
+
+

Full Example

+
+          ---
+            config:
+              theme: forest
+              look: handDrawn
+          ---
+          classDiagram
+          note for Outside "Note testing"
+          namespace Test {
+              class Outside
+          }
+          namespace BaseShapes {
+              class Triangle
+              class Rectangle {
+                double width
+                double height
+              }
+          }
+          Outside <|--|> Rectangle
+          style Triangle fill:#f9f,stroke:#333,stroke-width:4px
+        
+