You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2023/02/25 10:05:44 UTC

[echarts] branch fix/sunburst-types created (now a20820117)

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a change to branch fix/sunburst-types
in repository https://gitbox.apache.org/repos/asf/echarts.git


      at a20820117 fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback & add missing type definition for the `data` option

This branch includes the following new commits:

     new a20820117 fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback & add missing type definition for the `data` option

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[echarts] 01/01: fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback & add missing type definition for the `data` option

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch fix/sunburst-types
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit a208201173c3340e66f77a2c5145fa03f1067278
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Sat Feb 25 17:20:49 2023 +0800

    fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback & add missing type definition for the `data` option
---
 src/chart/sunburst/SunburstSeries.ts | 16 ++++++++++------
 src/util/types.ts                    |  4 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/chart/sunburst/SunburstSeries.ts b/src/chart/sunburst/SunburstSeries.ts
index 402de0110..185fc1412 100644
--- a/src/chart/sunburst/SunburstSeries.ts
+++ b/src/chart/sunburst/SunburstSeries.ts
@@ -50,7 +50,7 @@ interface SunburstItemStyleOption<TCbParams = never> extends ItemStyleOption<TCb
     borderRadius?: (number | string)[] | number | string
 }
 
-interface SunburstLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
+interface SunburstLabelOption extends Omit<SeriesLabelOption<SunburstDataParams>, 'rotate' | 'position'> {
     rotate?: 'radial' | 'tangential' | number
     minAngle?: number
     silent?: boolean
@@ -77,8 +77,8 @@ export interface SunburstStateOption<TCbParams = never> {
 }
 
 export interface SunburstSeriesNodeItemOption extends
-    SunburstStateOption<CallbackDataParams>,
-    StatesOptionMixin<SunburstStateOption<CallbackDataParams>, SunburstStatesMixin>,
+    SunburstStateOption<SunburstDataParams>,
+    StatesOptionMixin<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin>,
     OptionDataItemObject<OptionDataValue>
 {
     nodeClick?: 'rootToNode' | 'link' | false
@@ -92,8 +92,9 @@ export interface SunburstSeriesNodeItemOption extends
 
     cursor?: string
 }
-export interface SunburstSeriesLevelOption
-    extends SunburstStateOption, StatesOptionMixin<SunburstStateOption, SunburstStatesMixin> {
+export interface SunburstSeriesLevelOption extends
+    SunburstStateOption<SunburstDataParams>,
+    StatesOptionMixin<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin> {
 
     radius?: (number | string)[]
     /**
@@ -118,7 +119,8 @@ interface SortParam {
     getValue(): number
 }
 export interface SunburstSeriesOption extends
-    SeriesOption<SunburstStateOption, SunburstStatesMixin>, SunburstStateOption,
+    SeriesOption<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin>,
+    SunburstStateOption<SunburstDataParams>,
     SunburstColorByMixin,
     CircleLayoutOptionMixin {
 
@@ -142,6 +144,8 @@ export interface SunburstSeriesOption extends
 
     renderLabelForZeroData?: boolean
 
+    data?: SunburstSeriesNodeItemOption[]
+
     levels?: SunburstSeriesLevelOption[]
 
     animationType?: 'expansion' | 'scale'
diff --git a/src/util/types.ts b/src/util/types.ts
index 56c7b6983..533844612 100644
--- a/src/util/types.ts
+++ b/src/util/types.ts
@@ -1064,8 +1064,8 @@ export interface LabelOption extends TextCommonOption {
     rich?: Dictionary<TextCommonOption>
 }
 
-export interface SeriesLabelOption extends LabelOption {
-    formatter?: string | LabelFormatterCallback<CallbackDataParams>
+export interface SeriesLabelOption<T extends CallbackDataParams = CallbackDataParams> extends LabelOption {
+    formatter?: string | LabelFormatterCallback<T>
 }
 
 /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org