From 313831341943960003318c31d833dda93f0bdd5e Mon Sep 17 00:00:00 2001 From: Travis Cline Date: Sun, 9 Apr 2023 21:47:34 -0700 Subject: [PATCH] e2etests: Add ent2d2 test case --- e2etests/stable_test.go | 1 + e2etests/testdata/files/ent2d2_basic.d2 | 98 ++ .../stable/ent2d2_basic/dagre/board.exp.json | 1120 +++++++++++++++++ .../stable/ent2d2_basic/dagre/sketch.exp.svg | 108 ++ .../stable/ent2d2_basic/elk/board.exp.json | 1033 +++++++++++++++ .../stable/ent2d2_basic/elk/sketch.exp.svg | 108 ++ 6 files changed, 2468 insertions(+) create mode 100644 e2etests/testdata/files/ent2d2_basic.d2 create mode 100644 e2etests/testdata/stable/ent2d2_basic/dagre/board.exp.json create mode 100644 e2etests/testdata/stable/ent2d2_basic/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/stable/ent2d2_basic/elk/board.exp.json create mode 100644 e2etests/testdata/stable/ent2d2_basic/elk/sketch.exp.svg diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 584a2969a..4e981d4a1 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -2573,6 +2573,7 @@ scenarios: { loadFromFile(t, "executive_grid"), loadFromFile(t, "grid_animated"), loadFromFile(t, "grid_gap"), + loadFromFile(t, "ent2d2_basic"), } runa(t, tcs) diff --git a/e2etests/testdata/files/ent2d2_basic.d2 b/e2etests/testdata/files/ent2d2_basic.d2 new file mode 100644 index 000000000..d6a4fdee9 --- /dev/null +++ b/e2etests/testdata/files/ent2d2_basic.d2 @@ -0,0 +1,98 @@ +# Edges +User <-> User: "spouse" { + # o2o optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-one + } +} +User <-> User: "children/parent" { + # o2m optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-many + } +} +User <-> Pet: "pets/owner" { + # o2m optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-many + } +} +User <-> Card: "card/owner" { + # o2o optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-one + } +} +User <-> Post: "posts/author" { + # o2m optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-many + } +} +User <-> Metadata: "metadata/user" { + # o2m optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-many + } +} +User <-> Info: "info/user" { + # o2m optional + source-arrowhead: { + shape: cf-one-required + } + target-arrowhead: { + shape: cf-many + } +} + +# Tables +Card: { + shape: sql_table + id: int {constraint: primary_key} + owner_id: int {constraint: foreign_key} +} +Info: { + shape: sql_table + id: int {constraint: primary_key} + content: json.RawMessage +} +Metadata: { + shape: sql_table + id: int {constraint: primary_key} + age: int +} +Pet: { + shape: sql_table + id: int {constraint: primary_key} + owner_id: int {constraint: foreign_key} +} +Post: { + shape: sql_table + id: int {constraint: primary_key} + text: string + author_id: int {constraint: foreign_key} +} +User: { + shape: sql_table + id: int {constraint: primary_key} + parent_id: int {constraint: foreign_key} + spouse_id: int {constraint: foreign_key} +} diff --git a/e2etests/testdata/stable/ent2d2_basic/dagre/board.exp.json b/e2etests/testdata/stable/ent2d2_basic/dagre/board.exp.json new file mode 100644 index 000000000..9b0d8ddbd --- /dev/null +++ b/e2etests/testdata/stable/ent2d2_basic/dagre/board.exp.json @@ -0,0 +1,1120 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "User", + "type": "sql_table", + "pos": { + "x": 553, + "y": 0 + }, + "width": 218, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "parent_id", + "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": "" + }, + { + "name": { + "label": "spouse_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 85, + "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": "User", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 49, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Pet", + "type": "sql_table", + "pos": { + "x": 0, + "y": 283 + }, + "width": 211, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "owner_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 78, + "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": "Pet", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 35, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Card", + "type": "sql_table", + "pos": { + "x": 271, + "y": 283 + }, + "width": 211, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "owner_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 78, + "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": "Card", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 49, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Post", + "type": "sql_table", + "pos": { + "x": 542, + "y": 265 + }, + "width": 239, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "text", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 33, + "labelHeight": 26 + }, + "type": { + "label": "string", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "author_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 81, + "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": "Post", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 47, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Metadata", + "type": "sql_table", + "pos": { + "x": 841, + "y": 283 + }, + "width": 163, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "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": "" + } + ], + "label": "Metadata", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 100, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Info", + "type": "sql_table", + "pos": { + "x": 1064, + "y": 283 + }, + "width": 325, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "content", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 66, + "labelHeight": 26 + }, + "type": { + "label": "json.RawMessage", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 149, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + } + ], + "label": "Info", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 42, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + } + ], + "connections": [ + { + "id": "(User <-> User)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "User", + "dstArrow": "cf-one", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "spouse", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 770.5, + "y": 22.43368421052633 + }, + { + "x": 809.9666666666667, + "y": 4.486736842105266 + }, + { + "x": 822.3000000000001, + "y": 0 + }, + { + "x": 826, + "y": 0 + }, + { + "x": 829.6999999999999, + "y": 0 + }, + { + "x": 834.6333333333333, + "y": 14.4 + }, + { + "x": 838.3333333333333, + "y": 36 + }, + { + "x": 842.0333333333333, + "y": 57.6 + }, + { + "x": 842.0333333333333, + "y": 86.4 + }, + { + "x": 838.3333333333333, + "y": 108 + }, + { + "x": 834.6333333333333, + "y": 129.6 + }, + { + "x": 809.9666666666667, + "y": 139.51326315789473 + }, + { + "x": 770.5, + "y": 121.56631578947366 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> User)[1]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "User", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "children/parent", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 104, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 770.5, + "y": 38.698727015558696 + }, + { + "x": 871.8333333333333, + "y": 7.739745403111737 + }, + { + "x": 903.5, + "y": 0 + }, + { + "x": 913, + "y": 0 + }, + { + "x": 922.5, + "y": 0 + }, + { + "x": 935.1666666666667, + "y": 14.4 + }, + { + "x": 944.6666666666667, + "y": 36 + }, + { + "x": 954.1666666666666, + "y": 57.6 + }, + { + "x": 954.1666666666666, + "y": 86.4 + }, + { + "x": 944.6666666666667, + "y": 108 + }, + { + "x": 935.1666666666667, + "y": 129.6 + }, + { + "x": 871.8333333333333, + "y": 136.26025459688827 + }, + { + "x": 770.5, + "y": 105.30127298444131 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Pet)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Pet", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "pets/owner", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 77, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 552.5, + "y": 97.97571942446044 + }, + { + "x": 194.89999999999998, + "y": 183.1951438848921 + }, + { + "x": 105.5, + "y": 220.3 + }, + { + "x": 105.5, + "y": 283.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Card)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Card", + "dstArrow": "cf-one", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "card/owner", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 78, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 552.5, + "y": 122.67543859649123 + }, + { + "x": 411.7, + "y": 188.13508771929827 + }, + { + "x": 376.5, + "y": 220.3 + }, + { + "x": 376.5, + "y": 283.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Post)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Post", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "posts/author", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 88, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 661.5, + "y": 144 + }, + { + "x": 661.5, + "y": 192.4 + }, + { + "x": 661.5, + "y": 216.7 + }, + { + "x": 661.5, + "y": 265.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Metadata)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Metadata", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "metadata/user", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 101, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 771.5, + "y": 127.33524904214559 + }, + { + "x": 892.3, + "y": 189.06704980842912 + }, + { + "x": 922.5, + "y": 220.3 + }, + { + "x": 922.5, + "y": 283.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Info)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Info", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "info/user", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 60, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 771.5, + "y": 97.56194690265487 + }, + { + "x": 1135.5, + "y": 183.112389380531 + }, + { + "x": 1226.5, + "y": 220.3 + }, + { + "x": 1226.5, + "y": 283.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/stable/ent2d2_basic/dagre/sketch.exp.svg b/e2etests/testdata/stable/ent2d2_basic/dagre/sketch.exp.svg new file mode 100644 index 000000000..60b078ea0 --- /dev/null +++ b/e2etests/testdata/stable/ent2d2_basic/dagre/sketch.exp.svg @@ -0,0 +1,108 @@ +UseridintPKparent_idintFKspouse_idintFKPetidintPKowner_idintFKCardidintPKowner_idintFKPostidintPKtextstringauthor_idintFKMetadataidintPKageintInfoidintPKcontentjson.RawMessage spouse children/parentpets/ownercard/ownerposts/authormetadata/userinfo/user + + + + + + + + + \ No newline at end of file diff --git a/e2etests/testdata/stable/ent2d2_basic/elk/board.exp.json b/e2etests/testdata/stable/ent2d2_basic/elk/board.exp.json new file mode 100644 index 000000000..a1f1a2826 --- /dev/null +++ b/e2etests/testdata/stable/ent2d2_basic/elk/board.exp.json @@ -0,0 +1,1033 @@ +{ + "name": "", + "isFolderOnly": false, + "fontFamily": "SourceSansPro", + "shapes": [ + { + "id": "User", + "type": "sql_table", + "pos": { + "x": 453, + "y": 12 + }, + "width": 280, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "parent_id", + "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": "" + }, + { + "name": { + "label": "spouse_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 85, + "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": "User", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 49, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Pet", + "type": "sql_table", + "pos": { + "x": 12, + "y": 377 + }, + "width": 211, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "owner_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 78, + "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": "Pet", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 35, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Card", + "type": "sql_table", + "pos": { + "x": 243, + "y": 377 + }, + "width": 211, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "owner_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 78, + "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": "Card", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 49, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Post", + "type": "sql_table", + "pos": { + "x": 474, + "y": 377 + }, + "width": 239, + "height": 144, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "text", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 33, + "labelHeight": 26 + }, + "type": { + "label": "string", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + }, + { + "name": { + "label": "author_id", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 81, + "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": "Post", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 47, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Metadata", + "type": "sql_table", + "pos": { + "x": 733, + "y": 377 + }, + "width": 163, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "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": "" + } + ], + "label": "Metadata", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 100, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + }, + { + "id": "Info", + "type": "sql_table", + "pos": { + "x": 916, + "y": 377 + }, + "width": 325, + "height": 108, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "N1", + "stroke": "N7", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": 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": "content", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 66, + "labelHeight": 26 + }, + "type": { + "label": "json.RawMessage", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 149, + "labelHeight": 26 + }, + "constraint": "", + "reference": "" + } + ], + "label": "Info", + "fontSize": 20, + "fontFamily": "DEFAULT", + "language": "", + "color": "N1", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 42, + "labelHeight": 31, + "zIndex": 0, + "level": 1, + "primaryAccentColor": "B2", + "secondaryAccentColor": "AA2", + "neutralAccentColor": "N2" + } + ], + "connections": [ + { + "id": "(User <-> User)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "User", + "dstArrow": "cf-one", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "spouse", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 48, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 453.5, + "y": 69.6 + }, + { + "x": 403.5, + "y": 69.6 + }, + { + "x": 403.5, + "y": 98.4 + }, + { + "x": 453.5, + "y": 98.4 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> User)[1]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "User", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "children/parent", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 104, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 453.5, + "y": 40.8 + }, + { + "x": 343.5, + "y": 40.8 + }, + { + "x": 343.5, + "y": 127.2 + }, + { + "x": 453.5, + "y": 127.2 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Pet)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Pet", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "pets/owner", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 77, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 500.16666666666663, + "y": 156 + }, + { + "x": 500.16666666666663, + "y": 196 + }, + { + "x": 117.5, + "y": 196 + }, + { + "x": 117.5, + "y": 377 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Card)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Card", + "dstArrow": "cf-one", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "card/owner", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 78, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 546.8333333333334, + "y": 156 + }, + { + "x": 546.8333333333334, + "y": 246 + }, + { + "x": 348.5, + "y": 246 + }, + { + "x": 348.5, + "y": 377 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Post)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Post", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "posts/author", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 88, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 593.5, + "y": 156 + }, + { + "x": 593.5, + "y": 377 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Metadata)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Metadata", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "metadata/user", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 101, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 640.1666666666666, + "y": 156 + }, + { + "x": 640.1666666666666, + "y": 246 + }, + { + "x": 814.5, + "y": 246 + }, + { + "x": 814.5, + "y": 377 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + }, + { + "id": "(User <-> Info)[0]", + "src": "User", + "srcArrow": "cf-one-required", + "srcLabel": "", + "dst": "Info", + "dstArrow": "cf-many", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "B1", + "borderRadius": 10, + "label": "info/user", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "N2", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 60, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 686.8333333333333, + "y": 156 + }, + { + "x": 686.8333333333333, + "y": 196 + }, + { + "x": 1078.5, + "y": 196 + }, + { + "x": 1078.5, + "y": 377 + } + ], + "animated": false, + "tooltip": "", + "icon": null, + "zIndex": 0 + } + ], + "root": { + "id": "", + "type": "", + "pos": { + "x": 0, + "y": 0 + }, + "width": 0, + "height": 0, + "opacity": 0, + "strokeDash": 0, + "strokeWidth": 0, + "borderRadius": 0, + "fill": "N7", + "stroke": "", + "shadow": false, + "3d": false, + "multiple": false, + "double-border": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "blend": false, + "fields": null, + "methods": null, + "columns": null, + "label": "", + "fontSize": 0, + "fontFamily": "", + "language": "", + "color": "", + "italic": false, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "zIndex": 0, + "level": 0 + } +} diff --git a/e2etests/testdata/stable/ent2d2_basic/elk/sketch.exp.svg b/e2etests/testdata/stable/ent2d2_basic/elk/sketch.exp.svg new file mode 100644 index 000000000..94b233c21 --- /dev/null +++ b/e2etests/testdata/stable/ent2d2_basic/elk/sketch.exp.svg @@ -0,0 +1,108 @@ +UseridintPKparent_idintFKspouse_idintFKPetidintPKowner_idintFKCardidintPKowner_idintFKPostidintPKtextstringauthor_idintFKMetadataidintPKageintInfoidintPKcontentjson.RawMessage spouse children/parentpets/ownercard/ownerposts/authormetadata/userinfo/user + + + + + + + + + \ No newline at end of file