antvis/G6

G6重新渲染的方法是什么? #5613

backy-1451592168 posted onGitHub

问题描述

因页面大小出现变化,但是数据又没改变,需要重新渲染页面,有相应的重新渲染函数吗?

重现链接

onst graph = new G6.TreeGraph({})

重现步骤

数据不变,希望调用方法重新渲染

预期行为

数据不变,希望调用方法重新渲染

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

目前是这样实现重新渲染的

const bloodMapElement = document.getElementById("blood-map");
        if (bloodMapElement) {
          const canvasElement = bloodMapElement.querySelector('canvas');
          if (canvasElement) {
            // 移除 canvas 元素
            bloodMapElement.removeChild(canvasElement);
          }
        }

        this.$nextTick(()=> {
          // 重新渲染
          this.info()
        })

posted by hanfengcan 12 months ago

Fund this Issue

$0.00
Funded

Pull requests