Skip to content

Commit a159b27

Browse files
committed
call destroyGraphDiv without purge
1 parent c4da393 commit a159b27

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

test/jasmine/tests/parcoords_test.js

+10-18
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ function mostOfDrag(x1, y1, x2, y2) {
5858
mouseEvent('mousemove', x2, y2);
5959
}
6060

61-
function purgeGraphDiv(done) {
62-
var gd = d3Select('.js-plotly-plot').node();
63-
if(gd) Plotly.purge(gd);
64-
destroyGraphDiv();
65-
66-
return delay(50)().then(done);
67-
}
68-
6961
function getAvgPixelByChannel(id) {
7062
var canvas = d3Select(id).node();
7163

@@ -376,7 +368,7 @@ describe('parcoords edge cases', function() {
376368
gd = createGraphDiv();
377369
});
378370

379-
afterEach(purgeGraphDiv);
371+
afterEach(destroyGraphDiv);
380372

381373
it('@gl Works fine with one panel only', function(done) {
382374
var mockCopy = Lib.extendDeep({}, mock2);
@@ -645,7 +637,7 @@ describe('parcoords edge cases', function() {
645637
describe('parcoords Lifecycle methods', function() {
646638
var gd;
647639
beforeEach(function() { gd = createGraphDiv(); });
648-
afterEach(purgeGraphDiv);
640+
afterEach(destroyGraphDiv);
649641

650642
it('Plotly.deleteTraces with one trace removes the plot', function(done) {
651643
var mockCopy = Lib.extendDeep({}, mock);
@@ -915,7 +907,7 @@ describe('parcoords basic use', function() {
915907
gd = createGraphDiv();
916908
});
917909

918-
afterEach(purgeGraphDiv);
910+
afterEach(destroyGraphDiv);
919911

920912
it('@gl should create three WebGL contexts per graph', function(done) {
921913
Plotly.react(gd, mockCopy)
@@ -1223,7 +1215,7 @@ describe('parcoords react more attributes', function() {
12231215
gd = createGraphDiv();
12241216
});
12251217

1226-
afterEach(purgeGraphDiv);
1218+
afterEach(destroyGraphDiv);
12271219

12281220
it('@gl should change various axis parameters', function(done) {
12291221
Plotly.react(gd, mock3)
@@ -1372,15 +1364,15 @@ describe('parcoords constraint interactions - without defined axis ranges', func
13721364
});
13731365

13741366
afterAll(function() {
1375-
purgeGraphDiv();
1367+
destroyGraphDiv();
13761368
PC.bar.snapDuration = initialSnapDuration;
13771369
});
13781370

13791371
beforeEach(function() {
13801372
gd = createGraphDiv();
13811373
});
13821374

1383-
afterEach(purgeGraphDiv);
1375+
afterEach(destroyGraphDiv);
13841376

13851377
function getDashArray(index) {
13861378
var highlight = document.querySelectorAll('.highlight')[index];
@@ -1658,15 +1650,15 @@ describe('parcoords constraint interactions - with defined axis ranges', functio
16581650
});
16591651

16601652
afterAll(function() {
1661-
purgeGraphDiv();
1653+
destroyGraphDiv();
16621654
PC.bar.snapDuration = initialSnapDuration;
16631655
});
16641656

16651657
beforeEach(function() {
16661658
gd = createGraphDiv();
16671659
});
16681660

1669-
afterEach(purgeGraphDiv);
1661+
afterEach(destroyGraphDiv);
16701662

16711663
it('@gl updates constraints above and below axis ranges', function(done) {
16721664
var x = 295;
@@ -1740,15 +1732,15 @@ describe('parcoords constraint click interactions - with pre-defined constraint
17401732
});
17411733

17421734
afterAll(function() {
1743-
purgeGraphDiv();
1735+
destroyGraphDiv();
17441736
PC.bar.snapDuration = initialSnapDuration;
17451737
});
17461738

17471739
beforeEach(function() {
17481740
gd = createGraphDiv();
17491741
});
17501742

1751-
afterEach(purgeGraphDiv);
1743+
afterEach(destroyGraphDiv);
17521744

17531745
it('@gl should not drop constraintrange on click', function(done) {
17541746
Plotly.react(gd, initialFigure())

0 commit comments

Comments
 (0)