add todo for dagre layout
This commit is contained in:
parent
8b1a40fed9
commit
31d0124d31
3 changed files with 261 additions and 1 deletions
215
e2etests/testdata/todo/container_child_edge/board.exp.json
vendored
Normal file
215
e2etests/testdata/todo/container_child_edge/board.exp.json
vendored
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
{
|
||||
"name": "",
|
||||
"shapes": [
|
||||
{
|
||||
"id": "container",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"width": 255,
|
||||
"height": 452,
|
||||
"level": 1,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#E3E9FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "container",
|
||||
"fontSize": 28,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 117,
|
||||
"labelHeight": 41,
|
||||
"labelPosition": "INSIDE_TOP_CENTER"
|
||||
},
|
||||
{
|
||||
"id": "container.first",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 60,
|
||||
"y": 50
|
||||
},
|
||||
"width": 135,
|
||||
"height": 126,
|
||||
"level": 2,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "first",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 35,
|
||||
"labelHeight": 26,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER"
|
||||
},
|
||||
{
|
||||
"id": "container.second",
|
||||
"type": "",
|
||||
"pos": {
|
||||
"x": 50,
|
||||
"y": 276
|
||||
},
|
||||
"width": 155,
|
||||
"height": 126,
|
||||
"level": 2,
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"borderRadius": 0,
|
||||
"fill": "#EDF0FD",
|
||||
"stroke": "#0D32B2",
|
||||
"shadow": false,
|
||||
"3d": false,
|
||||
"multiple": false,
|
||||
"tooltip": "",
|
||||
"link": "",
|
||||
"icon": null,
|
||||
"iconPosition": "",
|
||||
"fields": null,
|
||||
"methods": null,
|
||||
"columns": null,
|
||||
"label": "second",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#0A0F25",
|
||||
"italic": false,
|
||||
"bold": true,
|
||||
"underline": false,
|
||||
"labelWidth": 55,
|
||||
"labelHeight": 26,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER"
|
||||
}
|
||||
],
|
||||
"connections": [
|
||||
{
|
||||
"id": "container.(first -> second)[0]",
|
||||
"src": "container.first",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "container.second",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "#0D32B2",
|
||||
"label": "1->2",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#676C7E",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 29,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 103.10840707964601,
|
||||
"y": 176
|
||||
},
|
||||
{
|
||||
"x": 87.6216814159292,
|
||||
"y": 216
|
||||
},
|
||||
{
|
||||
"x": 87.55,
|
||||
"y": 236
|
||||
},
|
||||
{
|
||||
"x": 102.75,
|
||||
"y": 276
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null
|
||||
},
|
||||
{
|
||||
"id": "(container -> container.second)[0]",
|
||||
"src": "container",
|
||||
"srcArrow": "none",
|
||||
"srcLabel": "",
|
||||
"dst": "container.second",
|
||||
"dstArrow": "triangle",
|
||||
"dstLabel": "",
|
||||
"opacity": 1,
|
||||
"strokeDash": 0,
|
||||
"strokeWidth": 2,
|
||||
"stroke": "#0D32B2",
|
||||
"label": "c->2",
|
||||
"fontSize": 16,
|
||||
"fontFamily": "DEFAULT",
|
||||
"language": "",
|
||||
"color": "#676C7E",
|
||||
"italic": true,
|
||||
"bold": false,
|
||||
"underline": false,
|
||||
"labelWidth": 28,
|
||||
"labelHeight": 21,
|
||||
"labelPosition": "INSIDE_MIDDLE_CENTER",
|
||||
"labelPercentage": 0,
|
||||
"route": [
|
||||
{
|
||||
"x": 151.891592920354,
|
||||
"y": 176
|
||||
},
|
||||
{
|
||||
"x": 167.3783185840708,
|
||||
"y": 216
|
||||
},
|
||||
{
|
||||
"x": 167.45,
|
||||
"y": 236
|
||||
},
|
||||
{
|
||||
"x": 152.25,
|
||||
"y": 276
|
||||
}
|
||||
],
|
||||
"isCurve": true,
|
||||
"animated": false,
|
||||
"tooltip": "",
|
||||
"icon": null
|
||||
}
|
||||
]
|
||||
}
|
||||
36
e2etests/testdata/todo/container_child_edge/sketch.exp.svg
vendored
Normal file
36
e2etests/testdata/todo/container_child_edge/sketch.exp.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 468 KiB |
|
|
@ -6,7 +6,16 @@ import (
|
|||
)
|
||||
|
||||
func testTodo(t *testing.T) {
|
||||
tcs := []testCase{}
|
||||
tcs := []testCase{
|
||||
{
|
||||
// issue https://github.com/terrastruct/d2/issues/71
|
||||
name: "container_child_edge",
|
||||
script: `
|
||||
container.first -> container.second: 1->2
|
||||
container -> container.second: c->2
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
runa(t, tcs)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue