Skip to content

Commit ce9977f

Browse files
committed
Fix merge conflicts and build issues after rebase
- Fixed duplicate legendItems declarations in pie charts - Fixed type imports and order issues - Restored proper color handling in PieSemiCircleChart using accessors - All builds passing successfully
1 parent 58771e2 commit ce9977f

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

projects/js-packages/charts/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import clsx from 'clsx';
77
import { useCallback, useMemo } from 'react';
88
import { ChartProvider, useChartId, useChartRegistration } from '../../providers/chart-context';
99
import { useChartTheme } from '../../providers/theme/theme-provider';
10-
import { useChartLegendData } from '../chart-legend/use-chart-legend-data';
1110
import { Legend } from '../legend';
1211
import { useElementHeight } from '../shared/use-element-height';
1312
import { withResponsive } from '../shared/with-responsive';
@@ -94,11 +93,6 @@ const PieSemiCircleChartInternal: FC< PieSemiCircleChartProps > = ( {
9493
const { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =
9594
useTooltip< DataPointPercentage >();
9695

97-
// Create legend items using the reusable hook
98-
const legendItems = useChartLegendData( data, providerTheme, {
99-
showValues: true,
100-
} );
101-
10296
const handleMouseMove = useCallback(
10397
( event: MouseEvent, arc: ArcData ) => {
10498
const coords = localPoint( event );
@@ -142,7 +136,7 @@ const PieSemiCircleChartInternal: FC< PieSemiCircleChartProps > = ( {
142136
[ providerTheme.colors ]
143137
);
144138

145-
// Create legend items (hooks must be called in same order every render)
139+
// Create legend items with color from accessors (which respects item.color)
146140
const legendItems = useMemo(
147141
() =>
148142
data.map( ( item, index ) => ( {

projects/js-packages/charts/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AnnotationStyles } from './components/line-chart/line-chart-annotation';
1+
import type { AnnotationStyles } from './components/line-chart/line-chart-annotation';
22
import type { AxisScale, Orientation, TickFormatter, AxisRendererProps } from '@visx/axis';
33
import type { LegendShape } from '@visx/legend/lib/types';
44
import type { ScaleInput, ScaleType } from '@visx/scale';

0 commit comments

Comments
 (0)