Skip to content

Commit 2960940

Browse files
committed
d2: use arrows instead of move
1 parent 4070611 commit 2960940

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

formatter/formatter_d2.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ func (f *D2LangFormatter) Format(td *TemplateData, templateContent string) (err
6262
portID := fmt.Sprintf("%s-port%d", hostID, port.PortID)
6363
graph, _, _ = d2oracle.Create(graph, nil, portID)
6464
portLabel := fmt.Sprintf("%d/%s\n%s\n%s", port.PortID, port.Protocol, port.State.State, port.Service.Name)
65-
graph, _ = d2oracle.Set(graph, nil, portID+".label", nil, &portLabel)
65+
graph, _ = d2oracle.Set(graph, nil, fmt.Sprintf("%s.label", portID), nil, &portLabel)
6666
shape := "circle"
67-
graph, _ = d2oracle.Set(graph, nil, portID+".shape", nil, &shape)
67+
graph, _ = d2oracle.Set(graph, nil, fmt.Sprintf("%s.shape", portID), nil, &shape)
6868
width := "25"
69-
graph, _ = d2oracle.Set(graph, nil, portID+".width", nil, &width)
70-
graph, _ = d2oracle.Move(graph, nil, portID, hostID+"."+portID, true)
69+
graph, _ = d2oracle.Set(graph, nil, fmt.Sprintf("%s.width", portID), nil, &width)
70+
graph, _ = d2oracle.Set(graph, nil, hostID+" -> "+portID, nil, nil)
7171
}
7272
}
7373
_, err = f.config.Writer.Write([]byte(d2format.Format(graph.AST)))

0 commit comments

Comments
 (0)