Skip to content

Commit

Permalink
Merge pull request #2 from VitalyGushin/main
Browse files Browse the repository at this point in the history
Fix formatting.
  • Loading branch information
denis-tingaikin authored Dec 21, 2023
2 parents 23f8b97 + 324b2a1 commit 24884b8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const layouts: Record<string, any> = {
name: "dagre",
animate: false,
rankDir: "LR",
rankSep: 60,
rankSep: 70,
fit: true
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export const InterfaceSize = "10"
export enum InterfaceShape {
MEMIF = "ellipse",
TAP = "round-rectangle",
WIREGUARDG = "round-triangle"
WIREGUARDG = "round-triangle",
TUN = "round-diamond"
}

export enum EdgeLineType {
Expand Down
18 changes: 12 additions & 6 deletions src/pages/Dataplane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,24 @@ function getDataplaneStylesheet() {
selector: `node[type = '${NodeType.Interface}']`,
style: {
width: InterfaceSize,
height: InterfaceSize
height: InterfaceSize,
"font-size": "8px",
'text-background-color': Color.Gray,
'text-background-opacity': 1,
"text-background-shape": "roundrectangle",
'text-border-color': Color.Gray,
"text-border-width": "0.2em",
"text-border-opacity": 1
}
},
{
selector: `node[type = '${NodeType.Interface}'][label]`,
style: {
shape: (node: { data: (arg0: string) => string | string[] }) =>
node.data("label").includes("memif")
? InterfaceShape.MEMIF
: node.data("label").includes("wg")
? InterfaceShape.WIREGUARDG
: InterfaceShape.TAP
node.data("label").includes("memif") ? InterfaceShape.MEMIF :
node.data("label").includes("wg") ? InterfaceShape.WIREGUARDG :
node.data("label").includes("tun") ? InterfaceShape.TUN :
InterfaceShape.TAP
}
},
{
Expand Down

0 comments on commit 24884b8

Please sign in to comment.