Skip to content

Commit

Permalink
Reorganize layers
Browse files Browse the repository at this point in the history
  • Loading branch information
aautem committed Jun 20, 2023
1 parent 6c55073 commit a60805d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/pie/src/Pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,32 +122,12 @@ const InnerPie = <RawDatum extends MayHaveLabel>({
const boundDefs = bindDefs(defs, dataWithArc, fill)

const layerById: Record<PieLayerId, ReactNode> = {
arcLinkLabels: null,
arcs: null,
arcLinkLabels: null,
arcLabels: null,
legends: null,
}

if (enableArcLinkLabels && layers.includes('arcLinkLabels')) {
layerById.arcLinkLabels = (
<ArcLinkLabelsLayer<ComputedDatum<RawDatum>>
key="arcLinkLabels"
center={[centerX, centerY]}
data={dataWithArc}
label={arcLinkLabel}
skipAngle={arcLinkLabelsSkipAngle}
offset={arcLinkLabelsOffset}
diagonalLength={arcLinkLabelsDiagonalLength}
straightLength={arcLinkLabelsStraightLength}
strokeWidth={arcLinkLabelsThickness}
textOffset={arcLinkLabelsTextOffset}
textColor={arcLinkLabelsTextColor}
linkColor={arcLinkLabelsColor}
component={arcLinkLabelComponent}
/>
)
}

if (layers.includes('arcs')) {
layerById.arcs = (
<Arcs<RawDatum>
Expand All @@ -169,6 +149,26 @@ const InnerPie = <RawDatum extends MayHaveLabel>({
)
}

if (enableArcLinkLabels && layers.includes('arcLinkLabels')) {
layerById.arcLinkLabels = (
<ArcLinkLabelsLayer<ComputedDatum<RawDatum>>
key="arcLinkLabels"
center={[centerX, centerY]}
data={dataWithArc}
label={arcLinkLabel}
skipAngle={arcLinkLabelsSkipAngle}
offset={arcLinkLabelsOffset}
diagonalLength={arcLinkLabelsDiagonalLength}
straightLength={arcLinkLabelsStraightLength}
strokeWidth={arcLinkLabelsThickness}
textOffset={arcLinkLabelsTextOffset}
textColor={arcLinkLabelsTextColor}
linkColor={arcLinkLabelsColor}
component={arcLinkLabelComponent}
/>
)
}

if (enableArcLabels && layers.includes('arcLabels')) {
layerById.arcLabels = (
<ArcLabelsLayer<ComputedDatum<RawDatum>>
Expand Down

0 comments on commit a60805d

Please sign in to comment.