-
Notifications
You must be signed in to change notification settings - Fork 56
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
Conversation
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-arc-label-node.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-default-settings.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-node-builder.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-arc-label-node.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-arc-node.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/axis-arc-tick-node.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
packages/picasso.js/src/core/chart-components/axis/__tests__/axis-arc-label-node.spec.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/__tests__/axis-arc-tick-node.spec.js
Outdated
Show resolved
Hide resolved
packages/picasso.js/src/core/chart-components/axis/__tests__/axis-arc-label-node.spec.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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:
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)
}