Skip to content

Commit

Permalink
Pass getColor instead
Browse files Browse the repository at this point in the history
  • Loading branch information
lemps committed Sep 24, 2024
1 parent 284b547 commit 9a8ecb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/bar/src/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const InnerBar = <RawDatum extends BarDatum>({
toggleSerie,
legendsWithData,
barTotals,
getColor,
} = useBar<RawDatum>({
indexBy,
label,
Expand Down Expand Up @@ -250,8 +251,6 @@ const InnerBar = <RawDatum extends BarDatum>({
() => ({
borderRadius,
borderWidth,
colorBy,
colors,
enableLabel,
isInteractive,
labelSkipWidth,
Expand All @@ -271,8 +270,6 @@ const InnerBar = <RawDatum extends BarDatum>({
[
borderRadius,
borderWidth,
colorBy,
colors,
enableLabel,
getTooltipLabel,
isInteractive,
Expand Down Expand Up @@ -413,6 +410,7 @@ const InnerBar = <RawDatum extends BarDatum>({
onClick,
onMouseEnter,
onMouseLeave,
getColor,
}),
[
commonProps,
Expand All @@ -431,6 +429,7 @@ const InnerBar = <RawDatum extends BarDatum>({
onClick,
onMouseEnter,
onMouseLeave,
getColor,
]
)

Expand Down
3 changes: 3 additions & 0 deletions packages/bar/src/BarCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const InnerBarCanvas = <RawDatum extends BarDatum>({
shouldRenderBarLabel,
legendsWithData,
barTotals,
getColor,
} = useBar<RawDatum>({
indexBy,
label,
Expand Down Expand Up @@ -292,6 +293,7 @@ const InnerBarCanvas = <RawDatum extends BarDatum>({
onClick,
onMouseEnter,
onMouseLeave,
getColor,
}),
[
borderRadius,
Expand All @@ -314,6 +316,7 @@ const InnerBarCanvas = <RawDatum extends BarDatum>({
onClick,
onMouseEnter,
onMouseLeave,
getColor,
]
)

Expand Down
1 change: 1 addition & 0 deletions packages/bar/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ interface BarCustomLayerBaseProps<RawDatum>

xScale: AnyScale
yScale: AnyScale
getColor: OrdinalColorScaleConfig<ComputedDatum<RawDatum>>
}

export interface BarCustomLayerProps<RawDatum>
Expand Down

0 comments on commit 9a8ecb7

Please sign in to comment.