|
11 | 11 | var d3 = require('d3'); |
12 | 12 | var Lib = require('../../lib'); |
13 | 13 | var Drawing = require('../../components/drawing'); |
| 14 | +var BADNUM = require('../../constants/numerical').BADNUM; |
14 | 15 | var barPlot = require('../bar/plot'); |
15 | 16 | var clearMinTextSize = require('../bar/uniform_text').clearMinTextSize; |
16 | 17 |
|
@@ -66,31 +67,36 @@ function plotConnectors(gd, plotinfo, cdModule, traceLayer) { |
66 | 67 |
|
67 | 68 | var shape = ''; |
68 | 69 |
|
69 | | - if(mode === 'spanning') { |
70 | | - if(!di.isSum && i > 0) { |
71 | | - if(isHorizontal) { |
72 | | - shape += 'M' + x[0] + ',' + y[1] + 'V' + y[0]; |
73 | | - } else { |
74 | | - shape += 'M' + x[1] + ',' + y[0] + 'H' + x[0]; |
| 70 | + if( |
| 71 | + x[0] !== BADNUM && y[0] !== BADNUM && |
| 72 | + x[1] !== BADNUM && y[1] !== BADNUM |
| 73 | + ) { |
| 74 | + if(mode === 'spanning') { |
| 75 | + if(!di.isSum && i > 0) { |
| 76 | + if(isHorizontal) { |
| 77 | + shape += 'M' + x[0] + ',' + y[1] + 'V' + y[0]; |
| 78 | + } else { |
| 79 | + shape += 'M' + x[1] + ',' + y[0] + 'H' + x[0]; |
| 80 | + } |
75 | 81 | } |
76 | 82 | } |
77 | | - } |
78 | 83 |
|
79 | | - if(mode !== 'between') { |
80 | | - if(di.isSum || i < len - 1) { |
81 | | - if(isHorizontal) { |
82 | | - shape += 'M' + x[1] + ',' + y[0] + 'V' + y[1]; |
83 | | - } else { |
84 | | - shape += 'M' + x[0] + ',' + y[1] + 'H' + x[1]; |
| 84 | + if(mode !== 'between') { |
| 85 | + if(di.isSum || i < len - 1) { |
| 86 | + if(isHorizontal) { |
| 87 | + shape += 'M' + x[1] + ',' + y[0] + 'V' + y[1]; |
| 88 | + } else { |
| 89 | + shape += 'M' + x[0] + ',' + y[1] + 'H' + x[1]; |
| 90 | + } |
85 | 91 | } |
86 | 92 | } |
87 | | - } |
88 | 93 |
|
89 | | - if(x[2] !== undefined && y[2] !== undefined) { |
90 | | - if(isHorizontal) { |
91 | | - shape += 'M' + x[1] + ',' + y[1] + 'V' + y[2]; |
92 | | - } else { |
93 | | - shape += 'M' + x[1] + ',' + y[1] + 'H' + x[2]; |
| 94 | + if(x[2] !== BADNUM && y[2] !== BADNUM) { |
| 95 | + if(isHorizontal) { |
| 96 | + shape += 'M' + x[1] + ',' + y[1] + 'V' + y[2]; |
| 97 | + } else { |
| 98 | + shape += 'M' + x[1] + ',' + y[1] + 'H' + x[2]; |
| 99 | + } |
94 | 100 | } |
95 | 101 | } |
96 | 102 |
|
|
0 commit comments