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 2022/04/19 04:02:11 UTC

[GitHub] [echarts] plainheart commented on a diff in pull request #16904: fix(graph): roam center don't support string

plainheart commented on code in PR #16904:
URL: https://github.com/apache/echarts/pull/16904#discussion_r852573761


##########
src/action/roamHelper.ts:
##########
@@ -45,7 +45,7 @@ export function updateCenterAndZoom(
     }
 ) {
     const previousZoom = view.getZoom();
-    const center = view.getCenter();
+    const center = view.getDefaultCenter();

Review Comment:
   I personally think the `center` option of the `graph` series is used to set the initial center and both the documentation and the source code don't indicate that it can be a string array. But it seems the [`gauge`](https://github.com/apache/echarts/blob/master/src/chart/gauge/GaugeView.ts#L47-L52) series and [`pie`](https://github.com/apache/echarts/blob/master/src/chart/pie/pieLayout.ts#L44-L57) series support it. If necessary, it might be practical to normalize the `center` at https://github.com/apache/echarts/blob/master/src/chart/graph/createView.ts#L91



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