|
1 | 1 | --- |
2 | 2 | title: Understanding Edge Styles |
3 | 3 | description: > |
4 | | - Learn how to interpret and customize the different types of edges in Kanvas to represent relationships between components in your infrastructure designs. |
| 4 | + Learn how to use and customize edge styles in Kanvas to create clear and meaningful designs. |
5 | 5 | weight: 2 |
6 | 6 | categories: [Designer] |
7 | 7 | tags: [designs] |
8 | 8 | --- |
9 | 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.meshery.io/concepts/logical/relationships) between your components. Understanding how to style these edges is key to creating clear and effective infrastructure diagrams. |
| 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 will help you understand how to use different edge styles to create clear and effective infrastructure diagrams. |
11 | 11 |
|
12 | | -## Semantic vs. Non-semantic Edges |
| 12 | + |
13 | 13 |
|
14 | | -Edges in Kanvas fall into two fundamental categories, distinguished by whether they have a built-in meaning that the system can act upon. |
| 14 | +## Types of Edges |
15 | 15 |
|
16 | | -- **Semantic (Orchestratable) Edges**: These represent real infrastructure relationships that Kanvas understands, such as network links or volume mounts. Kanvas can use this information during deployment. |
| 16 | +In Kanvas, there are two main types of edges, each serving a different purpose: |
17 | 17 |
|
18 | | -- **Non-semantic (Annotation-Only) Edges**: These are purely for your visual and organizational aid. They help you document designs and illustrate concepts but are ignored by Kanvas during deployment. |
| 18 | +### Semantic Edges |
| 19 | +These edges represent real infrastructure relationships that Kanvas can understand and manage. For example: |
| 20 | +- Network connections between services |
| 21 | +- Volume mounts between containers |
| 22 | +- Dependencies between components |
19 | 23 |
|
20 | | -## System Default Styles: The Visual Language of Kanvas |
| 24 | +Kanvas uses these edges during deployment to understand how your components should be connected. |
21 | 25 |
|
22 | | -To provide a consistent and recognizable visual language, Kanvas uses a specific, minimal set of styles for edges that are created by default. These styles give you immediate, at-a-glance information about an edge's nature. |
| 26 | +> For detailed information about each relationship type, visit [Relationships Documentation](https://docs.layer5.io/kanvas/concepts/relationships/) |
23 | 27 |
|
24 | | -| For this Relationship... | Kanvas Uses this Style... | Meaning | |
25 | | -| :--- | :--- | :--- | |
26 | | -| **Semantic Relationship**<br>(e.g., `Edge-Network`, `Edge-Mount`) | A **Dotted Line** with a standard **Arrowhead**. | This signifies a logical or dynamic connection that is managed by the system. The default color is typically blue or white. | |
27 | | -| **Non-semantic Annotation** | A **Solid Line** with a standard **Arrowhead**. | This signifies a direct visual note created by the user. The default color is a distinct **Green/Teal** to visually separate it from semantic edges. | |
| 28 | +### Non-semantic Edges |
| 29 | +These are visual aids that help you document and explain your design. They are useful for: |
| 30 | +- Adding explanatory notes |
| 31 | +- Showing conceptual relationships |
| 32 | +- Highlighting important connections |
28 | 33 |
|
29 | | -These defaults serve as a community convention, but as you'll see next, you have the power to change them. |
| 34 | +Kanvas ignores these edges during deployment as they are purely for documentation. |
30 | 35 |
|
31 | | -## Customizing Your Edges: The Full Styling Toolkit |
| 36 | +## Edge Styles |
32 | 37 |
|
33 | | -A key principle in Kanvas is flexibility. **All edges, whether semantic or non-semantic, support a rich set of visual customizations.** Simply select any edge on the canvas to reveal the floating styling toolbar. |
| 38 | +### Default Edge Styles |
34 | 39 |
|
35 | | -From here, you can override the defaults and tailor the appearance of any edge to fit your needs. |
| 40 | +To help you quickly understand your diagrams, Kanvas uses specific default styles for each type of edge: |
36 | 41 |
|
37 | | -### 1. Line Style |
| 42 | +**Semantic Edges** |
| 43 | +- Style: Dotted line with an arrowhead |
| 44 | +- Color: Grey |
| 45 | +- Use: For all real infrastructure connections |
38 | 46 |
|
39 | | -Controls the edge's shape and pattern. |
| 47 | +{{< meshery-design-embed src="../understanding-edges/images/embedded-design-untitled-design.js" id="embedded-design-d0a031d0-b4d7-4d60-be17-c4b5d2480ee6" size="half" >}} |
40 | 48 |
|
41 | | -- **Basic Styles**:(系统默认的样式通常是这两种) |
42 | | - - `Solid Line` - **Recommended for**: Direct visual annotations (the default for annotations). |
43 | | - - `Dotted Line` - **Recommended for**: Standard semantic relationships (the default for semantic edges). |
| 49 | +**Non-semantic Edges** |
| 50 | +- Style: Solid line with an arrowhead |
| 51 | +- Color: Green |
| 52 | +- Use: For all visual annotations and notes |
44 | 53 |
|
45 | | -我们还有 |
46 | | - - `Dashed Line` - **Recommended for**: Indicating a proposed or optional connection. |
| 54 | +{{< meshery-design-embed src="../understanding-edges/images/embedded-design-edge-annotation-relationship-copy.js" id="embedded-design-daecd14f-6c65-45d9-b74a-4fc536a7868f" size="half" >}} |
47 | 55 |
|
48 | | -这些是系统中很少看到,但是提供你自定义的: |
49 | | -- **Advanced Shapes**: |
50 | | - - `Zigzag Line` - **Recommended for**: Showing indirect paths that need to avoid other components. |
51 | | - - `Wave Line` - **Recommended for**: Representing a flexible or non-critical connection. |
52 | | - - `Bezier Curve` - **Recommended for**: Creating smooth, aesthetically pleasing layouts. |
53 | | - - `Line with Circles` - **Recommended for**: Highlighting specific points or stages along a path. |
| 56 | +### Customizing Edge Styles |
54 | 57 |
|
55 | | -### 2. Endpoint Style |
| 58 | +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 select an edge to reveal the styling toolbar. |
56 | 59 |
|
57 | | -While Kanvas defaults to a simple arrowhead, you can choose from a variety of endpoint styles for your custom diagrams. |
| 60 | +#### Line Styles |
58 | 61 |
|
59 | | -| Style | Recommended Use Case | |
60 | | -| :--- | :--- | |
61 | | -| `Arrowhead` (Default) | Clearly shows the direction of flow or dependency. | |
| 62 | +**Primary Styles (Most Commonly Used)** |
62 | 63 |
|
63 | | -提供自定义的样式: |
64 | | -| `Filled Diamond` | Can represent decision points or conditional flows. | |
65 | | -| `Filled Square` | Useful for termination points or specific API interfaces. | |
66 | | -| `Filled Triangle` | A strong alternative for indicating direction. | |
| 64 | +Straight Line |
| 65 | +- Default for most connections |
| 66 | +- Best for: Direct relationships and simple associations |
| 67 | +- Visual meaning: A clear, straightforward connection |
67 | 68 |
|
68 | | -### 3. Color Coding |
| 69 | +Dotted Line |
| 70 | +- Default for semantic edges |
| 71 | +- Best for: Infrastructure connections (like network links, volume mounts) |
| 72 | +- Visual meaning: A system-managed connection |
69 | 73 |
|
70 | | -The color tool is perfect for creating your own visual language. Use it to categorize connections or draw attention to specific parts of your design. |
| 74 | +Bezier Curve |
| 75 | +- Best for: Non-linear or indirect connections |
| 76 | +- Visual meaning: A smooth, curved relationship between components |
71 | 77 |
|
72 | | -**Suggested Color Palette**: |
73 | | -| Color | Suggested Meaning | |
74 | | -| :--- | :--- | |
75 | | -| **Green** | Approved, active, or successfully deployed paths. | |
76 | | -| **Blue/White** | Standard documentation or default state. | |
| 78 | + |
77 | 79 |
|
78 | | -| **Yellow** | Connections with warnings or those that require review. | |
79 | | -| **Red** | Requires attention, a known issue, or a breaking change. | |
| 80 | +**Additional Options** |
80 | 81 |
|
81 | | -### 4. Labels and Annotations |
| 82 | +These styles are available for specialized use cases: |
82 | 83 |
|
83 | | -The rename tool lets you add descriptive text directly on the edge, which is a powerful way to document your design. |
| 84 | +Line Types |
| 85 | +- Dashed Line: For proposed or optional connections |
| 86 | +- Wave Line: For asynchronous or non-continuous connections |
| 87 | +- Zigzag Line: For disrupted or unreliable connections |
| 88 | +- Tree Line: For hierarchical relationships (parent-child, system-subsystem) |
| 89 | +- Line with Circles: For weak or indirect associations |
84 | 90 |
|
85 | | -**Examples**: |
86 | | -- Describe traffic flow: `"User Traffic → API Gateway"` |
87 | | -- Add process steps: `"Requires Manual Review"` |
88 | | -- Note important details: `"Backup Route (Low Priority)"` |
89 | | -- Specify protocols: `"gRPC / 50051"` |
| 91 | +Endpoint Styles |
| 92 | +- Arrow Head (Default): Shows general direction or flow |
| 93 | +- Filled Diamond: For "whole-part" relationships (aggregation) |
| 94 | +- Filled Square: For strong ownership relationships (composition) |
| 95 | +- Filled Triangle: For inheritance or "is-a" relationships |
| 96 | +- Filled Circle: For loose containment relationships |
90 | 97 |
|
91 | | -### 5. Visual Effects |
| 98 | + |
92 | 99 |
|
93 | | -The "Marching-ants" effect adds an animated stroke to your edge. |
| 100 | +> **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 diagrams. |
94 | 101 |
|
95 | | -**Best For**: |
96 | | -- Drawing attention to a critical path during a presentation or demo. |
97 | | -- Highlighting the exact edge you are discussing in a team review. |
| 102 | +#### Colors |
| 103 | + |
| 104 | +Colors help you create a visual language in your diagrams. While Kanvas has default colors, you can use any color to convey meaning: |
| 105 | + |
| 106 | +Default Colors |
| 107 | +- Green: For non-semantic annotations |
| 108 | +- Grey: For semantic relationships |
| 109 | + |
| 110 | +Suggested Color Meanings |
| 111 | +- Yellow: For connections that need review |
| 112 | +- Red: For issues or breaking changes |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | +### Labels and Annotations |
| 117 | + |
| 118 | +You can add text directly to edges to provide more information. This is especially useful for: |
| 119 | +- Describing traffic flow (e.g., "User Traffic → API Gateway") |
| 120 | +- Adding process steps (e.g., "Requires Manual Review") |
| 121 | +- Noting important details (e.g., "Backup Route (Low Priority)") |
| 122 | +- Specifying protocols (e.g., "gRPC / 50051") |
| 123 | + |
| 124 | +### Visual Effects |
| 125 | + |
| 126 | +The "Marching-ants" animation effect can be added to any edge to: |
| 127 | +- Draw attention during presentations |
| 128 | +- Highlight specific connections in team reviews |
| 129 | +- Emphasize critical paths |
0 commit comments