Skip to content

Commit a4f1f52

Browse files
committed
update
Signed-off-by: Zihan Kuang <zihan_kuang@outlook.com>
1 parent 5a93ed0 commit a4f1f52

6 files changed

Lines changed: 419 additions & 69 deletions

File tree

content/en/kanvas/designer/sharing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Sharing Designs
33
description: >
44
Share designs with other users and use access controls to manage design permissions and visibility.
5-
weight: 2
5+
weight: 3
66
categories: [Designer]
77
tags: [designs, collaboration, review]
88
aliases:

content/en/kanvas/designer/understanding-edges/images/embedded-design-edge-annotation-relationship-copy.js

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

content/en/kanvas/designer/understanding-edges/images/embedded-design-untitled-design.js

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
1.13 MB
Loading
Lines changed: 91 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,129 @@
11
---
22
title: Understanding Edge Styles
33
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.
55
weight: 2
66
categories: [Designer]
77
tags: [designs]
88
---
99

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.
1111

12-
## Semantic vs. Non-semantic Edges
12+
![Examples of changing edge styles in Kanvas](images/style-edge.gif)
1313

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
1515

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:
1717

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
1923

20-
## System Default Styles: The Visual Language of Kanvas
24+
Kanvas uses these edges during deployment to understand how your components should be connected.
2125

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/)
2327
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
2833

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.
3035

31-
## Customizing Your Edges: The Full Styling Toolkit
36+
## Edge Styles
3237

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
3439

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:
3641

37-
### 1. Line Style
42+
**Semantic Edges**
43+
- Style: Dotted line with an arrowhead
44+
- Color: Grey
45+
- Use: For all real infrastructure connections
3846

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" >}}
4048

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
4453

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" >}}
4755

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
5457

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.
5659

57-
While Kanvas defaults to a simple arrowhead, you can choose from a variety of endpoint styles for your custom diagrams.
60+
#### Line Styles
5861

59-
| Style | Recommended Use Case |
60-
| :--- | :--- |
61-
| `Arrowhead` (Default) | Clearly shows the direction of flow or dependency. |
62+
**Primary Styles (Most Commonly Used)**
6263

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
6768

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
6973

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
7177

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+
![Common line styles in Kanvas](images/line-styles.png)
7779

78-
| **Yellow** | Connections with warnings or those that require review. |
79-
| **Red** | Requires attention, a known issue, or a breaking change. |
80+
**Additional Options**
8081

81-
### 4. Labels and Annotations
82+
These styles are available for specialized use cases:
8283

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
8490

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
9097

91-
### 5. Visual Effects
98+
![Advanced style examples](images/advanced-styles.png)
9299

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.
94101
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+
![Color examples](images/color-examples.png)
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

layouts/shortcodes/meshery-design-embed.html

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
to visualize, explore, and collaborate on service mesh designs.
77
88
-- Usage:
9-
{{/*< meshery-design-embed src="path/to/embed.js" id="unique-id" style="custom-styles" >*/}}
9+
{{/*< meshery-design-embed src="path/to/embed.js" id="unique-id" size="full|half" >*/}}
10+
size: "full" for full-width (default), "half" for half-width display
1011
1112
More Information:
1213
Learn more about embedding Meshery designs at:
@@ -28,10 +29,31 @@
2829
{{ $id := .Get "id" }}
2930

3031
<!--
31-
Retrieve optional custom styles for the embedding container.
32-
If not provided, a default style will be applied to ensure proper rendering.
32+
Retrieve the size for the embedding container.
33+
If not provided, "full" is used as default.
3334
-->
34-
{{ $style := .Get "style" }}
35+
{{ $size := .Get "size" | default "full" }}
36+
37+
<style>
38+
.meshery-embed-container {
39+
border: 1px solid #eee;
40+
border-radius: 4px;
41+
margin: 1rem auto;
42+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
43+
}
44+
.meshery-embed-container.full {
45+
width: 100%;
46+
height: 30rem;
47+
}
48+
.meshery-embed-container.half {
49+
width: 50%;
50+
height: 30rem;
51+
}
52+
.meshery-embed-container .cy-container {
53+
width: 100%;
54+
height: 100%;
55+
}
56+
</style>
3557

3658
<!--
3759
Embedding Container:
@@ -45,11 +67,7 @@
4567
-->
4668
<div
4769
id="{{ $id }}"
48-
{{ if $style }}
49-
style="{{ $style }}"
50-
{{ else }}
51-
style="height: 30rem; width: 100%; border: 1px solid #eee"
52-
{{ end }}
70+
class="meshery-embed-container {{ $size }}"
5371
></div>
5472

5573
<!--

0 commit comments

Comments
 (0)