You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Hugo-seth (via GitHub)" <gi...@apache.org> on 2023/06/13 08:31:16 UTC

[GitHub] [echarts] Hugo-seth opened a new issue, #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Hugo-seth opened a new issue, #18756:
URL: https://github.com/apache/echarts/issues/18756

   ### Version
   
   5.4.2
   
   ### Link to Minimal Reproduction
   
   https://codesandbox.io/s/echarts-pie-gauge-forked-wnk4dj?file=/src/App.js
   
   ### Steps to Reproduce
   
   1. 使用 react ref 创建 echarts 示例 
    `const chart = echarts.init(this.chartRef.current);`
   2. 定义 option  
   `const option = {
         title: {
           text: "Basic Graph"
         },
         tooltip: {},
         animationDurationUpdate: 1500,
         animationEasingUpdate: "quinticInOut",
         series: [
           {
             type: "graph",
             layout: "none",
             symbolSize: 50,
             zoom: 1,
             roam: false,
             label: {
               show: true
             },
             edgeSymbol: ["circle", "arrow"],
             edgeSymbolSize: [4, 10],
             edgeLabel: {
               fontSize: 20
             },
             data: [
               {
                 name: "Node 1",
                 x: 100,
                 y: 300
               },
               {
                 name: "Node 2",
                 x: 300,
                 y: 300
               },
               {
                 name: "Node 3",
                 x: 200,
                 y: 300
               }
             ],
             // links: [],
             links: [
               {
                 source: "Node 1",
                 target: "Node 3"
               },
               {
                 source: "Node 2",
                 target: "Node 3"
               },
               {
                 source: "Node 2",
                 target: "Node 4"
               }
             ],
             lineStyle: {
               opacity: 0.9,
               width: 2,
               curveness: 0
             }
           }
         ]
       };`
   3. setOption 
   `chart.setOption(option);`
   
   
   ### Current Behavior
   
   <img width="1611" alt="image" src="https://github.com/apache/echarts/assets/17878774/52616cc2-aaaa-49f2-8e15-c41f8e50cae0">
   图的宽度是 854,节点的最大 x 是 300。可以明显的发现,节点的位置并不是设置的 x,y 的值
   
   ### Expected Behavior
   
   节点位置是定义的 x,y
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1588814082

   @Hugo-seth It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] data position (x, y) of type graph not work. (Relationship graph node coordinates do not take effect)
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "plainheart (via GitHub)" <gi...@apache.org>.
plainheart commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1589022487

   应该是因为 graph 默认设置的 [left](https://echarts.apache.org/option.html#series-graph.left) 和 [right](https://echarts.apache.org/option.html#series-graph.right) 的缘故,你可以调整下该值。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Hugo-seth commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "Hugo-seth (via GitHub)" <gi...@apache.org>.
Hugo-seth commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1592206591

   > 这是因为关系图的静态布局有一个策略:尽量使图的外包围盒平铺画布。这就是为什么你的坐标设置了最大300,但还是被拉伸的原因。如果你想用固定值绘制图形,你可以考虑用【自定义系列】。或者利用echarts的扩展极值,扩展一个没有该策略的静态布局。如果没有特殊的交互的话,你甚至可以使用Graphic绘制
   
   这样太麻烦了。有个简单的方法就是不要超过画布的宽高。超过了部分坐标为负数就不会叠在一起。提这个 issue 主要是想看下官方的说法,也看看社区有没更好的方法。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1589084377

   This is not a bug. Please note that the values of `x` and `y` are not in pixels but are only relative to other values of the data.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [I] [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效) [echarts]

Posted by "ybrelax (via GitHub)" <gi...@apache.org>.
ybrelax commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1862338273

   if you want to fix point(x,y), you could think of using [ coordinateSystem: 'cartesian2d']; then setting Yaxis.max and Xaxis.max matches the height and width of the original image; Maybe your inital point is the top left corner, you can set Yaxis.inverse is true


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] li942475402 commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "li942475402 (via GitHub)" <gi...@apache.org>.
li942475402 commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1590580360

   这是因为关系图的静态布局有一个策略:尽量使图的外包围盒平铺画布。这就是为什么你的坐标设置了最大300,但还是被拉伸的原因。如果你想用固定值绘制图形,你可以考虑用【自定义系列】。或者利用echarts的扩展极值,扩展一个没有该策略的静态布局。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Hugo-seth commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "Hugo-seth (via GitHub)" <gi...@apache.org>.
Hugo-seth commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1590324985

   > This is not a bug. Please note that the values of `x` and `y` are not in pixels but are only relative to other values of the data.
   How to set the minimum distance between nodes,The effect of the picture below is not what I want。(那要怎么设置节点最小距离,下图的效果不是我想要的,几乎重叠在一起了)
   <img width="1401" alt="image" src="https://github.com/apache/echarts/assets/17878774/2e0858c8-55dc-478e-ab0a-a10b14e0e23d">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Hugo-seth commented on issue #18756: [Bug] data position(x, y)of type graph not work.(关系图节点坐标不生效)

Posted by "Hugo-seth (via GitHub)" <gi...@apache.org>.
Hugo-seth commented on issue #18756:
URL: https://github.com/apache/echarts/issues/18756#issuecomment-1610588415

   > 这是因为关系图的静态布局有一个策略:尽量使图的外包围盒平铺画布。这就是为什么你的坐标设置了最大300,但还是被拉伸的原因。如果你想用固定值绘制图形,你可以考虑用【自定义系列】。或者利用echarts的扩展极值,扩展一个没有该策略的静态布局。如果没有特殊的交互的话,你甚至可以使用Graphic绘制
   
   @li942475402 想请问下怎么利用echarts的扩展极值,扩展一个没有该策略的静态布局,是哪个 API呢?我去看下。【自定义系列】又是哪个API,麻烦能给下链接?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org