Skip to content

Conversation

@hcopp
Copy link
Contributor

@hcopp hcopp commented Dec 8, 2025

What changed? Why?

This PR implements polar charts on web and mobile - supporting a generic PolarChart (equivalent of CartesianChart) and PieChart/DonutChart (similar to AreaChart/LineChart).

Differences between polar and cartesian

  • Polar uses radius and angle instead of x and y
  • Polar doesn't support scrubbing - web has some limited support for clicking and mouse events for slices
    • Polar will support legend on both platforms and tooltip on web
  • Pie/Donut only works on polar and Bar/Line/Area only work on cartesian (although future work could be done to support line, area, and bar in polar setting
  • ChartText works on both
  • Point, XAxis, YAxis, and ReferenceLine only works on Cartesian charts

Once this PR is ready, we will be reviewing chart tooltip and legend which is built on this work.

UI changes

Web

image image image

Mobile

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@hcopp hcopp self-assigned this Dec 8, 2025
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Dec 8, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

export type AngularAxisConfigProps = PolarAxisConfigProps & {
/**
* Padding angle between slices in degrees.
* @default 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: drop this

);
}

export default ExampleNavigator;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have better polar chart examples on docs and storybook by the end of all these PRs (since we will have all the features available)


// Set default min domain to 0 for area chart, but only if there are no negative values
const yAxisConfig: Partial<AxisConfigProps> = {
const yAxisConfig: Partial<CartesianAxisConfigProps> = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our initial estimates had a few props we hoped would be shared but now need to be Cartesian specific

animate?: boolean;
};

export type ArcProps = ArcBaseProps;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is quite similar to Bar.tsx

{content}
</Group>
);
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great if we can get this working with Path.tsx however this would require us supporting custom path interpreters.

Arc animates by animating both the start and end degrees from a baseline (usually 0 degrees) to their end degree values (lets say 25 and 30). In this time, they are rotating, not a direct linear shift. This is similar to Bar's animation where it keeps track of start and end from a baseline to their end values, however that is a linear shift where the values only move in one direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be a follow up but before we exit beta.

fontFamilies: contextFontFamilies,
fontProvider,
} = useCartesianChartContext();
} = useChartContext();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to use chart text with polar charts

},
{
key: 'AlphaTabbedChips',
key: "AlphaSelectChip",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting errors about duplicate story names, so I renamed SelectChip for alpha stories to AlphaSelectChip

{
series,
children,
innerRadiusRatio = 0.5,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DonutChart is a wrapper of pie with a simple innerRadiusRatio.

In case this is helpful, I am placing files at the root of chart when they are by themselves, and in a folder when there are multiple with the same root name.

An alternative way to do this would be to have a polar folder and have the files all in there. But then we'd likely want to move the cartesian components as well

);
},
),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equivalent to CartesianChart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants