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

导出png或svg格式的图片时,页面会抖动 #2061

Closed
mjyg opened this issue Apr 26, 2022 · 10 comments
Closed

导出png或svg格式的图片时,页面会抖动 #2061

mjyg opened this issue Apr 26, 2022 · 10 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@mjyg
Copy link

mjyg commented Apr 26, 2022

Describe the bug

导出png或svg格式的图片时,页面会抖动

Your Example Website or App

https://x6.antv.vision/zh/examples/showcase/practices#tree

Steps to Reproduce the Bug or Issue

打开上面的例子,在右边代码里加如下代码

setTimeout(()=>{
    graph.toPNG(
        (dataUri) => {
          DataUri.downloadDataUri(dataUri, 'a.png');
        },
      );
  }, 3000)

企业微信截图_70c33259-f712-44ac-8c4c-9009dd065892

可观察到5秒之后开始下载,页面出现明显抖动

下面的视频在第7秒时开始下载页面出现抖动

Expected behavior

导出图片时页面不发生抖动

Screenshots or Videos

2022-04-26.5.33.12.mov

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 1.31.3

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Apr 26, 2022

👋 @mjyg

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@jiqili
Copy link

jiqili commented May 5, 2022

应该是样式丢失了,参考#1246
解决办法是补上或去掉某个css属性,我自己是去掉了elementui的el-button的transition属性就行了,我每次点击下载按钮都调用handleAutoBlur函数,希望能帮到你。

    handleAutoBlur(evt) {
      let target = evt.target;
      if (target.nodeName === "SPAN" || target.nodeName === "button") {
        target = evt.target.parentNode;
      }
      target.blur();
    },

@NewByVector
Copy link
Contributor

应该是 copyStyle 导致的。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label May 7, 2022
@itwmike
Copy link

itwmike commented May 13, 2022

我也遇到同样的问题了

@NewByVector
Copy link
Contributor

抖动可以将 copyStyle 设置为 false。

@dlr188
Copy link

dlr188 commented Jul 15, 2022

抖动可以将 copyStyle 设置为 false。
vue2自定义组件!!!
设置前抖动,但图片导出正常
image
设置后不再抖动,但导出的图片央样式有问题
image
代码:
image

@itwmike
Copy link

itwmike commented Jul 15, 2022

这个问题是没法解决么 ?

@zhangxilong-43
Copy link

补上或去掉某个css属性,请问这个如何判断自己写的哪个样式属性有问题呢?

@lmh-justdo
Copy link

lmh-justdo commented Nov 7, 2022

应该是样式丢失了,参考#1246 解决办法是补上或去掉某个css属性,我自己是去掉了elementui的el-button的transition属性就行了,我每次点击下载按钮都调用handleAutoBlur函数,希望能帮到你。

    handleAutoBlur(evt) {
      let target = evt.target;
      if (target.nodeName === "SPAN" || target.nodeName === "button") {
        target = evt.target.parentNode;
      }
      target.blur();
    },

为什么我的node节点使用vue自定义组件,里面就包含一个el-button按钮,导出png时,element-ui样式都丢失了,我是在main.js全局导入element-ui样式的。可以给个你的正常的demo吗。

@x6-bot
Copy link
Contributor

x6-bot bot commented Nov 8, 2023

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

7 participants