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: added curved feature to axis component #883

Merged
merged 20 commits into from
Nov 19, 2024
Merged

feat: added curved feature to axis component #883

merged 20 commits into from
Nov 19, 2024

Conversation

Moranski25
Copy link
Collaborator

@Moranski25 Moranski25 commented Nov 4, 2024

Added feature to the axis component. The feature creates a curved axis with ticks and labels if the "isRadial"-property is set to true. The axis-properties that are new are listed below.
arc:{
isRadial: boolean, (if not set defaults to false. Set to true for curved axis)
radius: number, (if not set, defaults to 0.5)
startAngle: number, (if not set, defaults to -pi/2)
endAngle: number, (if not set, defaults to pi/2)
}

Skärmavbild 2024-11-06 kl  12 39 29
Skärmavbild 2024-11-04 kl  13 56 44
Skärmavbild 2024-11-04 kl  13 58 03

@Moranski25 Moranski25 changed the title Arc axis feat: added curved feature to axis component Nov 5, 2024
@veinfors veinfors marked this pull request as ready for review November 5, 2024 12:30
@bao-ho
Copy link
Collaborator

bao-ho commented Nov 12, 2024

It seems that the space calculations for tick labels are stricter than it should be. Look at 80,000,000.00 for example.

image

It seems that this is due to they way you select ticks in your other PR. So it's fine here.

@bao-ho
Copy link
Collaborator

bao-ho commented Nov 12, 2024

There seems to be a bug here that the 50,000,000.00 tick is smaller than the value (46,258,458.11)

image

But I think it's not caused by this PR (what's wrong is the position of the gauge indicator (the white line) but not the tick itself)

Copy link
Collaborator

@bao-ho bao-ho left a comment

Choose a reason for hiding this comment

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

Great work! 🎉

junit.xml Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this file is necessary. Probably add it to git ignore.

expect(result.anchor).to.equal('end');
});

it('start on left side of tick', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

two tests should not have the same name (this and the one above it)

expect(result.anchor).to.equal('end');
});

it('start on right side of tick', () => {
Copy link
Collaborator

@bao-ho bao-ho Nov 14, 2024

Choose a reason for hiding this comment

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

fix the expectation (make it more descriptive like the test below this)

it('Structure Properties', () => {
const rect = buildOpts.innerRect;
const centerPoint = { cx: rect.width / 2, cy: rect.height / 2 };
const plotSize = Math.min(rect.height, rect.width) / 2;
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix name (probably fix in the main code as well), it should be halfPlotSize instead of plotSize

@Moranski25 Moranski25 requested a review from quanho November 18, 2024 12:25
Copy link
Collaborator Author

@Moranski25 Moranski25 left a comment

Choose a reason for hiding this comment

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

Feature that checks if a labels is out of bounds in y-direction.
Before:

Skarminspelning.2024-11-18.kl.13.41.22.mov

After:

Skarminspelning.2024-11-18.kl.13.36.39.mov

@Moranski25 Moranski25 merged commit 78d825b into master Nov 19, 2024
10 of 12 checks passed
@Moranski25 Moranski25 deleted the arc-axis branch November 19, 2024 08:07
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