You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "100pah (via GitHub)" <gi...@apache.org> on 2025/06/01 09:23:07 UTC
Re: [PR] feat(custom): support compoundPath in custom series renderItem [echarts]
100pah commented on code in PR #20402:
URL: https://github.com/apache/echarts/pull/20402#discussion_r2118929868
##########
src/chart/custom/CustomView.ts:
##########
@@ -352,7 +354,36 @@ function createEl(elOption: CustomElementOption): Element {
el = new graphicUtil.Group();
}
else if (graphicType === 'compoundPath') {
- throw new Error('"compoundPath" is not supported yet.');
+ const shape = (elOption as CustomCompoundPathOption).shape;
+ if (!shape || !shape.paths) {
+ let errMsg = '';
+ if (__DEV__) {
+ errMsg = 'shape.paths must be specified in compoundPath';
+ }
+ throwError(errMsg);
+ }
+ const paths = map(shape.paths as Path[], function (path) {
+ if (path.type === 'path') {
+ return graphicUtil.makePath(path.shape.pathData, path, null);
+ }
+ const Clz = graphicUtil.getShapeClass(path.type);
+ if (!Clz) {
+ if (typeof path.buildPath === 'function') {
Review Comment:
I think probably we should not public that `buildPath`.
1. That function is not officially public in any other place, including not public in custom series path.
2. If publish `buildPath` function, the signature must not be changed or need backward compat when changing. And the parameter of `buildPath` includes `ctx`, which is `PathProxy` or `CanvasContext`. Although they are always accessible never be officially public and promised in API stability.
Is it needed in some scenarios? @Ovilia
--
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