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

选择边的时候 添加 filter 高亮 当设置为直线的时候 边不显示了 #4528

Open
liv-rong opened this issue Dec 13, 2024 · 2 comments
Labels
resolution: needs demos 需要复现 Issues that need minimal demos to reproduce any problems

Comments

@liv-rong
Copy link

Describe the bug

当选择边的时候 想给边添加高亮的功能 所以选择使用 filter ,但是 添加之后 当边修改为直线的时候 边就不显示了 当再修改为有折线的线 边又显示了

Your Example Website or App

20241213-134426.mp4

Steps to Reproduce the Bug or Issue

  1. 边选择的时候添加高亮功能 (画布有平移功能)
  2. 代码
graph.on('cell:selected', ({ cell }) => {
    if (cell.isEdge()) {
      cell.addTools([
        {
          name: 'edge-editor'
        }
      ])
      cell.attr({
        attrs: {
          width: '100%',
          height: '100%',
          filterUnits: 'userSpaceOnUse'
        }
      })
      cell.attr('line/filter', {
        name: 'dropShadow',
        args: {
          dx: 0,
          dy: 0,
          blur: 2,
          color: 'green',
          opacity: 1
        }
      })
    }
}

Expected behavior

选择的时候 能有高亮功能 并且修改直线的时候 边正常显示

Screenshots or Videos

20241213-134426.mp4

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]

Additional context

添加滤镜高亮 边直线的时候 边不显示了

@liv-rong
Copy link
Author

image

   cell.attr({
          line: {
            stroke: '#000000',
            strokeWidth: 1,
            filter: {
              name: 'dropShadow',
              args: {
                color: 'red',
                dx: 0,
                dy: 0,
                blue: 3,
                opacity: 1,
                
              },
              attrs: {
                width: '100%',
                height: '100%',
                filterUnits: 'userSpaceOnUse'
              }
            }
          }
        })
      }

当增加 width: height: filterUnits: 属性的时候 又有边不显示完全了
奇奇怪怪的

@NewByVector
Copy link
Contributor

增加 filterUnits 显示不完全是什么效果,有截图吗,我这里有个例子 https://codesandbox.io/p/sandbox/lian-xian-de-lu-jing-xiao-guo-7byd7b?file=%2Fsrc%2FApp.tsx%3A84%2C7 是正常显示的。

@NewByVector NewByVector added the resolution: needs demos 需要复现 Issues that need minimal demos to reproduce any problems label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: needs demos 需要复现 Issues that need minimal demos to reproduce any problems
Projects
None yet
Development

No branches or pull requests

2 participants