|
982 | 982 | node.connectionCount = subRels.length;
|
983 | 983 | base.maxConnections = Math.max( base.maxConnections, node.connectionCount );
|
984 | 984 | }
|
985 |
| - node.connectionCount = base.relations.length; |
986 |
| - base.maxConnections = Math.max( base.maxConnections, node.connectionCount ); |
| 985 | + if (n > 0) { |
| 986 | + node.connectionCount = base.relations.length; |
| 987 | + base.maxConnections = Math.max( base.maxConnections, node.connectionCount ); |
| 988 | + } |
987 | 989 | }
|
988 | 990 | break;
|
989 | 991 |
|
|
1492 | 1494 |
|
1493 | 1495 | base.parentIdForHierarchyNode = function(d) {
|
1494 | 1496 | var parentId;
|
1495 |
| - if (d.parent.node == null) { |
1496 |
| - parentId = d.parent.title; |
1497 |
| - } else { |
1498 |
| - parentId = d.parent.node.slug; |
| 1497 | + if (d.parent != null) { |
| 1498 | + if (d.parent.node == null) { |
| 1499 | + parentId = d.parent.title; |
| 1500 | + } else { |
| 1501 | + parentId = d.parent.node.slug; |
| 1502 | + } |
1499 | 1503 | }
|
1500 | 1504 | return parentId;
|
1501 | 1505 | }
|
|
2145 | 2149 | if (base.isHierarchyNodeMaximized(d)) {
|
2146 | 2150 | d._children = d.children;
|
2147 | 2151 | d.children = null;
|
2148 |
| - var index = d.node.parentsOfMaximizedInstances.indexOf(parentId); |
2149 |
| - if (index != -1) { |
2150 |
| - d.node.parentsOfMaximizedInstances.splice(index, 1); |
| 2152 | + if (d.node != null) { |
| 2153 | + var index = d.node.parentsOfMaximizedInstances.indexOf(parentId); |
| 2154 | + if (index != -1) { |
| 2155 | + d.node.parentsOfMaximizedInstances.splice(index, 1); |
| 2156 | + } |
2151 | 2157 | }
|
2152 | 2158 | } else {
|
2153 | 2159 | d.children = d._children;
|
2154 | 2160 | d._children = null;
|
2155 |
| - if (d.node.parentsOfMaximizedInstances.indexOf(parentId) == -1) { |
2156 |
| - d.node.parentsOfMaximizedInstances.push(parentId); |
| 2161 | + if (d.node != null) { |
| 2162 | + if (d.node.parentsOfMaximizedInstances.indexOf(parentId) == -1) { |
| 2163 | + d.node.parentsOfMaximizedInstances.push(parentId); |
| 2164 | + } |
2157 | 2165 | }
|
2158 | 2166 | }
|
2159 | 2167 | }
|
|
2184 | 2192 | if ( base.options.content != "all" ) {
|
2185 | 2193 | if ( base.hierarchy.children ) {
|
2186 | 2194 | base.hierarchy.children.forEach( function( d ) {
|
2187 |
| - d.children.forEach( branchConformAll ); |
| 2195 | + if (d.children != null) { |
| 2196 | + d.children.forEach( branchConformAll ); |
| 2197 | + } |
2188 | 2198 | });
|
2189 | 2199 | }
|
2190 | 2200 |
|
|
0 commit comments