100pah commented on a change in pull request #15405:
URL: https://github.com/apache/echarts/pull/15405#discussion_r709371843
##########
File path: src/chart/graph/simpleLayoutHelper.ts
##########
@@ -49,7 +69,80 @@ export function simpleLayoutEdge(graph: Graph, seriesModel:
GraphSeriesModel) {
const p1 = vec2.clone(edge.node1.getLayout());
const p2 = vec2.clone(edge.node2.getLayout());
const points = [p1, p2];
- if (+curveness) {
+ if (edge.node1 === edge.node2) {
+ const curve = getCurvenessForEdge(edge, seriesModel, index, true);
+ const curveness = curve >= 1 ? curve : 1 - curve;
+ const symbolSize = seriesModel.get('symbolSize');
+ const size = zrUtil.isArray(symbolSize) ? Number((symbolSize[0] +
symbolSize[1]) / 2) : Number(symbolSize);
+ const radius = getNodeGlobalScale(seriesModel) * size / 2 *
curveness;
Review comment:
1. Here we `* curveness` and latter we `10 * radius`.
I think we should better make those code in one place.
2. The user specified or auto calculated (by `autoCurveness: true`)
curveness should be fetched by :
```ts
const curveness = zrUtil.retrieve3(
edge.getModel<GraphEdgeItemOption>().get(['lineStyle',
'curveness']),
-getCurvenessForEdge(edge, seriesModel, index, true),
0
);
```
See this [PR-fix](https://github.com/HCLacids/echarts/pull/1) for more
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]