You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/09/23 20:44:53 UTC

[GitHub] [echarts] 100pah edited a comment on pull request #15405: fix:node self pointed -add cubicBezierCurve

100pah edited a comment on pull request #15405:
URL: https://github.com/apache/echarts/pull/15405#issuecomment-926140050


   I have made a "draggable" [test case](https://echarts-try.surge.sh/graph-self-loop-old/graph-self-loop.html) to cover scenarios as much as possible.
   
   ## I've found that there are those issues:
   1. In some of the angle the direction of the self-loop edge is not expected.
   <img width="246" alt="Screen Shot 2021-09-24 at 4 37 10 AM" src="https://user-images.githubusercontent.com/1956569/134580288-71affdc1-28b2-4828-af21-a4cb718c11aa.png">
   
   
   2. When scaling the graph, the label fly to wrong place.
   
   3. The rotate of the the arrows are not correct.
   <img width="245" alt="Screen Shot 2021-09-24 at 4 39 02 AM" src="https://user-images.githubusercontent.com/1956569/134580529-4be3639b-bf37-4a3a-a5d1-4c2ed056212b.png">
   
   
   ## A PR-fix: https://github.com/HCLacids/echarts/pull/1 to fix this PR
   This [PR-fix](https://github.com/HCLacids/echarts/pull/1) fixed the issue `1` above, and add test cases.
   
   Before that PR-fix: https://echarts-try.surge.sh/graph-self-loop-old/graph-self-loop.html
   After that PR-fix: https://echarts-try.surge.sh/graph-self-loop/graph-self-loop.html
   
   
   ## About curveness
   
   At present, the curveness can be controlled by two ways:
   (A) [autoCurveness: true](https://echarts.apache.org/zh/option.html#series-graph.autoCurveness)
   (B) [lineStyle.curveness](https://echarts.apache.org/zh/option.html#series-graph.lineStyle.curveness).
   `lineStyle.curveness` can be set on the whole series:
   ```js
   series: {
       type: 'graph',
       lineStyle: {
           curveness: 0.5
       }
   }
   ```
   or on some certain edges:
   ```js
   series: {
       type: 'graph',
       edges: [{
           source: 1,
           target: 4,
           lineStyle: {
               curveness: 0.7
           }
       }, {
           source: 1
           target: 4
       }]
   }
   ```
   When `lineStyle.curveness` is set to some edge, `autoCurveness` will not be accepted to that edge. Basically it's implemented by code like this:
   ```js
   const curveness = zrUtil.retrieve3(
       edge.getModel<GraphEdgeItemOption>().get(['lineStyle', 'curveness']),
       -getCurvenessForEdge(edge, seriesModel, index, true),
       0
   );
   ```
   + `focus: 'adjacency'`
   ```js
   emphasis: {
       focus: 'adjacency'
   },
   ```
   
   But I think we do not need to support `autoCurveness` in self-loop edges if the we accept the layout in this [PR-fix](https://github.com/HCLacids/echarts/pull/1).
   
   
   ---
   
   @HCLacids Could the [PR-fix](https://github.com/HCLacids/echarts/pull/1) be approved ?
   
   Any issue can  be discussed.


-- 
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