diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts index 1c240fde97..6406175724 100644 --- a/src/chart/tree/TreeView.ts +++ b/src/chart/tree/TreeView.ts @@ -433,7 +433,7 @@ function updateNode( let rad; let isLeft; - if (targetLayout.x === rootLayout.x && node.isExpand === true) { + if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) { const center = { x: (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2, y: (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2 diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index d8eec78bac..380a5f1da8 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -187,7 +187,7 @@ "tooltip-valueFormatter": 3, "tree-image": 1, "tree-legend": 1, - "tree-radial": 1, + "tree-radial": 2, "treemap-action": 3, "treemap-disk": 3, "treemap-disk2": 3, diff --git a/test/runTest/actions/tree-radial.json b/test/runTest/actions/tree-radial.json index f7db25f513..b08eb3efd8 100644 --- a/test/runTest/actions/tree-radial.json +++ b/test/runTest/actions/tree-radial.json @@ -1 +1 @@ -[{"name":"Action 1","ops":[{"type":"mousedown","time":357,"x":466,"y":333},{"type":"mouseup","time":438,"x":466,"y":333},{"time":439,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":920,"x":460,"y":338},{"type":"mousemove","time":1142,"x":454,"y":361},{"type":"mousemove","time":1343,"x":454,"y":362},{"type":"mousemove","time":1546,"x":450,"y":368},{"type":"mousemove","time":1746,"x":449,"y":368},{"type":"mousemove","time":1946,"x":445,"y":367},{"type":"mousemove","time":2171,"x":445,"y":366},{"type":"mousedown","time":2261,"x":445,"y":366},{"type":"mouseup","time":2361,"x":445,"y":366},{"time":2362,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":2487,"x":443,"y":366},{"type":"mousemove","time":2777,"x":442,"y":366},{"type":"mousemove","time":2787,"x":440,"y":364},{"type":"mousemove","time":2995,"x":410,"y":342},{"type":"mousemove","time":3197,"x":400,"y":326},{"type":"mousemove","time":3411,"x":406,"y":319},{"type":"mousemove","time":3656,"x":402,"y":315},{"type":"mousemove","time":3861,"x":400,"y":313},{"type":"mousedown","time":3896,"x":400,"y":313},{"type":"mouseup","time":4002,"x":400,"y":313},{"time":4003,"delay":600,"type":"screenshot-auto"},{"type":"mousedown","time":5214,"x":400,"y":313},{"type":"mouseup","time":5280,"x":400,"y":313},{"time":5281,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":5321,"x":400,"y":313},{"type":"mousemove","time":5549,"x":399,"y":313},{"type":"mousemove","time":5787,"x":397,"y":313}],"scrollY":0,"scrollX":0,"timestamp":1568045284639}] \ No newline at end of file +[{"name":"Action 1","ops":[{"type":"mousedown","time":357,"x":466,"y":333},{"type":"mouseup","time":438,"x":466,"y":333},{"time":439,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":920,"x":460,"y":338},{"type":"mousemove","time":1142,"x":454,"y":361},{"type":"mousemove","time":1343,"x":454,"y":362},{"type":"mousemove","time":1546,"x":450,"y":368},{"type":"mousemove","time":1746,"x":449,"y":368},{"type":"mousemove","time":1946,"x":445,"y":367},{"type":"mousemove","time":2171,"x":445,"y":366},{"type":"mousedown","time":2261,"x":445,"y":366},{"type":"mouseup","time":2361,"x":445,"y":366},{"time":2362,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":2487,"x":443,"y":366},{"type":"mousemove","time":2777,"x":442,"y":366},{"type":"mousemove","time":2787,"x":440,"y":364},{"type":"mousemove","time":2995,"x":410,"y":342},{"type":"mousemove","time":3197,"x":400,"y":326},{"type":"mousemove","time":3411,"x":406,"y":319},{"type":"mousemove","time":3656,"x":402,"y":315},{"type":"mousemove","time":3861,"x":400,"y":313},{"type":"mousedown","time":3896,"x":400,"y":313},{"type":"mouseup","time":4002,"x":400,"y":313},{"time":4003,"delay":600,"type":"screenshot-auto"},{"type":"mousedown","time":5214,"x":400,"y":313},{"type":"mouseup","time":5280,"x":400,"y":313},{"time":5281,"delay":600,"type":"screenshot-auto"},{"type":"mousemove","time":5321,"x":400,"y":313},{"type":"mousemove","time":5549,"x":399,"y":313},{"type":"mousemove","time":5787,"x":397,"y":313}],"scrollY":0,"scrollX":0,"timestamp":1568045284639},{"name":"Action 2","ops":[{"type":"mousemove","time":599,"x":771,"y":551},{"type":"mousemove","time":807,"x":453,"y":391},{"type":"mousemove","time":981,"x":453,"y":391},{"type":"mousemove","time":1189,"x":401,"y":400},{"type":"mousedown","time":1306,"x":401,"y":400},{"type":"mouseup","time":1315,"x":401,"y":400},{"time":1316,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1682,"x":395,"y":400},{"type":"mousemove","time":1888,"x":366,"y":429},{"type":"mousemove","time":2089,"x":448,"y":428},{"type":"mousemove","time":2297,"x":397,"y":381},{"type":"mousemove","time":2498,"x":384,"y":505},{"type":"mousemove","time":2704,"x":488,"y":599}],"scrollY":316,"scrollX":0,"timestamp":1651049458672}] \ No newline at end of file diff --git a/test/tree-radial.html b/test/tree-radial.html index 1a38427f23..6042a7181c 100644 --- a/test/tree-radial.html +++ b/test/tree-radial.html @@ -1,4 +1,4 @@ - + + -
- + + - \ No newline at end of file + +