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

Defining a RectAnnotation as outside has not affect #2470

Closed
nickofthyme opened this issue Jun 21, 2024 · 0 comments · Fixed by #2471
Closed

Defining a RectAnnotation as outside has not affect #2470

nickofthyme opened this issue Jun 21, 2024 · 0 comments · Fixed by #2471
Assignees
Labels
:annotation Annotation (line, rect, text) related issue bug Something isn't working

Comments

@nickofthyme
Copy link
Collaborator

Describe the issue
If a RectAnnotation is defined without using a groupId the outside prop has no affect.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/p/sandbox/quizzical-saha-s8k5p2?file=%2Fsrc%2FApp.tsx%3A38%2C28
  2. Comment/uncomment the groupId on the RectAnnotation spec
  3. Notice the annotation is not rendered as outside annotation when groupId is missing

Expected behaviour
The RectAnnotation is always rendered on the outside of the chart when the outside prop is set to true.

Screenshots
image

Version (please complete the following information):
I think this issue is original to the outside feature added in #1207

Additional context
The code has a break branch from #842 to render annotations when we have no yScale.

This is the path taken when a groupId is applied. But when a yScale is defined, it renders the outside only if x0 and x1 where initially undefined, this is the problem!

...(!isDefined(initialX0) && !isDefined(initialX1) && outside
? {
x: isLeftSide ? -outsideDim : orthoDimension,
width: outsideDim,
}
: xAndWidth),

@nickofthyme nickofthyme added bug Something isn't working :annotation Annotation (line, rect, text) related issue labels Jun 21, 2024
@nickofthyme nickofthyme self-assigned this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:annotation Annotation (line, rect, text) related issue bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant