antvis/G6

nodeStateStyles 样式没有变化 #5504

wu0211 posted onGitHub

问题描述

我现在设置的节点和边的默认样式是如下 defaultNode: {

        size: 50,
        labelCfg: {
          style: {
            fontSize: globalFontSize,
            fill: '#222',
            stroke: '#fff',
            lineWidth: 1,
          },
        },
      },
      defaultEdge: {
        type: 'quadratic',
        size: 0.5,
        style: {
          stroke: '#333',
        },
        labelCfg: {
          autoRotate: true,
          style: {
            stroke: '#2222',
            fill: '#545454',
            fontSize: 12,
            background: {
              fill: '#ffffff',
              stroke: '#bbb',
              padding: [2, 4, 2, 4],
              radius: 10,
            },
          },
        },
      },

现在配置的状态样式如下:

nodeStateStyles: {

        grayscale: {
          fillOpacity: 0.1,
          opacity: 0.1,
          stroke: '#bbb'
        },
      },
      edgeStateStyles: {
        grayscale: {

          strokeOpacity: 0.1,
          stroke: 'red',
          style: {
            strokeOpacity: 0.1,
            stroke: 'red',
          },

        },
      },

请问一下,我这样配置设置状态的时候,节点的颜色不会变化,边的颜色也不会变化是为什么,还有边上面的文字也没有变化

重现链接

如上

重现步骤

如上

预期行为

希望边和边上的文字labelCfg能变成灰色,节点上面的文字labelCfg也能变成灰色

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


兄弟我也有相同的问题,有没有解决办法

posted by sonlige 12 months ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 5 months ago

Fund this Issue

$0.00
Funded

Pull requests