Skip to content

Commit 13e3cc1

Browse files
committed
WIP draw_newshape_test
1 parent 2f2c4a0 commit 13e3cc1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/jasmine/tests/draw_newshape_test.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,43 @@ describe('Activate and edit editable shapes', function() {
14261426

14271427
.then(done, done.fail);
14281428
});
1429+
1430+
it('should be possible to drag shapes referencing non-categorical axes', function(done) {
1431+
Plotly.newPlot(gd, {
1432+
data: [
1433+
{
1434+
x: ["2015-02-01", "2015-02-02", "2015-02-03"],
1435+
y: [14, 17, 8],
1436+
mode: "line",
1437+
},
1438+
],
1439+
layout: {
1440+
xaxis: { title: { text: "Date" }, type: "date" },
1441+
dragmode: "drawline",
1442+
shapes: [
1443+
{
1444+
type: "rect",
1445+
xref: "x",
1446+
yref: "paper",
1447+
x0: "2015-02-02",
1448+
y0: 0,
1449+
x1: "2015-02-08",
1450+
y1: 1,
1451+
opacity: 0.2,
1452+
editable: true,
1453+
},
1454+
],
1455+
},
1456+
})
1457+
.then(function() { drag([[257.64, 370], [250, 300]]); }) // move lower left corner up and left
1458+
.then(function () {
1459+
var shapes = gd._fullLayout.shapes;
1460+
var obj = shapes[0]._input;
1461+
print(obj);
1462+
assertPos(obj.path, 'M250,300H1019V100H257.64Z');
1463+
})
1464+
.then(done, done.fail);
1465+
});
14291466
});
14301467
});
14311468

0 commit comments

Comments
 (0)