From 5fc492669e80c5bcea3b531eb83f010de1340a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 6 Jan 2023 16:03:39 -0300 Subject: [PATCH 01/12] Fix table prefix check --- d2compiler/compile.go | 4 +- d2compiler/compile_test.go | 25 + e2etests/regression_test.go | 21 + .../wrong_table_column/dagre/board.exp.json | 394 ++++++ .../wrong_table_column/dagre/sketch.exp.svg | 49 + .../wrong_table_column/elk/board.exp.json | 385 ++++++ .../wrong_table_column/elk/sketch.exp.svg | 49 + .../TestCompile/wrong_column_index.exp.json | 1163 +++++++++++++++++ 8 files changed, 2088 insertions(+), 2 deletions(-) create mode 100644 e2etests/testdata/regression/wrong_table_column/dagre/board.exp.json create mode 100644 e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/regression/wrong_table_column/elk/board.exp.json create mode 100644 e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg create mode 100644 testdata/d2compiler/TestCompile/wrong_column_index.exp.json diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 2e4d75c3b..51014adc0 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -666,7 +666,7 @@ func (c *compiler) compileSQLTable(obj *d2graph.Object) { obj.SQLTable = &d2target.SQLTable{} parentID := obj.Parent.AbsID() - tableID := obj.AbsID() + prefixTableID := obj.AbsID() + "." for _, col := range obj.ChildrenArray { if col.IDVal == "style" { continue @@ -702,7 +702,7 @@ func (c *compiler) compileSQLTable(obj *d2graph.Object) { srcID := e.Src.AbsID() dstID := e.Dst.AbsID() // skip edges between columns of the same table - if strings.HasPrefix(srcID, tableID) && strings.HasPrefix(dstID, tableID) { + if strings.HasPrefix(srcID, prefixTableID) && strings.HasPrefix(dstID, prefixTableID) { continue } if srcID == absID { diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 52a2e3149..ddb51cf8c 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1843,6 +1843,31 @@ choo: { expErr: `d2/testdata/d2compiler/TestCompile/sql-panic.d2:3:27: constraint value must be a string `, }, + { + name: "wrong_column_index", + text: `Chinchillas: { + shape: sql_table + id: int {constraint: primary_key} + whisker_len: int + fur_color: string + age: int + server: int {constraint: foreign_key} + caretaker: int {constraint: foreign_key} +} + +Chinchillas_Collectibles: { + shape: sql_table + id: int + collectible: id {constraint: foreign_key} + chinchilla: id {constraint: foreign_key} +} + +Chinchillas_Collectibles.chinchilla -> Chinchillas.id`, + assertions: func(t *testing.T, g *d2graph.Graph) { + tassert.Equal(t, 0, *g.Edges[0].DstTableColumnIndex) + tassert.Equal(t, 2, *g.Edges[0].SrcTableColumnIndex) + }, + }, } for _, tc := range testCases { diff --git a/e2etests/regression_test.go b/e2etests/regression_test.go index aa8ca3b37..09468d493 100644 --- a/e2etests/regression_test.go +++ b/e2etests/regression_test.go @@ -284,6 +284,27 @@ table with short col: RefreshAuthorizationPolicyCache { class -> table -> table with short col `, }, + { + name: "wrong_table_column", + script: `Chinchillas: { + shape: sql_table + id: int {constraint: primary_key} + whisker_len: int + fur_color: string + age: int + server: int {constraint: foreign_key} + caretaker: int {constraint: foreign_key} +} + +Chinchillas_Collectibles: { + shape: sql_table + id: int + collectible: id {constraint: foreign_key} + chinchilla: id {constraint: foreign_key} +} + +Chinchillas_Collectibles.chinchilla -> Chinchillas.id`, + }, } runa(t, tcs) diff --git a/e2etests/testdata/regression/wrong_table_column/dagre/board.exp.json b/e2etests/testdata/regression/wrong_table_column/dagre/board.exp.json new file mode 100644 index 000000000..6f2224f03 --- /dev/null +++ b/e2etests/testdata/regression/wrong_table_column/dagre/board.exp.json @@ -0,0 +1,394 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "Chinchillas", + "type": "sql_table", + "pos": { + "x": 19, + "y": 244 + }, + "width": 259, + "height": 252, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#0A0F25", + "stroke": "#FFFFFF", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "primary_key", + "reference": "" + }, + { + "name": { + "label": "whisker_len", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 101, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "fur_color", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 77, + "labelHeight": 26 + }, + "type": { + "label": "string", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "age", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 30, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "server", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 52, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "caretaker", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 80, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + } + ], + "label": "Chinchillas", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 120, + "labelHeight": 36, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "#0D32B2", + "secondaryAccentColor": "#4A6FF3", + "neutralAccentColor": "#676C7E" + }, + { + "id": "Chinchillas_Collectibles", + "type": "sql_table", + "pos": { + "x": 0, + "y": 0 + }, + "width": 297, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#0A0F25", + "stroke": "#FFFFFF", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "collectible", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 88, + "labelHeight": 26 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "chinchilla", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 80, + "labelHeight": 26 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "Chinchillas.id" + } + ], + "label": "Chinchillas_Collectibles", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 257, + "labelHeight": 36, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "#0D32B2", + "secondaryAccentColor": "#4A6FF3", + "neutralAccentColor": "#676C7E" + } + ], + "connections": [ + { + "id": "(Chinchillas_Collectibles -> Chinchillas)[0]", + "src": "Chinchillas_Collectibles", + "srcArrow": "none", + "srcLabel": "", + "dst": "Chinchillas", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 148.5, + "y": 144 + }, + { + "x": 148.5, + "y": 184 + }, + { + "x": 148.5, + "y": 204 + }, + { + "x": 148.5, + "y": 244 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg b/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg new file mode 100644 index 000000000..85c13996e --- /dev/null +++ b/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg @@ -0,0 +1,49 @@ + +Chinchillasid +int +PKwhisker_len +int +fur_color +string +age +int +server +int +FKcaretaker +int +FKChinchillas_Collectiblesid +int +collectible +id +FKchinchilla +id +FK + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json b/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json new file mode 100644 index 000000000..2164a914a --- /dev/null +++ b/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json @@ -0,0 +1,385 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "Chinchillas", + "type": "sql_table", + "pos": { + "x": 31, + "y": 256 + }, + "width": 259, + "height": 252, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#0A0F25", + "stroke": "#FFFFFF", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "primary_key", + "reference": "" + }, + { + "name": { + "label": "whisker_len", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 101, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "fur_color", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 77, + "labelHeight": 26 + }, + "type": { + "label": "string", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "age", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 30, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "server", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 52, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "caretaker", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 80, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + } + ], + "label": "Chinchillas", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 120, + "labelHeight": 36, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "#0D32B2", + "secondaryAccentColor": "#4A6FF3", + "neutralAccentColor": "#676C7E" + }, + { + "id": "Chinchillas_Collectibles", + "type": "sql_table", + "pos": { + "x": 12, + "y": 12 + }, + "width": 297, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#0A0F25", + "stroke": "#FFFFFF", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 23, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "collectible", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 88, + "labelHeight": 26 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "chinchilla", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 80, + "labelHeight": 26 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 15, + "labelHeight": 26 + }, + "constraint": "foreign_key", + "reference": "Chinchillas.id" + } + ], + "label": "Chinchillas_Collectibles", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 257, + "labelHeight": 36, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "#0D32B2", + "secondaryAccentColor": "#4A6FF3", + "neutralAccentColor": "#676C7E" + } + ], + "connections": [ + { + "id": "(Chinchillas_Collectibles -> Chinchillas)[0]", + "src": "Chinchillas_Collectibles", + "srcArrow": "none", + "srcLabel": "", + "dst": "Chinchillas", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 160.5, + "y": 156 + }, + { + "x": 160.5, + "y": 256 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg b/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg new file mode 100644 index 000000000..e579c2f59 --- /dev/null +++ b/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg @@ -0,0 +1,49 @@ + +Chinchillasid +int +PKwhisker_len +int +fur_color +string +age +int +server +int +FKcaretaker +int +FKChinchillas_Collectiblesid +int +collectible +id +FKchinchilla +id +FK + + + \ No newline at end of file diff --git a/testdata/d2compiler/TestCompile/wrong_column_index.exp.json b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json new file mode 100644 index 000000000..8b5df5ba5 --- /dev/null +++ b/testdata/d2compiler/TestCompile/wrong_column_index.exp.json @@ -0,0 +1,1163 @@ +{ + "graph": { + "ast": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-17:53:406", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-8:1:204", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-0:11:11", + "value": [ + { + "string": "Chinchillas", + "raw_string": "Chinchillas" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:13:13-8:0:203", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,1:2:17-1:18:33", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,1:2:17-1:7:22", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,1:2:17-1:7:22", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,1:9:24-1:18:33", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:2:36-2:35:69", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:2:36-2:4:38", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:2:36-2:4:38", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:6:40-2:9:43", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:10:44-2:34:68", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:11:45-2:34:68", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:11:45-2:21:55", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:11:45-2:21:55", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,2:23:57-2:34:68", + "value": [ + { + "string": "primary_key", + "raw_string": "primary_key" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,3:2:72-3:18:88", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,3:2:72-3:13:83", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,3:2:72-3:13:83", + "value": [ + { + "string": "whisker_len", + "raw_string": "whisker_len" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,3:15:85-3:18:88", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,4:2:91-4:19:108", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,4:2:91-4:11:100", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,4:2:91-4:11:100", + "value": [ + { + "string": "fur_color", + "raw_string": "fur_color" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,4:13:102-4:19:108", + "value": [ + { + "string": "string", + "raw_string": "string" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,5:2:111-5:10:119", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,5:2:111-5:5:114", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,5:2:111-5:5:114", + "value": [ + { + "string": "age", + "raw_string": "age" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,5:7:116-5:10:119", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:2:122-6:39:159", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:2:122-6:8:128", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:2:122-6:8:128", + "value": [ + { + "string": "server", + "raw_string": "server" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:10:130-6:13:133", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:14:134-6:38:158", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:15:135-6:38:158", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:15:135-6:25:145", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:15:135-6:25:145", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,6:27:147-6:38:158", + "value": [ + { + "string": "foreign_key", + "raw_string": "foreign_key" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:2:162-7:42:202", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:2:162-7:11:171", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:2:162-7:11:171", + "value": [ + { + "string": "caretaker", + "raw_string": "caretaker" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:13:173-7:16:176", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:17:177-7:41:201", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:18:178-7:41:201", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:18:178-7:28:188", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:18:178-7:28:188", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,7:30:190-7:41:201", + "value": [ + { + "string": "foreign_key", + "raw_string": "foreign_key" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:0:206-15:1:351", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:0:206-10:24:230", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:0:206-10:24:230", + "value": [ + { + "string": "Chinchillas_Collectibles", + "raw_string": "Chinchillas_Collectibles" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:26:232-15:0:350", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,11:2:236-11:18:252", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,11:2:236-11:7:241", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,11:2:236-11:7:241", + "value": [ + { + "string": "shape", + "raw_string": "shape" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,11:9:243-11:18:252", + "value": [ + { + "string": "sql_table", + "raw_string": "sql_table" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,12:2:255-12:9:262", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,12:2:255-12:4:257", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,12:2:255-12:4:257", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,12:6:259-12:9:262", + "value": [ + { + "string": "int", + "raw_string": "int" + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:2:265-13:43:306", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:2:265-13:13:276", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:2:265-13:13:276", + "value": [ + { + "string": "collectible", + "raw_string": "collectible" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:15:278-13:17:280", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:18:281-13:42:305", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:19:282-13:42:305", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:19:282-13:29:292", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:19:282-13:29:292", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,13:31:294-13:42:305", + "value": [ + { + "string": "foreign_key", + "raw_string": "foreign_key" + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:2:309-14:42:349", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:2:309-14:12:319", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:2:309-14:12:319", + "value": [ + { + "string": "chinchilla", + "raw_string": "chinchilla" + } + ] + } + } + ] + }, + "primary": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:14:321-14:16:323", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + }, + "value": { + "map": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:17:324-14:41:348", + "nodes": [ + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:18:325-14:41:348", + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:18:325-14:28:335", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:18:325-14:28:335", + "value": [ + { + "string": "constraint", + "raw_string": "constraint" + } + ] + } + } + ] + }, + "primary": {}, + "value": { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,14:30:337-14:41:348", + "value": [ + { + "string": "foreign_key", + "raw_string": "foreign_key" + } + ] + } + } + } + } + ] + } + } + } + } + ] + } + } + } + }, + { + "map_key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:53:406", + "edges": [ + { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:53:406", + "src": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:36:389", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:24:377", + "value": [ + { + "string": "Chinchillas_Collectibles", + "raw_string": "Chinchillas_Collectibles" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:25:378-17:35:388", + "value": [ + { + "string": "chinchilla", + "raw_string": "chinchilla" + } + ] + } + } + ] + }, + "src_arrow": "", + "dst": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:38:391-17:53:406", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:39:392-17:50:403", + "value": [ + { + "string": "Chinchillas", + "raw_string": "Chinchillas" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:51:404-17:53:406", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "dst_arrow": ">" + } + ], + "primary": {}, + "value": {} + } + } + ] + }, + "root": { + "id": "", + "id_val": "", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + } + }, + "zIndex": 0 + }, + "edges": [ + { + "index": 0, + "minWidth": 0, + "minHeight": 0, + "srcTableColumnIndex": 2, + "dstTableColumnIndex": 0, + "label_dimensions": { + "width": 0, + "height": 0 + }, + "isCurve": false, + "src_arrow": false, + "dst_arrow": true, + "references": [ + { + "map_key_edge_index": 0 + } + ], + "attributes": { + "label": { + "value": "" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "" + }, + "direction": { + "value": "" + } + }, + "zIndex": 0 + } + ], + "objects": [ + { + "id": "Chinchillas", + "id_val": "Chinchillas", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-0:11:11", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,0:0:0-0:11:11", + "value": [ + { + "string": "Chinchillas", + "raw_string": "Chinchillas" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:38:391-17:53:406", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:39:392-17:50:403", + "value": [ + { + "string": "Chinchillas", + "raw_string": "Chinchillas" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:51:404-17:53:406", + "value": [ + { + "string": "id", + "raw_string": "id" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "sql_table": { + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "primary_key", + "reference": "" + }, + { + "name": { + "label": "whisker_len", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "fur_color", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "string", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "age", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "server", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "caretaker", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "foreign_key", + "reference": "" + } + ] + }, + "attributes": { + "label": { + "value": "Chinchillas" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "sql_table" + }, + "direction": { + "value": "" + } + }, + "zIndex": 0 + }, + { + "id": "Chinchillas_Collectibles", + "id_val": "Chinchillas_Collectibles", + "label_dimensions": { + "width": 0, + "height": 0 + }, + "references": [ + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:0:206-10:24:230", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,10:0:206-10:24:230", + "value": [ + { + "string": "Chinchillas_Collectibles", + "raw_string": "Chinchillas_Collectibles" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + }, + { + "key": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:36:389", + "path": [ + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:0:353-17:24:377", + "value": [ + { + "string": "Chinchillas_Collectibles", + "raw_string": "Chinchillas_Collectibles" + } + ] + } + }, + { + "unquoted_string": { + "range": "d2/testdata/d2compiler/TestCompile/wrong_column_index.d2,17:25:378-17:35:388", + "value": [ + { + "string": "chinchilla", + "raw_string": "chinchilla" + } + ] + } + } + ] + }, + "key_path_index": 0, + "map_key_edge_index": 0 + } + ], + "sql_table": { + "columns": [ + { + "name": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "int", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "collectible", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "foreign_key", + "reference": "" + }, + { + "name": { + "label": "chinchilla", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "type": { + "label": "id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0 + }, + "constraint": "foreign_key", + "reference": "Chinchillas.id" + } + ] + }, + "attributes": { + "label": { + "value": "Chinchillas_Collectibles" + }, + "style": {}, + "near_key": null, + "shape": { + "value": "sql_table" + }, + "direction": { + "value": "" + } + }, + "zIndex": 0 + } + ] + }, + "err": null +} From 3a5e5bd1134c5b57f8e69db7fcc51d88290c0d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 6 Jan 2023 16:08:02 -0300 Subject: [PATCH 02/12] changelog --- ci/release/changelogs/next.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 6d0e821af..1e0eddda8 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -14,3 +14,4 @@ - Fixes an error during ELK layout when images had empty labels. [#555](https://github.com/terrastruct/d2/pull/555) - Fixes rendering classes and tables with empty headers. [#498](https://github.com/terrastruct/d2/pull/498) - Fixes rendering sql tables with no columns. [#553](https://github.com/terrastruct/d2/pull/553) +- Fixes routing between sql table columns if the column name is the prefix of the table name [#615](https://github.com/terrastruct/d2/pull/615) \ No newline at end of file From 3d77318b871f5374790681c3f990cdea8234d2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20C=C3=A9sar=20Batista?= Date: Fri, 6 Jan 2023 16:16:50 -0300 Subject: [PATCH 03/12] update tests --- .../wrong_table_column/dagre/sketch.exp.svg | 29 ++++++++++++++++--- .../wrong_table_column/elk/sketch.exp.svg | 29 ++++++++++++++++--- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg b/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg index 85c13996e..a4eb9977b 100644 --- a/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/wrong_table_column/dagre/sketch.exp.svg @@ -1,8 +1,9 @@ Chinchillasid int PKwhisker_len int @@ -36,8 +57,8 @@ width="497" height="696" viewBox="-100 -100 497 696"> - +FK + Chinchillasid +Chinchillasid int PKwhisker_len int @@ -36,8 +57,8 @@ width="497" height="696" viewBox="-88 -88 497 696"> - +FK + Kubernetesopensvck8s-master1k8s-master2k8s-master3k8s-worker1k8s-worker2k8s-worker3VM1VM2 keycloakheptapodharborvault + + + + + + \ No newline at end of file diff --git a/e2etests/testdata/regression/overlapping-edge-label/elk/board.exp.json b/e2etests/testdata/regression/overlapping-edge-label/elk/board.exp.json new file mode 100644 index 000000000..6fd038717 --- /dev/null +++ b/e2etests/testdata/regression/overlapping-edge-label/elk/board.exp.json @@ -0,0 +1,588 @@ +{ + "name": "", + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "k8s", + "type": "", + "pos": { + "x": 12, + "y": 12 + }, + "width": 1405, + "height": 276, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "Kubernetes", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 138, + "labelHeight": 41, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "k8s.m1", + "type": "", + "pos": { + "x": 87, + "y": 87 + }, + "width": 192, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-master1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 92, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k8s.m2", + "type": "", + "pos": { + "x": 299, + "y": 87 + }, + "width": 192, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-master2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 92, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k8s.m3", + "type": "", + "pos": { + "x": 511, + "y": 87 + }, + "width": 192, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-master3", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 92, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k8s.w1", + "type": "", + "pos": { + "x": 723, + "y": 87 + }, + "width": 193, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-worker1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 93, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k8s.w2", + "type": "", + "pos": { + "x": 936, + "y": 87 + }, + "width": 193, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-worker2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 93, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "k8s.w3", + "type": "", + "pos": { + "x": 1149, + "y": 87 + }, + "width": 193, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "k8s-worker3", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 93, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "osvc", + "type": "", + "pos": { + "x": 397, + "y": 519 + }, + "width": 442, + "height": 276, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "opensvc", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 102, + "labelHeight": 41, + "labelPosition": "INSIDE_TOP_CENTER", + "zIndex": 0, + "level": 1 + }, + { + "id": "osvc.vm1", + "type": "", + "pos": { + "x": 472, + "y": 594 + }, + "width": 136, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "VM1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 36, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + }, + { + "id": "osvc.vm2", + "type": "", + "pos": { + "x": 628, + "y": 594 + }, + "width": 136, + "height": 126, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "VM2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 36, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "zIndex": 0, + "level": 2 + } + ], + "connections": [ + { + "id": "(k8s -> osvc)[0]", + "src": "k8s", + "srcArrow": "none", + "srcLabel": "", + "dst": "osvc", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "keycloak", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 59, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 293, + "y": 288 + }, + { + "x": 293, + "y": 459 + }, + { + "x": 485.6, + "y": 459 + }, + { + "x": 485.6, + "y": 519 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k8s -> osvc)[1]", + "src": "k8s", + "srcArrow": "none", + "srcLabel": "", + "dst": "osvc", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "heptapod", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 65, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 574, + "y": 288 + }, + { + "x": 574, + "y": 519 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k8s -> osvc)[2]", + "src": "k8s", + "srcArrow": "none", + "srcLabel": "", + "dst": "osvc", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "harbor", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 47, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 855, + "y": 288 + }, + { + "x": 855, + "y": 459 + }, + { + "x": 662.4000000000001, + "y": 459 + }, + { + "x": 662.4000000000001, + "y": 519 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(k8s -> osvc)[3]", + "src": "k8s", + "srcArrow": "none", + "srcLabel": "", + "dst": "osvc", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "vault", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 35, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 1136, + "y": 288 + }, + { + "x": 1136, + "y": 469 + }, + { + "x": 750.8, + "y": 469 + }, + { + "x": 750.8, + "y": 519 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ] +} diff --git a/e2etests/testdata/regression/overlapping-edge-label/elk/sketch.exp.svg b/e2etests/testdata/regression/overlapping-edge-label/elk/sketch.exp.svg new file mode 100644 index 000000000..c81e90cf4 --- /dev/null +++ b/e2etests/testdata/regression/overlapping-edge-label/elk/sketch.exp.svg @@ -0,0 +1,69 @@ + +Kubernetesopensvck8s-master1k8s-master2k8s-master3k8s-worker1k8s-worker2k8s-worker3VM1VM2 keycloakheptapodharborvault + + + + + + \ No newline at end of file From 1739d79b6b9e93b49b081422dea15efdfef02f88 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Fri, 6 Jan 2023 12:19:01 -0800 Subject: [PATCH 06/12] fix dagre edge label overlaps --- .../dagre/board.exp.json | 40 +- .../dagre/sketch.exp.svg | 14 +- .../elk_alignment/dagre/board.exp.json | 134 ++-- .../elk_alignment/dagre/sketch.exp.svg | 22 +- .../connection_label/dagre/board.exp.json | 8 +- .../connection_label/dagre/sketch.exp.svg | 8 +- .../arrowhead_labels/dagre/board.exp.json | 8 +- .../arrowhead_labels/dagre/sketch.exp.svg | 8 +- .../stable/chaos1/dagre/board.exp.json | 40 +- .../stable/chaos1/dagre/sketch.exp.svg | 10 +- .../stable/chaos2/dagre/board.exp.json | 316 ++++----- .../stable/chaos2/dagre/sketch.exp.svg | 22 +- .../stable/font_colors/dagre/board.exp.json | 8 +- .../stable/font_colors/dagre/sketch.exp.svg | 8 +- .../stable/font_sizes/dagre/board.exp.json | 24 +- .../stable/font_sizes/dagre/sketch.exp.svg | 12 +- .../stable/investigate/dagre/board.exp.json | 630 +++++++++--------- .../stable/investigate/dagre/sketch.exp.svg | 18 +- .../stable/latex/dagre/board.exp.json | 8 +- .../stable/latex/dagre/sketch.exp.svg | 8 +- .../dagre/board.exp.json | 92 +-- .../dagre/sketch.exp.svg | 18 +- .../self-referencing/dagre/board.exp.json | 30 +- .../self-referencing/dagre/sketch.exp.svg | 8 +- .../stable/stylish/dagre/board.exp.json | 8 +- .../stable/stylish/dagre/sketch.exp.svg | 12 +- .../container_child_edge/dagre/board.exp.json | 34 +- .../container_child_edge/dagre/sketch.exp.svg | 10 +- .../font_sizes_large/dagre/board.exp.json | 42 +- .../font_sizes_large/dagre/sketch.exp.svg | 14 +- .../todo/tall_edge_label/dagre/board.exp.json | 8 +- .../todo/tall_edge_label/dagre/sketch.exp.svg | 8 +- 32 files changed, 815 insertions(+), 815 deletions(-) diff --git a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json index 0ba8aaac5..2eb8b7fa0 100644 --- a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json +++ b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/board.exp.json @@ -9,7 +9,7 @@ "x": 0, "y": 0 }, - "width": 2148, + "width": 2628, "height": 237, "opacity": 1, "strokeDash": 0, @@ -86,7 +86,7 @@ "id": "build_workflow.GHA", "type": "", "pos": { - "x": 644, + "x": 698, "y": 50 }, "width": 269, @@ -126,7 +126,7 @@ "id": "build_workflow.S3", "type": "", "pos": { - "x": 1122, + "x": 1314, "y": 50 }, "width": 131, @@ -166,7 +166,7 @@ "id": "build_workflow.Terraform", "type": "", "pos": { - "x": 1462, + "x": 1773, "y": 50 }, "width": 218, @@ -206,7 +206,7 @@ "id": "build_workflow.AWS", "type": "", "pos": { - "x": 1889, + "x": 2369, "y": 50 }, "width": 155, @@ -274,15 +274,15 @@ "y": 118.5 }, { - "x": 518.3, + "x": 539.9, "y": 118.5 }, { - "x": 559.9, + "x": 592.3, "y": 118.5 }, { - "x": 643.5, + "x": 697.5, "y": 118.5 } ], @@ -318,19 +318,19 @@ "labelPercentage": 0, "route": [ { - "x": 913.5, + "x": 966.5, "y": 118.5 }, { - "x": 996.3, + "x": 1105.3, "y": 118.5 }, { - "x": 1037.9, + "x": 1174.7, "y": 118.5 }, { - "x": 1121.5, + "x": 1313.5, "y": 118.5 } ], @@ -366,19 +366,19 @@ "labelPercentage": 0, "route": [ { - "x": 1253.5, + "x": 1445.5, "y": 118.5 }, { - "x": 1336.3, + "x": 1575.9, "y": 118.5 }, { - "x": 1377.9, + "x": 1641.3, "y": 118.5 }, { - "x": 1461.5, + "x": 1772.5, "y": 118.5 } ], @@ -414,19 +414,19 @@ "labelPercentage": 0, "route": [ { - "x": 1680.5, + "x": 1991.5, "y": 118.5 }, { - "x": 1763.3, + "x": 2141.9, "y": 118.5 }, { - "x": 1804.9, + "x": 2217.3, "y": 118.5 }, { - "x": 1888.5, + "x": 2368.5, "y": 118.5 } ], diff --git a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg index 5815a5190..1e7b73085 100644 --- a/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg +++ b/e2etests/testdata/regression/dagre_edge_label_spacing/dagre/sketch.exp.svg @@ -3,7 +3,7 @@ id="d2-svg" style="background: white;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" -width="2352" height="441" viewBox="-102 -102 2352 441">aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + +

Oldest message

+

Oldest message

Offset

Last message

Next message will be
inserted here

-
M0M1M2M3M4M5M6 - +
M0M1M2M3M4M5M6 + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + xyThe top of the mountainJoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

+xyThe top of the mountainJoeDonald

Cats, no less liquid than their shadows, offer no angles to the wind.

If we can't fix it, it ain't broke.

Dieters live life in the fasting lane.

-
i am top lefti am top righti am bottom lefti am bottom right - +
i am top lefti am top righti am bottom lefti am bottom right + poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

-
- +poll the peopleresultsunfavorablefavorablewill of the people

A winning strategy

+
+

Markdown: Syntax

+

Markdown: Syntax

  • Overview
      @@ -1053,8 +1053,8 @@ title for the link, surrounded in quotes. For example:

      Code

      Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:

      -
ab - +
ab +

Note: This document is itself written using Markdown; you +

Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


Overview

-
ab - +
ab + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + +
    +
    • Overview
      • Philosophy
      • @@ -808,8 +808,8 @@ width="583" height="756" viewBox="-102 -102 583 756">
          +
          • Overview ok this is all measured
            • Philosophy
            • @@ -804,8 +804,8 @@ width="449" height="732" viewBox="-102 -102 449 732">
                +
                • Overview
                  • Philosophy
                  • @@ -829,8 +829,8 @@ width="551" height="1168" viewBox="-102 -102 551 1168">

                    List items may consist of multiple paragraphs. Each subsequent +

                    List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:

                      @@ -827,8 +827,8 @@ sit amet, consectetuer adipiscing elit.

                      Another item in the same list.

                  -
                ab - +
              ab +

              Markdown: Syntax

              -
              ab - +

              Markdown: Syntax

              +
              ab +

              Every frustum longs to be a cone

              +

              Every frustum longs to be a cone

              • A continuing flow of paper is sufficient to continue the flow of paper
              • Please remain calm, it's no use both of us being hysterical at the same time
              • Visits always give pleasure: if not on arrival, then on the departure

              Festivity Level 1: Your guests are chatting amiably with each other.

              -
              xy - +
              xy + container

              they did it in style

              -

              a header

              +container

              they did it in style

              +

              a header

              a line of text and an

              {
               	indented: "block",
              @@ -805,8 +805,8 @@ width="516" height="685" viewBox="-102 -102 516 685">markdown

              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
              +markdown

              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

              -
              - +
              + markdown

              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
              +markdown

              Lorem ipsum dolor sit amet, consectetur adipiscing elit,
              sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

              -
              - +
              +
              {
              +
              {
               	fenced: "block",
               	of: "json",
               }
               
              -
              ab - +
              ab +

              a line of text and an

              +

              a line of text and an

              {
               	indented: "block",
               	of: "json",
               }
               
              -
              ab - +
              ab +

              code

              -
              ab - +

              code

              +
              ab +

              A paragraph is simply one or more consecutive lines of text, separated +

              A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

              -
              ab - +
              ab +

              Here is an example of AppleScript:

              +

              Here is an example of AppleScript:

              tell application "Foo"
                   beep
               end tell
               

              A code block continues until it reaches a line that is not indented (or the end of the article).

              -
              ab - +
              ab + bearmama bearpapa bear - +bearmama bearpapa bear +

              Oldest message

              +

              Oldest message

              Offset

              Last message

              Next message will be
              inserted here

              -
              M0M1M2M3M4M5M6 - +
              M0M1M2M3M4M5M6 + aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 - - - - - - - - - +aabbllmmnnoocciikkddgghhjjeeff1122 334455667788 + + + + + + + + + xyThe top of the mountainJoeDonald

              Cats, no less liquid than their shadows, offer no angles to the wind.

              +xyThe top of the mountainJoeDonald

              Cats, no less liquid than their shadows, offer no angles to the wind.

              If we can't fix it, it ain't broke.

              Dieters live life in the fasting lane.

              -
              i am top lefti am top righti am bottom lefti am bottom right - +
              i am top lefti am top righti am bottom lefti am bottom right + poll the peopleresultsunfavorablefavorablewill of the people

              A winning strategy

              -
              - +poll the peopleresultsunfavorablefavorablewill of the people

              A winning strategy

              +
              +

              Markdown: Syntax

              +

              Markdown: Syntax

              • Overview
                  @@ -1053,8 +1053,8 @@ title for the link, surrounded in quotes. For example:

                  Code

                  Unlike a pre-formatted code block, a code span indicates code within a normal paragraph. For example:

                  -
              ab - +
              ab +

              Note: This document is itself written using Markdown; you +

              Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


              Overview

              -
              ab - +
              ab + mixed togethersugarsolution we get - - +mixed togethersugarsolution we get + +
                +
                • Overview
                  • Philosophy
                  • @@ -808,8 +808,8 @@ width="583" height="556" viewBox="-102 -102 583 556">
                      +
                      • Overview ok this is all measured
                        • Philosophy
                        • @@ -804,8 +804,8 @@ width="449" height="532" viewBox="-102 -102 449 532">
                            +
                            • Overview
                              • Philosophy
                              • @@ -829,8 +829,8 @@ width="551" height="968" viewBox="-102 -102 551 968">

                                List items may consist of multiple paragraphs. Each subsequent +

                                List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab:

                                  @@ -827,8 +827,8 @@ sit amet, consectetuer adipiscing elit.

                                  Another item in the same list.

                              -
                            ab - +
                          ab +

                          Markdown: Syntax

                          -
                          ab - +

                          Markdown: Syntax

                          +
                          ab +

                          Every frustum longs to be a cone

                          +

                          Every frustum longs to be a cone

                          • A continuing flow of paper is sufficient to continue the flow of paper
                          • Please remain calm, it's no use both of us being hysterical at the same time
                          • Visits always give pleasure: if not on arrival, then on the departure

                          Festivity Level 1: Your guests are chatting amiably with each other.

                          -
                          xy - +
                          xy + container

                          they did it in style

                          -

                          a header

                          +container

                          they did it in style

                          +

                          a header

                          a line of text and an

                          {
                           	indented: "block",
                          @@ -805,8 +805,8 @@ width="516" height="485" viewBox="-102 -102 516 485">markdown

                          Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                          +markdown

                          Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                          sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                          -
                          - +
                          + markdown

                          Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                          +markdown

                          Lorem ipsum dolor sit amet, consectetur adipiscing elit,
                          sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

                          -
                          - +
                          +
                          {
                          +
                          {
                           	fenced: "block",
                           	of: "json",
                           }
                           
                          -
                          ab - +
                          ab +

                          a line of text and an

                          +

                          a line of text and an

                          {
                           	indented: "block",
                           	of: "json",
                           }
                           
                          -
                          ab - +
                          ab +

                          code

                          -
                          ab - +

                          code

                          +
                          ab +

                          A paragraph is simply one or more consecutive lines of text, separated +

                          A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. (A blank line is any line that looks like a blank line -- a line containing nothing but spaces or tabs is considered blank.) Normal paragraphs should not be indented with spaces or tabs.

                          -
                          ab - +
                          ab +

                          Here is an example of AppleScript:

                          +

                          Here is an example of AppleScript:

                          tell application "Foo"
                               beep
                           end tell
                           

                          A code block continues until it reaches a line that is not indented (or the end of the article).

                          -
                          ab - +
                          ab + bearmama bearpapa bear - +bearmama bearpapa bear + Chinchillasid -int -PKwhisker_len -int -fur_color -string -age -int -server -int -FKcaretaker -int -FKChinchillas_Collectiblesid -int -collectible -id -FKchinchilla -id -FK - - - \ No newline at end of file diff --git a/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json b/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json deleted file mode 100644 index 2164a914a..000000000 --- a/e2etests/testdata/regression/wrong_table_column/elk/board.exp.json +++ /dev/null @@ -1,385 +0,0 @@ -{ - "name": "", - "fontFamily": "SourceSansPro", - "shapes": [ - { - "id": "Chinchillas", - "type": "sql_table", - "pos": { - "x": 31, - "y": 256 - }, - "width": 259, - "height": 252, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#0A0F25", - "stroke": "#FFFFFF", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": [ - { - "name": { - "label": "id", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 15, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "primary_key", - "reference": "" - }, - { - "name": { - "label": "whisker_len", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 101, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "", - "reference": "" - }, - { - "name": { - "label": "fur_color", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 77, - "labelHeight": 26 - }, - "type": { - "label": "string", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 48, - "labelHeight": 26 - }, - "constraint": "", - "reference": "" - }, - { - "name": { - "label": "age", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 30, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "", - "reference": "" - }, - { - "name": { - "label": "server", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 52, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "foreign_key", - "reference": "" - }, - { - "name": { - "label": "caretaker", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 80, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "foreign_key", - "reference": "" - } - ], - "label": "Chinchillas", - "fontSize": 20, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": true, - "underline": false, - "labelWidth": 120, - "labelHeight": 36, - "zIndex": 0, - "level": 1, - "primaryAccentColor": "#0D32B2", - "secondaryAccentColor": "#4A6FF3", - "neutralAccentColor": "#676C7E" - }, - { - "id": "Chinchillas_Collectibles", - "type": "sql_table", - "pos": { - "x": 12, - "y": 12 - }, - "width": 297, - "height": 144, - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "borderRadius": 0, - "fill": "#0A0F25", - "stroke": "#FFFFFF", - "shadow": false, - "3d": false, - "multiple": false, - "tooltip": "", - "link": "", - "icon": null, - "iconPosition": "", - "blend": false, - "fields": null, - "methods": null, - "columns": [ - { - "name": { - "label": "id", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 15, - "labelHeight": 26 - }, - "type": { - "label": "int", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 23, - "labelHeight": 26 - }, - "constraint": "", - "reference": "" - }, - { - "name": { - "label": "collectible", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 88, - "labelHeight": 26 - }, - "type": { - "label": "id", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 15, - "labelHeight": 26 - }, - "constraint": "foreign_key", - "reference": "" - }, - { - "name": { - "label": "chinchilla", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 80, - "labelHeight": 26 - }, - "type": { - "label": "id", - "fontSize": 0, - "fontFamily": "", - "language": "", - "color": "", - "italic": false, - "bold": false, - "underline": false, - "labelWidth": 15, - "labelHeight": 26 - }, - "constraint": "foreign_key", - "reference": "Chinchillas.id" - } - ], - "label": "Chinchillas_Collectibles", - "fontSize": 20, - "fontFamily": "DEFAULT", - "language": "", - "color": "#0A0F25", - "italic": false, - "bold": true, - "underline": false, - "labelWidth": 257, - "labelHeight": 36, - "zIndex": 0, - "level": 1, - "primaryAccentColor": "#0D32B2", - "secondaryAccentColor": "#4A6FF3", - "neutralAccentColor": "#676C7E" - } - ], - "connections": [ - { - "id": "(Chinchillas_Collectibles -> Chinchillas)[0]", - "src": "Chinchillas_Collectibles", - "srcArrow": "none", - "srcLabel": "", - "dst": "Chinchillas", - "dstArrow": "triangle", - "dstLabel": "", - "opacity": 1, - "strokeDash": 0, - "strokeWidth": 2, - "stroke": "#0D32B2", - "label": "", - "fontSize": 16, - "fontFamily": "DEFAULT", - "language": "", - "color": "#676C7E", - "italic": true, - "bold": false, - "underline": false, - "labelWidth": 0, - "labelHeight": 0, - "labelPosition": "", - "labelPercentage": 0, - "route": [ - { - "x": 160.5, - "y": 156 - }, - { - "x": 160.5, - "y": 256 - } - ], - "animated": false, - "tooltip": "", - "icon": null, - "zIndex": 0 - } - ] -} diff --git a/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg b/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg deleted file mode 100644 index a25d5616c..000000000 --- a/e2etests/testdata/regression/wrong_table_column/elk/sketch.exp.svg +++ /dev/null @@ -1,70 +0,0 @@ - -Chinchillasid -int -PKwhisker_len -int -fur_color -string -age -int -server -int -FKcaretaker -int -FKChinchillas_Collectiblesid -int -collectible -id -FKchinchilla -id -FK - - - \ No newline at end of file