Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

元素很多时 downloadFullImage 导出图片失败 #3675

Closed
webmrxu opened this issue May 11, 2022 · 4 comments
Closed

元素很多时 downloadFullImage 导出图片失败 #3675

webmrxu opened this issue May 11, 2022 · 4 comments

Comments

@webmrxu
Copy link

webmrxu commented May 11, 2022

问题描述

#2980 查看了这个issues 已经关闭了,但项目中数据量大导出图片还是空白。

g6 版本:4.5.0
浏览器版本: chrome 87.0.4280.66
layout.type: compactBox 树
节点数量: 319 个
每个节点高宽:width:240 height:90
container入器高宽:width: 1102 height: 517 , 可拖动和缩放
导出图片文件,用window系统图片查看器打开图片提示:windows 照片查看器无法显示此图片,因为该文件是空的。

重现链接

重现步骤

layout.type: compactBox 树
节点数量: 319 个
每个节点高宽:width:240 height:90
渲染正常,导出图片空白

预期行为

导出图片正常

平台

  • 操作系统: [ Windows ]
  • 网页浏览器: [Google Chrome]
  • G6 版本: [4.5.0 ]

屏幕截图或视频(可选)

No response

补充说明(可选)

浏览器控制台中没有任何报错

@webmrxu
Copy link
Author

webmrxu commented May 11, 2022

debugger 源码发现 toDataUrl 返回 "data:,"
是不是以下问题,可以参考下
https://stackoverflow.com/questions/30079423/canvas-todataurl-returns-data

临时解决方案,缩放到0.9 倍然后导出图片正常

graph.zoomTo(0.9)

@Yanyan-Wang
Copy link
Contributor

可以给个复现 demo 吗

@Yanyan-Wang
Copy link
Contributor

v4.6.8 在导出图片时设置了兼容大小,不确定是否能修复上述问题

const width = Math.max(this.get('width'), 500);

@webmrxu
Copy link
Author

webmrxu commented Jun 23, 2022

目前项目中解决方式是:

限制节点数量,导出数据量大时,限制用户只能选择一个颗子树进行导出图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants