Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/graph/dotgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func multilinePrintableName(info *NodeInfo) string {
infoCopy.Name = strings.ReplaceAll(infoCopy.Name, "[...]", "[…]")
infoCopy.Name = strings.ReplaceAll(infoCopy.Name, ".", `\n`)
if infoCopy.File != "" {
infoCopy.File = filepath.Base(infoCopy.File)
infoCopy.File = escapeForDot(filepath.Base(infoCopy.File))
}
return strings.Join(infoCopy.NameComponents(), `\n`) + `\n`
}
Expand Down
2 changes: 1 addition & 1 deletion internal/graph/dotgraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestComposeWithStandardGraphAndURL(t *testing.T) {
func TestComposeWithNamesThatNeedEscaping(t *testing.T) {
g := baseGraph()
a, c := baseAttrsAndConfig()
g.Nodes[0].Info = NodeInfo{Name: `var"src"`}
g.Nodes[0].Info = NodeInfo{Name: `var"src"`, File: `src/file"name.cc`, Lineno: 10, Columnno: 2}
g.Nodes[1].Info = NodeInfo{Name: `var"#dest#"`}

var buf bytes.Buffer
Expand Down
4 changes: 2 additions & 2 deletions internal/graph/testdata/compose7.dot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
digraph "testtitle" {
node [style=filled fillcolor="#f8f8f8"]
subgraph cluster_L { "label1" [shape=box fontsize=16 label="label1\llabel2\llabel3: \"foo\"\l" tooltip="testtitle"] }
N1 [label="var\"src\"\n10 (10.00%)\nof 25 (25.00%)" id="node1" fontsize=22 shape=box tooltip="var\"src\" (25)" color="#b23c00" fillcolor="#edddd5"]
N1 [label="var\"src\"\nfile\"name.cc:10:2\n10 (10.00%)\nof 25 (25.00%)" id="node1" fontsize=22 shape=box tooltip="var\"src\" src/file\"name.cc:10:2 (25)" color="#b23c00" fillcolor="#edddd5"]
N2 [label="var\"#dest#\"\n15 (15.00%)\nof 25 (25.00%)" id="node2" fontsize=24 shape=box tooltip="var\"#dest#\" (25)" color="#b23c00" fillcolor="#edddd5"]
N1 -> N2 [label=" 10" weight=11 color="#b28559" tooltip="var\"src\" -> var\"#dest#\" (10)" labeltooltip="var\"src\" -> var\"#dest#\" (10)"]
N1 -> N2 [label=" 10" weight=11 color="#b28559" tooltip="var\"src\" src/file\"name.cc:10:2 -> var\"#dest#\" (10)" labeltooltip="var\"src\" src/file\"name.cc:10:2 -> var\"#dest#\" (10)"]
}
Loading