antvis / X6

🚀 JavaScript diagramming library that uses SVG and HTML for rendering.
https://x6.antv.antgroup.com
MIT License
5.79k stars 1.71k forks source link

positionCell 设置options无效 #3201

Closed happy-mht closed 1 year ago

happy-mht commented 1 year ago

Describe the bug

positionCell(cell: Cell, pos: Direction, options?: CenterOptions): this

positionCell 官方API带了options 参数,但是实际options设置padding无效

Your Example Website or App

Steps to Reproduce the Bug or Issue

  1. graph支持滚动插件
    graph.use(
      new Scroller({
        enabled: true,
        pannable: true,
        modifiers: 'ctrl'
      })
    )
    1. 定位到某个node
      graph.positionCell(node, 'top', {
      padding: { top: 200}
      })
    2. padding 设置无效
  1. 看源码发现 函数实现并没有options参数

    positionCell(cell: Cell, direction: Transform.Direction) {
    const scroller = this.getPlugin<any>('scroller')
    if (scroller) {
      scroller.positionCell(cell, direction)
    } else {
      this.transform.positionCell(cell, direction)
    }
    
    return this
    }

Expected behavior

期望padding生效

Screenshots or Videos

image

上图中的开始节点希望有边距

Platform

Additional context

NewByVector commented 1 year ago

/cib

x6-bot[bot] commented 1 year ago

@mht1993

Branch issue/issue-3201 was created for this issue. We will investigate into the matter and get back to you as soon as possible.

感谢反馈问题或提供改进建议,我们创建了 issue/issue-3201 分支来处理这个问题,你可以继续跟进后续的解决方案。

x6-bot[bot] commented 9 months ago

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.