Skip to content

Fix NaN positions for shapes when dragging them. #7470

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
merged 9 commits into from
Jul 21, 2025
Prev Previous commit
Next Next commit
Fix formatting for category string
  • Loading branch information
my-tien committed Jul 17, 2025
commit 2f2c4a069f080aac842aa66535af3bb7f347e89c
4 changes: 2 additions & 2 deletions src/components/shapes/draw_newshape/newshapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ function newShapes(outlines, dragOptions) {
case 'circle':

var xaxis = axis_ids.getFromId(gd, beforeEdit.xref);
if (beforeEdit.xref.includes('x') && xaxis.type.includes("category")) {
if (beforeEdit.xref.includes('x') && xaxis.type.includes('category')) {
modifyItem('x0', afterEdit.x0 - (beforeEdit.x0shift || 0));
modifyItem('x1', afterEdit.x1 - (beforeEdit.x1shift || 0));
} else {
modifyItem('x0', afterEdit.x0);
modifyItem('x1', afterEdit.x1);
}
var yaxis = axis_ids.getFromId(gd, beforeEdit.yref);
if (beforeEdit.yref.includes('y') && yaxis.type.includes("category")) {
if (beforeEdit.yref.includes('y') && yaxis.type.includes('category')) {
modifyItem('y0', afterEdit.y0 - (beforeEdit.y0shift || 0));
modifyItem('y1', afterEdit.y1 - (beforeEdit.y1shift || 0));
} else {
Expand Down