Skip to content

chore(chart bullet): convert to typescript #11756

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

Merged

Conversation

Mash707
Copy link
Contributor

@Mash707 Mash707 commented Apr 11, 2025

Towards #11719

The following examples of ChartArea will be converted to TypeScript:

  • Basic
  • Segmented primary measure
  • Responsive container with bottom aligned legend
  • Primary measure dot
  • Error measure and custom axis ticks
  • Primary measure outside range
  • Negative primary measure
  • Reversed with right aligned legend
  • Negative and positive primary measures

Remaining examples are converted in #11758 to make it easier for reviewing

@Mash707
Copy link
Contributor Author

Mash707 commented Apr 11, 2025

@thatblindgeye since there are 17 examples, this PR will be big. Let me know if you want me to break it down into 2 PRs. Although the changes made will be simple.

@Mash707 Mash707 mentioned this pull request Mar 30, 2025
17 tasks
@patternfly-build
Copy link
Contributor

patternfly-build commented Apr 11, 2025

@thatblindgeye
Copy link
Contributor

@Mash707 let's try splitting it into 2 PRs and see how it looks. Even though it should be pretty straight forward conversions, it'll end up being a lot of lines touched so splitting it may make it a tad easier to review.

@Mash707
Copy link
Contributor Author

Mash707 commented Apr 11, 2025

@thatblindgeye I have included 9 examples in this PR, for the remaining I'll create a new PR and link it to this one.
While reviewing please do check file names and let me know of any changes required. Thank You

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Just some nits for file names/exports below, let me know what you think

```

### Primary measure outside range

This is a yellow bullet chart with primary measure greater than max range.

```js
import { ChartBullet, ChartThemeColor } from '@patternfly/react-charts/victory';
```ts file = "ChartBulletPrimaryRange.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This file could maybe be "ChartBulletOutsideRange" instead

```

### Negative primary measure

This bullet chart with negative primary measure is for measures considered to be bad when they are low.

```js
import { ChartBullet } from '@patternfly/react-charts/victory';
```ts file = "ChartBulletNegativePrimary.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: maybe "ChartBulletNegativeMeasure"

```

### Reversed with right aligned legend

This reversed bullet chart with right aligned legend is for measures considered to be good when they are low.

```js
import { ChartBullet } from '@patternfly/react-charts/victory';
```ts file = "ChartBulletReversedLegend.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: we could drop the "Legend" in the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good observation, since we don't any examples starting with "Reversed" dropping "Legend" makes it shorter

```

### Negative and positive primary measures

This bullet chart with negative and positive primary measures has 4 legend items per row.

```js
import { ChartBullet } from '@patternfly/react-charts/victory';
```ts file = "ChartBulletNegativePositivePrimary.tsx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```ts file = "ChartBulletNegativePositivePrimary.tsx"
```ts file = "ChartBulletNegativePositiveMeasure.tsx"

Copy link
Contributor Author

@Mash707 Mash707 Apr 14, 2025

Choose a reason for hiding this comment

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

Was confused with the usage of "Primary" but looking at it now "Measure" makes more sense, aligns more with the example description

@Mash707
Copy link
Contributor Author

Mash707 commented Apr 14, 2025

The suggestions look good to me, made the necessary changes.

@Mash707 Mash707 requested a review from thatblindgeye April 14, 2025 17:01
@nicolethoen nicolethoen merged commit 7d676cf into patternfly:main Apr 21, 2025
13 checks passed
@Mash707 Mash707 deleted the convert-chart-bullet-to-typescript branch April 21, 2025 17:04
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.

4 participants