G6 icon indicating copy to clipboard operation
G6 copied to clipboard

[Bug]: The image has not been exported full under the 'overall' option., but I was not use any other custom renderer

Open Sorryhx opened this issue 9 months ago • 3 comments

Describe the bug / 问题描述

I exported an image using toDataURL, but the image was not fully rendered. After checking my code, I found that I did not use any custom renderer. It seems that the graph cannot correctly calculate the size of nodes at the edge of the canvas. Additionally, we might need a padding option.

Reproduction link / 复现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

Version / 版本

🆕 5.x

OS / 操作系统

  • [x] macOS
  • [x] Windows
  • [x] Linux
  • [ ] Others / 其他

Browser / 浏览器

  • [x] Chrome
  • [ ] Edge
  • [ ] Firefox
  • [ ] Safari (Limited support / 有限支持)
  • [ ] IE (Nonsupport / 不支持)
  • [ ] Others / 其他

Sorryhx avatar Mar 28 '25 01:03 Sorryhx

To fix the truncated export issue, set graph options with padding: 20 and autoFit: 'view':

yvonneyx avatar Mar 28 '25 02:03 yvonneyx

To fix the truncated export issue, set graph options with padding: 20 and autoFit: 'view':

I had set the two options, but it doesn’t seem to be working.

Image

Image

Sorryhx avatar Mar 28 '25 08:03 Sorryhx

@Aarebecca 帮忙看下呢

yvonneyx avatar Mar 28 '25 09:03 yvonneyx