Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pie chart #191

Merged
merged 15 commits into from
Mar 20, 2024
Merged

feat: pie chart #191

merged 15 commits into from
Mar 20, 2024

Conversation

zibs
Copy link
Contributor

@zibs zibs commented Feb 6, 2024

Description

This is a v1 pie chart implementation that renders pie charts, without labels and without gestures.

It sort of only has one option beyond the pie chart, which is to render an inset inside the chart, which is like a border of each slice.

No docs yet either, beside the example page, which only renders in dev mode currently.

Simulator Screenshot - iPhone 15 Pro - 2024-02-06 at 13 48 28

Fixes # (issue)

#141

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist: (Feel free to delete this section upon completion)

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run yarn run check:code and all checks pass
  • I have created a changeset for new features, patches, or major changes
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Feb 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
victory-native-xl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2024 8:12pm

Copy link

changeset-bot bot commented Feb 8, 2024

🦋 Changeset detected

Latest commit: 73017da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
victory-native Minor
example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@keithluchtel keithluchtel left a comment

Choose a reason for hiding this comment

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

This is look great 🔥 . Still reviewing and playing around with it, but some initial thoughts on the API

example/app/donut-chart.tsx Outdated Show resolved Hide resolved
example/app/donut-chart.tsx Outdated Show resolved Hide resolved
example/app/pie-and-donut-charts.tsx Outdated Show resolved Hide resolved
@@ -0,0 +1,6 @@
---
"victory-native": minor
"example": patch
Copy link
Member

Choose a reason for hiding this comment

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

do we want the example app in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seemed like it automatically got included when I generated the changeset.

This is a v1 pie chart implementation that renders pie charts, without labels and without gestures.

It sort of only has one option beyond the pie chart, which is to render an inset inside the chart, which is like a border of each slice.

No docs yet either, beside the example page, which only renders in dev mode currently.
- adds pie chart legend support
- adds contexts to consume slices/set legend position, and probably more later.
- readjusts exports/implementation
- adds label, but not exported yet (wip)
fixes some clipping that was happening since the canvas is a bit tight
This adds an `innerRadius` prop that allows the Pie chart to function as a donut chart.
adds pie and donut chart example screen that covers a few edge cases/examples to ensure things are working
- removes need to import provider for rendering slices
- removes need to pass data prop to legend
- adds data to pie chart context so legend can consume it
- make render props optional and render defaults unless otherwise passed in
- updates examples
type becomes:
```
type PieSliceAngularInsetData = {
  angularStrokeWidth: number;
  angularStrokeColor: Color;
};

```
follows same pattern as the `Pie.ChartSlice` component where we just wrap the children with the slice provider.
- adds parent Polar component as Pie chart coordinate system container.
- updates docs
- removes legends/legend items for now
@zibs zibs merged commit b64642e into main Mar 20, 2024
3 checks passed
@zibs zibs deleted the feat/pie-chart branch March 20, 2024 20:16
@github-actions github-actions bot mentioned this pull request Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants