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/11/21 09:03:38 UTC

[GitHub] [echarts] theoarmengou commented on issue #17946: [Bug] Callback for series-tree.symbol not defined in typescript

theoarmengou commented on issue #17946:
URL: https://github.com/apache/echarts/issues/17946#issuecomment-1321724707

   Seems like the problems comes from the definition of the interface of `TreeSeriesOption`:
   ```ts
   interface TreeSeriesOption extends SeriesOption<TreeSeriesStateOption, TreeStatesMixin>, TreeSeriesStateOption, SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin {
       type?: 'tree';
       layout?: 'orthogonal' | 'radial';
       edgeShape?: 'polyline' | 'curve';
       /**
        * Available when edgeShape is polyline
        */
       edgeForkPosition?: string | number;
       nodeScaleRatio?: number;
       /**
        * The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'.
        * and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'.
        */
       orient?: 'LR' | 'TB' | 'RL' | 'BT' | 'horizontal' | 'vertical';
       expandAndCollapse?: boolean;
       /**
        * The initial expanded depth of tree
        */
       initialTreeDepth?: number;
       leaves?: TreeSeriesLeavesOption;
       data?: TreeSeriesNodeItemOption[];
   }
   ```
   In the `extends SymbolOptionMixin`, there is no generic given to the interface.
   
   ```ts
   interface SymbolOptionMixin<T = never> {
       /**
        * type of symbol, like `cirlce`, `rect`, or custom path and image.
        */
       symbol?: string | (T extends never ? never : SymbolCallback<T>);
       /**
        * Size of symbol.
        */
       symbolSize?: number | number[] | (T extends never ? never : SymbolSizeCallback<T>);
       symbolRotate?: number | (T extends never ? never : SymbolRotateCallback<T>);
       symbolKeepAspect?: boolean;
       symbolOffset?: string | number | (string | number)[] | (T extends never ? never : SymbolOffsetCallback<T>);
   }
   ```
   
   Maybe setting the `extends SymbolOptionMixin` to `extends SymbolOptionMixin<CallbackDataParams>` in the declaration of the interface `CallbackDataParams`, would solve this 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