Skip to content

Commit

Permalink
Merge pull request #18310 from apache/fix/sunburst-types
Browse files Browse the repository at this point in the history
fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback
  • Loading branch information
plainheart authored Mar 5, 2023
2 parents 0e2954c + a208201 commit 9c743be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/chart/sunburst/SunburstSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)[]
/**
Expand All @@ -118,7 +119,8 @@ interface SortParam {
getValue(): number
}
export interface SunburstSeriesOption extends
SeriesOption<SunburstStateOption, SunburstStatesMixin>, SunburstStateOption,
SeriesOption<SunburstStateOption<SunburstDataParams>, SunburstStatesMixin>,
SunburstStateOption<SunburstDataParams>,
SunburstColorByMixin,
CircleLayoutOptionMixin {

Expand All @@ -142,6 +144,8 @@ export interface SunburstSeriesOption extends

renderLabelForZeroData?: boolean

data?: SunburstSeriesNodeItemOption[]

levels?: SunburstSeriesLevelOption[]

animationType?: 'expansion' | 'scale'
Expand Down
4 changes: 2 additions & 2 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
}

/**
Expand Down

0 comments on commit 9c743be

Please sign in to comment.