-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
property x0shift, x1shift, y0shift, y1shift for adjusting the shape coordinates #7005
Conversation
Only for shapes with reference to (multi-)category axis
If the passed shift param is undefined, use shift 0 instead.
'the reference unit.' | ||
].join(' ') | ||
}, | ||
|
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.
We should also add these to newselection
and test it.
"y1": 0.5, | ||
"xshift": -0.25, | ||
"yref": "paper" | ||
} |
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.
Is this also working for a path?
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.
No, this should only do something when using x0, x1, y0, y1
Interesting PR for shapes and selections. |
I am wondering if adding a |
Let's ask @alexcjohnson to review 🔎 |
Here is a PR with this suggestion for shapes only: #7010 (I actually only included |
Considering #7010 (comment) discussion, |
Thanks for the simplification. |
@stephprobst Do you have a use case for |
@archmoj No, I don't think this is relevant for other axes. The rationale for this property is to allow exact positioning of a shape based on the axis value. For categorical axes this is needed, because it allows the combination of categorical and numerical values (e.g. country "Canada" plus a shift of 0.5 to position the shape at the end of the categories interval on the axis). On numerical or date axes this isn't really needed, since the user can directly select the precise numerical or date value (e.g. "2023-12-31" to position a shape at the end of year 2023). My proposal would be to skip the implementation for date and numeric axes. |
- removed selection - reversed axis
When |
Please also test |
- Add texttemplate with slope and xcenter to mock
I noticed that I didn't account for the shift for the texttemplate. Fixed that and added a test shape with slope and xcenter. |
Fixed |
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.
Thanks @my-tien for the PR 🥇
💃
This property adjusts the shape coordinates if xref/yref references a (multi-)category axis.
A shape at position x0/x1 = "A"
with x0shift = 0.5
Disclaimer
I am required to add that…the software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.