Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b984ff

Browse files
committed
added connector restyle visible true false
1 parent c53bcce commit 3b984ff

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/jasmine/tests/waterfall_test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,38 @@ describe('A waterfall plot', function() {
993993
.then(done);
994994
});
995995

996+
it('should be able to add/remove connector nodes on restyle', function(done) {
997+
function _assertNumberOfWaterfallConnectorNodes(cnt) {
998+
var sel = d3.select(gd).select('.waterfalllayer').selectAll('.line');
999+
expect(sel.size()).toBe(cnt);
1000+
}
1001+
1002+
Plotly.plot(gd, [{
1003+
type: 'waterfall',
1004+
x: ['Initial', 'A', 'B', 'C', 'Total'],
1005+
y: [10, 2, 3, 5],
1006+
measure: ['absolute', 'relative', 'relative', 'relative', 'total'],
1007+
connector: { visible: false }
1008+
}])
1009+
.then(function() {
1010+
_assertNumberOfWaterfallConnectorNodes(0);
1011+
return Plotly.restyle(gd, 'connector.visible', true);
1012+
})
1013+
.then(function() {
1014+
_assertNumberOfWaterfallConnectorNodes(4);
1015+
return Plotly.restyle(gd, 'connector.visible', false);
1016+
})
1017+
.then(function() {
1018+
_assertNumberOfWaterfallConnectorNodes(0);
1019+
return Plotly.restyle(gd, 'connector.visible', true);
1020+
})
1021+
.then(function() {
1022+
_assertNumberOfWaterfallConnectorNodes(4);
1023+
})
1024+
.catch(failTest)
1025+
.then(done);
1026+
});
1027+
9961028
it('should coerce text-related attributes', function(done) {
9971029
var data = [{
9981030
y: [10, 20, 30, 40],

0 commit comments

Comments
 (0)