Skip to content

Commit

Permalink
chore(sunburst): rename slice label props for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze authored and plouc committed Dec 2, 2020
1 parent 77fcc21 commit 6717e5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions packages/sunburst/src/Sunburst.tsx
Expand Up @@ -37,10 +37,10 @@ export const Sunburst = <Datum extends Record<string, unknown>>(props: SunburstS
borderColor,

// slices labels
enableSlicesLabels,
enableSliceLabels,
sliceLabel,
slicesLabelsSkipAngle,
slicesLabelsTextColor,
sliceLabelsSkipAngle,
sliceLabelsTextColor,

// theming
theme: _theme,
Expand Down Expand Up @@ -136,12 +136,12 @@ export const Sunburst = <Datum extends Record<string, unknown>>(props: SunburstS
onMouseLeave={onMouseLeave}
/>
))}
{enableSlicesLabels && (
{enableSliceLabels && (
<SunburstLabels
nodes={nodes}
label={getSliceLabel}
skipAngle={slicesLabelsSkipAngle}
textColor={slicesLabelsTextColor}
skipAngle={sliceLabelsSkipAngle}
textColor={sliceLabelsTextColor}
/>
)}
</g>
Expand Down
4 changes: 2 additions & 2 deletions packages/sunburst/src/props.ts
Expand Up @@ -14,9 +14,9 @@ export const defaultProps = {
role: 'img',

// slices labels
enableSlicesLabels: false,
enableSliceLabels: false,
sliceLabel: 'value',
slicesLabelsTextColor: { theme: 'labels.text.fill' },
sliceLabelsTextColor: { theme: 'labels.text.fill' },

isInteractive: true,
}
9 changes: 4 additions & 5 deletions packages/sunburst/src/types.ts
Expand Up @@ -60,11 +60,10 @@ type CommonSunburstProps = {
childColor: InheritedColorConfig<SunburstNode['data']>

// slices labels
enableSlicesLabels: boolean
enableSliceLabels: boolean
sliceLabel: string | ((node: ComputedNode['data']) => string)

slicesLabelsSkipAngle: number
slicesLabelsTextColor: InheritedColorConfig<SunburstNode['data']>
sliceLabelsSkipAngle: number
sliceLabelsTextColor: InheritedColorConfig<SunburstNode['data']>

role: string

Expand Down Expand Up @@ -137,5 +136,5 @@ export type SunburstArcProps = Pick<
export type SunburstLabelProps = Pick<ComputedSunburstProps, 'nodes'> & {
label: ComputedSunburstProps['getSliceLabel']
skipAngle?: number
textColor: CommonSunburstProps['slicesLabelsTextColor']
textColor: CommonSunburstProps['sliceLabelsTextColor']
}

0 comments on commit 6717e5b

Please sign in to comment.