antvis/G6

5.0.6版改变圆形节点的style.fill颜色,再调用draw,颜色不变 #5997

xgene posted onGitHub

Describe the bug / 问题描述

执行以下代码后,节点颜色不变,但拖动节点后立马变色 let nodeData = graph.getNodeData(); let firstData = nodeData[0]; firstData.style.fill = 'red'; graph.updateNodeData([firstData]); graph.draw();

No response

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

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


你的数据修改方式是❌错误的 不要修改已有数据对象,而是传入新的数据对象

graph.updateNodeData([{
  id: 'node-0',
  style: {
    fill: 'red'
  }
}]);
graph.draw();
posted by Aarebecca 10 months ago

原来是这样,谢谢

posted by xgene 10 months ago

Fund this Issue

$0.00
Funded

Pull requests