|
| 1 | +--- |
| 2 | +title: Understanding Edge Styles |
| 3 | +description: > |
| 4 | + Learn how to use and customize edge styles in Kanvas to create clear and meaningful designs. |
| 5 | +weight: 2 |
| 6 | +categories: [Designer] |
| 7 | +tags: [designs] |
| 8 | +--- |
| 9 | + |
| 10 | +When you connect components in [Kanvas](https://kanvas.new/), the line you draw is called an **edge**. Each edge visually represents a [relationship](https://docs.layer5.io/kanvas/concepts/relationships/) between your components. This guide explains how to use different edge styles to create clear and effective infrastructure designs. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## Understanding Edge Types |
| 15 | + |
| 16 | +In Kanvas, there are two main types of edges, each serving a different purpose: |
| 17 | + |
| 18 | +### Semantic Edges: Representing Real Infrastructure |
| 19 | + |
| 20 | +These edges represent real infrastructure relationships that Kanvas can understand and manage. For example: |
| 21 | +- Network connections between services |
| 22 | +- Volume mounts between containers |
| 23 | +- Dependencies between components |
| 24 | + |
| 25 | +What makes semantic edges special is their ability to automatically configure components in real-time as you design. When you draw a semantic edge, Kanvas immediately interprets the relationship and updates the components' configurations - for instance, a TCP connection edge automatically configures port bindings, while a volume mount edge updates container specifications. This real-time configuration makes semantic edges not just visual connectors, but active configuration tools that shape your infrastructure as you build it. |
| 26 | + |
| 27 | +> For detailed information about each relationship type and their configuration effects, visit [Relationships Documentation](https://docs.layer5.io/kanvas/concepts/relationships/) |
| 28 | +
|
| 29 | +### Non-semantic Edges: Annotating Your Designs |
| 30 | + |
| 31 | +These are visual aids that help you document and explain your design. They are useful for: |
| 32 | +- Adding explanatory notes |
| 33 | +- Showing conceptual relationships |
| 34 | +- Highlighting important connections |
| 35 | + |
| 36 | +Kanvas ignores these edges during deployment as they are purely for documentation. |
| 37 | + |
| 38 | +## Working with Edge Styles |
| 39 | + |
| 40 | +### Default Styles |
| 41 | + |
| 42 | +To help you quickly understand your designs, Kanvas uses specific default styles for each type of edge: |
| 43 | + |
| 44 | +**For Semantic Edges**: |
| 45 | +- Style: Dotted line with an arrowhead |
| 46 | +- Color: Grey/Blue |
| 47 | +- Use: For all real infrastructure connections |
| 48 | + |
| 49 | +{{< meshery-design-embed src="../understanding-edges/images/embedded-design-untitled-design.js" id="embedded-design-d0a031d0-b4d7-4d60-be17-c4b5d2480ee6" size="half" >}} |
| 50 | + |
| 51 | +**For Non-semantic Edges**: |
| 52 | +- Style: Solid line with an arrowhead |
| 53 | +- Color: Green |
| 54 | +- Use: For all visual annotations and notes |
| 55 | + |
| 56 | +{{< meshery-design-embed src="../understanding-edges/images/embedded-design-edge-annotation-relationship-copy.js" id="embedded-design-daecd14f-6c65-45d9-b74a-4fc536a7868f" size="half" >}} |
| 57 | + |
| 58 | +### Customizing Edge Styles |
| 59 | + |
| 60 | +While the default styles are designed to be clear and consistent, Kanvas gives you the flexibility to customize any edge to better suit your needs. Simply click an edge to reveal the styling toolbar. |
| 61 | + |
| 62 | +#### Choosing a Line Type |
| 63 | +- Dashed Line: For proposed or optional connections |
| 64 | +- Wave Line: For asynchronous or non-continuous connections |
| 65 | +- Zigzag Line: For disrupted or unreliable connections |
| 66 | +- Tree Line: For hierarchical relationships (parent-child, system-subsystem) |
| 67 | +- Line with Circles: For weak or indirect associations |
| 68 | +- Bezier Curve: For non-linear or indirect connections |
| 69 | + |
| 70 | +#### Defining Connection Points |
| 71 | +- Arrow Head (Default): Shows general direction or flow |
| 72 | +- Filled Diamond: For "whole-part" relationships (aggregation) |
| 73 | +- Filled Square: For strong ownership relationships (composition) |
| 74 | +- Filled Triangle: For inheritance or "is-a" relationships |
| 75 | +- Filled Circle: For loose containment relationships |
| 76 | + |
| 77 | +> **Note**: While Kanvas supports these UML-style relationships, the most commonly used styles are straight lines, dotted lines, and arrow heads. Use other styles when you need to express specific types of relationships in your designs. |
| 78 | +
|
| 79 | +#### Using Color for Visual Cues |
| 80 | + |
| 81 | +Colors help you create a visual language in your designs. While Kanvas has default colors, you can use any color to convey meaning: |
| 82 | + |
| 83 | +**Default Colors** |
| 84 | +- Green: For non-semantic annotations |
| 85 | +- Grey/Blue: For semantic relationships |
| 86 | + |
| 87 | +**Suggested Color Meanings** |
| 88 | +- Yellow: For connections that need review |
| 89 | +- Red: For issues or breaking changes |
| 90 | + |
| 91 | +#### Adding Labels |
| 92 | + |
| 93 | +You can add text directly to edges to provide more information. This is especially useful for: |
| 94 | +- Describing traffic flow (e.g., "User Traffic → API Gateway") |
| 95 | +- Adding process steps (e.g., "Requires Manual Review") |
| 96 | +- Noting important details (e.g., "Backup Route (Low Priority)") |
| 97 | +- Specifying protocols (e.g., "gRPC / 50051") |
| 98 | + |
| 99 | +#### Applying Visual Effects |
| 100 | + |
| 101 | +The "Marching-ants" animation effect can be added to any edge to: |
| 102 | +- Highlight specific connections in team reviews |
| 103 | +- Emphasize critical paths |
| 104 | + |
| 105 | +{{< alert title="Learn More About Interpreting Designs" type="info" >}} |
| 106 | +To learn how to interpret and understand designs in practice, including how components work together in a design, visit our comprehensive guide in the [Layer5 Academy](https://cloud.layer5.io/academy/learning-paths/mastering-meshery/introduction-to-meshery?chapter=interpreting-meshery-designs). |
| 107 | +{{< /alert >}} |
0 commit comments