all files / renderer/ connector-line.js

96.55% Statements 532/551
86.72% Branches 640/738
100% Functions 25/25
96.55% Lines 532/551
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923   1213× 1213× 1213× 1213× 1213× 1213× 1213×       1213×             1213× 1213× 1213×     1213× 1213×   17334× 17334×     17334×   1219× 1219× 1219×   13340×       31694× 31694× 31694×     194×     31500×     31694× 31694× 31694×     194× 4206×   194× 4206×   194× 194×     31500× 31500×   31694× 31694× 31694× 31694×     194×       31500×     31694× 31694× 31694× 31694×   3029×     28665×   28665×   28665×   28665×   28665× 28665× 28665×     28665× 28665× 28665× 28665× 28665× 28665× 28665× 28665× 28665× 30×     28635×       2295× 2295× 2295× 11729× 11729×   2295× 2295× 2295× 11729× 11729× 23458× 23458× 23458×     2295× 2295× 2295× 11729×     255412× 246909× 3280× 2220×     1060×     243629× 68400× 67380×   1020× 600×   420× 420×     175229×   75960× 2020× 820×     75140× 3900× 900×   3000× 1060×     73180× 68420×   4760× 4560×   200× 200×     99269× 99260× 98880×   380× 180×   200× 200×       8503× 8500× 2320× 1840×   220×     1620×     480× 480× 160×   320× 160×   160× 160×       6180×   4920× 3340× 520×   2820× 460× 220×     240×     2360× 1580× 1580×             1580× 1580× 60×   1520×     1520× 180× 40×     140×       2120× 2120×     1260× 1260× 1240×   20× 20×                   12×   12774× 74×         12700×         12774× 362×   12412×   12774× 362×   12412×   12774× 4011×   8763× 362×   8401× 8398×     12770× 12770× 12770×   10952×               1818× 1818× 1818× 1818× 1818×             1817×             12774× 12774× 12774× 12774× 12774× 12774× 12774× 12774× 12774× 12774× 12774× 12774× 1552× 1552×     12774× 12774× 12774× 12774× 12774× 12774× 12774× 74× 1204× 1018× 302× 302×       74× 74× 1204× 1018× 338× 338×       74× 74×     12774×   12697× 12697× 12697× 12697× 12697× 12697×     12692×   12697×                                                                         12774× 12770× 12770× 12770× 12770× 12770× 12770×           12770×           12770×       12770× 12770× 12770× 12770× 12770× 12770× 3369× 3369× 3369×     3369×       3369× 3369×   3369×       12770× 8365× 8365× 8365× 8365× 8365×       8365× 8365× 8365×   8365×   8365×       12770× 179× 179×       179× 179× 179×     179×   179× 179× 179×   179×       12770× 81×     81× 81× 81× 81× 81×     81×   81×       12770× 16× 16× 16× 16×     16× 16× 16× 16×   16×   16×       12770× 81× 81× 81× 81×     81× 81×   81×   81×       12770× 258× 258× 258× 258× 258× 258×     258× 258×   258×       12770× 45× 45× 45× 45× 45×     45× 45×   45×       12770× 53× 53× 53× 53× 53× 53× 53×     53× 53×   53×       12770× 111× 111× 111× 111× 111× 111×       111× 111× 111×   111×       12770× 26× 26× 26× 26× 26× 26× 26×     26×   26×   26×       12770× 11× 11× 11× 11× 11× 11×     11×     11× 11×   11×       12770× 20× 20× 20× 20×     20× 20× 20× 20× 20×   20× 20× 20× 20×   20×       12770× 11× 11× 11× 11×     11× 11× 11× 11× 11×     11×   11×       12770× 103× 103× 103× 103× 103× 103×       103× 103× 103× 103× 103× 103×   103×       12770× 41× 41× 41× 41×       41× 41× 41×   41×       12770× 12770×   12774×   25548× 25548× 25548× 380× 380× 380× 380× 380× 380× 380× 380× 30× 30×     350×         342× 10× 10×       332× 332× 332×         25548×   1219× 1219× 1219× 1219×   15× 15× 15× 15× 15×   23458× 23458× 23458× 23458× 23458× 23458× 23458× 23458× 22170×   1288× 306×   982× 714×     268×   23458×   284969×     284969×     388× 8412×   388×     284581×       485× 485× 277×     208×   485× 485× 485× 8684× 8684× 5328× 5328×     3356×   8684× 8684× 2269× 4115× 4115×         8193× 8193× 2275×          
define(["require", "exports", "@syncfusion/ej2-base", "../base/css-constants", "../base/utils", "@syncfusion/ej2-svg-base"], function (require, exports, ej2_base_1, cls, utils_1, ej2_svg_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ConnectorLine = (function () {
        function ConnectorLine(ganttObj) {
            this.transform = '';
            this.connectorLinePath = '';
            this.arrowPath = '';
            this.taskLineValue = 0;
            this.expandedRecords = [];
            this.parent = ganttObj;
            this.dependencyViewContainer =
                ej2_base_1.createElement('div', {
                    className: cls.dependencyViewContainer
                });
            Object.assign(this.dependencyViewContainer.style, {
                width: '100%',
                height: '100%',
                zIndex: 2,
                position: 'absolute',
                pointerEvents: 'none'
            });
            this.renderer = new ej2_svg_base_1.SvgRenderer(this.parent.element.id);
            this.initPublicProp();
            this.svgObject = this.renderer.createSvg({
                id: this.parent.element.id + '_svg'
            });
            this.svgObject.setAttribute('height', '100%');
            this.svgObject.setAttribute('width', '100%');
        }
        ConnectorLine.prototype.getconnectorLineGap = function (data) {
            var width = 0;
            width = (data.milestoneChild ?
                ((this.parent.chartRowsModule.milestoneMarginTop / 2) + (this.parent.chartRowsModule.milestoneHeight / 2)) :
                ((this.parent.chartRowsModule.taskBarMarginTop / 2) + (this.parent.chartRowsModule.taskBarHeight / 2)));
            return width;
        };
        ConnectorLine.prototype.initPublicProp = function () {
            this.lineColor = this.parent.connectorLineBackground;
            this.lineStroke = (this.parent.connectorLineWidth) > 4 ? 4 : this.parent.connectorLineWidth;
            this.createConnectorLineTooltipTable();
        };
        ConnectorLine.prototype.getTaskbarMidpoint = function (isMilestone) {
            return Math.floor(isMilestone ?
                (this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2)) :
                (this.parent.chartRowsModule.taskBarMarginTop + (this.parent.chartRowsModule.taskBarHeight / 2))) + 1;
        };
        ConnectorLine.prototype.createConnectorLineObject = function (parentGanttData, childGanttData, predecessor) {
            var connectorObj = {};
            var updatedRecords;
            if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
                updatedRecords = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'];
            }
            else {
                updatedRecords = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
                    this.parent.flatData : this.expandedRecords;
            }
            var parentIndex;
            var childIndex;
            if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
                var parentData = this.parent.flatData.filter(function (data) {
                    return data.ganttProperties.taskId.toString() === parentGanttData.ganttProperties.taskId.toString();
                })[0];
                var childData = this.parent.flatData.filter(function (data) {
                    return data.ganttProperties.taskId.toString() === childGanttData.ganttProperties.taskId.toString();
                })[0];
                parentIndex = parentData.index;
                childIndex = childData.index;
            }
            else {
                parentIndex = updatedRecords.indexOf(parentGanttData);
                childIndex = updatedRecords.indexOf(childGanttData);
            }
            var parentGanttRecord = parentGanttData.ganttProperties;
            var childGanttRecord = childGanttData.ganttProperties;
            var currentData;
            if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
                currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
                    this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
            }
            else {
                currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
                    this.parent.currentViewData : this.parent.expandedRecords;
            }
            connectorObj.parentIndexInCurrentView = currentData.indexOf(parentGanttData);
            connectorObj.childIndexInCurrentView = currentData.indexOf(childGanttData);
            var isVirtualScroll = this.parent.virtualScrollModule && this.parent.enableVirtualization;
            if ((!isVirtualScroll && (connectorObj.parentIndexInCurrentView === -1 || connectorObj.childIndexInCurrentView === -1)) ||
                connectorObj.parentIndexInCurrentView === -1 && connectorObj.childIndexInCurrentView === -1) {
                return null;
            }
            else {
                connectorObj.parentLeft = parentGanttRecord.isMilestone ?
                    parentGanttRecord.left - (this.parent.chartRowsModule.milestoneHeight / 2) : parentGanttRecord.left;
                connectorObj.childLeft = childGanttRecord.isMilestone ?
                    childGanttRecord.left - (this.parent.chartRowsModule.milestoneHeight / 2) : childGanttRecord.left;
                connectorObj.parentWidth = parentGanttRecord.width === 0 || parentGanttRecord.isMilestone ?
                    (Math.floor(this.parent.chartRowsModule.milestoneHeight)) : parentGanttRecord.width;
                connectorObj.childWidth = childGanttRecord.width === 0 || childGanttRecord.isMilestone ?
                    (Math.floor(this.parent.chartRowsModule.milestoneHeight)) : childGanttRecord.width;
                connectorObj.parentIndex = parentIndex;
                connectorObj.childIndex = childIndex;
                connectorObj.rowHeight = !ej2_base_1.isNullOrUndefined(this.parent.ganttChartModule.getChartRows()) &&
                    this.parent.ganttChartModule.getChartRows()[0] &&
                    this.parent.ganttChartModule.getChartRows()[0].offsetHeight;
                connectorObj.type = predecessor.type;
                var parentId = this.parent.viewType === 'ResourceView' ? parentGanttRecord.taskId : parentGanttRecord.rowUniqueID;
                var childId = this.parent.viewType === 'ResourceView' ? childGanttRecord.taskId : childGanttRecord.rowUniqueID;
                connectorObj.connectorLineId = 'parent' + parentId + 'child' + childId;
                connectorObj.milestoneParent = parentGanttRecord.isMilestone ? true : false;
                connectorObj.milestoneChild = childGanttRecord.isMilestone ? true : false;
                connectorObj.parentEndPoint = connectorObj.parentLeft + connectorObj.parentWidth;
                connectorObj.childEndPoint = connectorObj.childLeft + connectorObj.childWidth;
                if (ej2_base_1.isNullOrUndefined(utils_1.isScheduledTask(parentGanttRecord)) || ej2_base_1.isNullOrUndefined(utils_1.isScheduledTask(childGanttRecord))) {
                    return null;
                }
                else {
                    return connectorObj;
                }
            }
        };
        ConnectorLine.prototype.renderConnectorLines = function (connectorLinesCollection) {
            var connectorLine = '';
            var ariaConnector = [];
            for (var index = 0; index < connectorLinesCollection.length; index++) {
                connectorLine = connectorLine + this.getConnectorLineTemplate(connectorLinesCollection[index]);
                ariaConnector.push(connectorLinesCollection[index]);
            }
            this.svgObject.innerHTML = connectorLine;
            var childNodes = this.parent.connectorLineModule.svgObject.childNodes;
            for (var i = 0; i < childNodes.length; i++) {
                var innerChild = childNodes[i].childNodes;
                for (var j = 0; j < innerChild.length; j++) {
                    var ariaString = 'Connector Line ' + this.parent.connectorLineModule.generateAriaLabel(ariaConnector[i]);
                    innerChild[j].setAttribute('aria-label', ariaString);
                    innerChild[j].setAttribute('role', 'img');
                }
            }
            this.parent.ganttChartModule.chartBodyContent.insertBefore(this.dependencyViewContainer, this.parent.ganttChartModule.chartBodyContent.lastChild);
            this.dependencyViewContainer.appendChild(this.svgObject);
            for (var i = 0; i < this.svgObject.children.length; i++) {
                this.svgObject.children[i].children[0].setAttribute('tabindex', '-1');
            }
        };
        ConnectorLine.prototype.getParentPosition = function (data) {
            if (data.parentIndex < data.childIndex) {
                if (data.type === 'FF') {
                    if ((data.childLeft + data.childWidth) >= (data.parentLeft + data.parentWidth)) {
                        return 'FFType2';
                    }
                    else {
                        return 'FFType1';
                    }
                }
                else if ((data.parentLeft < data.childLeft) && (data.childLeft > (data.parentLeft + data.parentWidth + 25))) {
                    if (data.type === 'FS') {
                        return 'FSType1';
                    }
                    if (data.type === 'SF') {
                        return 'SFType1';
                    }
                    else Eif (data.type === 'SS') {
                        return 'SSType2';
                    }
                }
                else if ((data.parentLeft < data.childLeft && (data.childLeft < (data.parentLeft + data.parentWidth)))
                    || (data.parentLeft === data.childLeft || data.parentLeft > data.childLeft)) {
                    if (data.parentLeft > (data.childLeft + data.childWidth + 25)) {
                        if (data.type === 'SF') {
                            return 'SFType2';
                        }
                    }
                    if (data.parentLeft > data.childLeft) {
                        if (data.type === 'SS') {
                            return 'SSType1';
                        }
                        if (data.type === 'SF') {
                            return 'SFType1';
                        }
                    }
                    if (data.type === 'FS') {
                        return 'FSType2';
                    }
                    else if (data.type === 'SS') {
                        return 'SSType2';
                    }
                    else Eif (data.type === 'SF') {
                        return 'SFType1';
                    }
                }
                else if ((data.parentLeft) < data.childLeft) {
                    if (data.type === 'FS') {
                        return 'FSType2';
                    }
                    else if (data.type === 'SS') {
                        return 'SSType2';
                    }
                    else Eif (data.type === 'SF') {
                        return 'SFType1';
                    }
                }
            }
            else if (data.parentIndex > data.childIndex) {
                if ((data.parentLeft < data.childLeft) && (data.childLeft > (data.parentLeft + data.parentWidth))) {
                    if (data.type === 'FS') {
                        if (30 >= (data.childLeft - (data.milestoneParent ?
                            (data.parentLeft + data.parentWidth + 4) : (data.parentLeft + data.parentWidth)))) {
                            return 'FSType3';
                        }
                        else {
                            return 'FSType4';
                        }
                    }
                    Eif (((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth))) {
                        if (data.type === 'SS') {
                            return 'SSType4';
                        }
                        if (data.type === 'FF') {
                            return 'FFType4';
                        }
                        Eif (data.type === 'SF') {
                            return 'SFType4';
                        }
                    }
                }
                else if ((data.parentLeft < data.childLeft && (data.childLeft < (data.parentLeft + data.parentWidth)))
                    || (data.parentLeft === data.childLeft || data.parentLeft > data.childLeft)) {
                    if ((data.childLeft + data.childWidth) <= (data.parentLeft + data.parentWidth)) {
                        if (data.type === 'FF') {
                            return 'FFType3';
                        }
                        if (data.type === 'SF') {
                            if ((data.childLeft + data.childWidth + 25) < (data.parentLeft)) {
                                return 'SFType3';
                            }
                            else {
                                return 'SFType4';
                            }
                        }
                        if (data.type === 'SS') {
                            Eif (data.childLeft <= data.parentLeft) {
                                return 'SSType3';
                            }
                            else {
                                return 'SSType4';
                            }
                        }
                    }
                    else Eif ((data.childLeft + data.childWidth) > (data.parentLeft + data.parentWidth)) {
                        if (data.type === 'FF') {
                            return 'FFType4';
                        }
                        Iif (data.type === 'SF') {
                            return 'SFType4';
                        }
                        if (data.type === 'SS') {
                            if (data.childLeft <= data.parentLeft) {
                                return 'SSType3';
                            }
                            else {
                                return 'SSType4';
                            }
                        }
                    }
                    Eif (data.type === 'FS') {
                        return 'FSType3';
                    }
                }
                else Eif (data.parentLeft < data.childLeft) {
                    if (data.type === 'FS') {
                        return 'FSType3';
                    }
                    Eif (data.type === 'SS') {
                        return 'SSType4';
                    }
                    if (data.type === 'FF') {
                        return 'FFType4';
                    }
                    if (data.type === 'SF') {
                        return 'SFType4';
                    }
                }
            }
            return null;
        };
        ConnectorLine.prototype.getHeightValue = function (data) {
            if (this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
                return (data.parentIndex * this.parent.rowHeight) > (data.childIndex * this.parent.rowHeight) ?
                    ((data.parentIndex * this.parent.rowHeight) - (data.childIndex * this.parent.rowHeight)) :
                    ((data.childIndex * this.parent.rowHeight) - (data.parentIndex * this.parent.rowHeight));
            }
            else {
                return (data.parentIndex * data.rowHeight) > (data.childIndex * data.rowHeight) ?
                    ((data.parentIndex * data.rowHeight) - (data.childIndex * data.rowHeight)) :
                    ((data.childIndex * data.rowHeight) - (data.parentIndex * data.rowHeight));
            }
        };
        ConnectorLine.prototype.getInnerElementWidthSSType2 = function (data) {
            if (data.parentLeft === data.childLeft) {
                return 10;
            }
            return (data.childLeft - data.parentLeft);
        };
        ConnectorLine.prototype.getInnerElementLeftSSType2 = function (data) {
            if (data.parentLeft === data.childLeft) {
                return (data.parentLeft - 20);
            }
            return (data.parentLeft - 10);
        };
        ConnectorLine.prototype.getInnerChildWidthSSType2 = function (data) {
            if ((data.parentLeft + data.parentWidth) < data.childLeft) {
                return 10;
            }
            if (data.parentLeft === data.childLeft) {
                return 20;
            }
            if ((data.parentLeft + data.parentWidth) >= data.childLeft) {
                return 10;
            }
            return (data.childLeft - data.parentLeft);
        };
        ConnectorLine.prototype.calculateAdjustments = function (rowHeight, isMilestone, type) {
            var taskbarHeightValue = this.parent.renderBaseline ? 0.45 : ((!ej2_base_1.isNullOrUndefined(document.body.className) && document.body.className.includes('e-bigger')) ? 0.7 : 0.62);
            var defaultTaskbarHeight = Math.floor(this.parent.rowHeight * taskbarHeightValue);
            if (((ej2_base_1.isNullOrUndefined(this.parent.taskbarHeight) && rowHeight <= 36) || (!ej2_base_1.isNullOrUndefined(this.parent.taskbarHeight) &&
                this.parent.taskbarHeight <= defaultTaskbarHeight)) || !isMilestone) {
                return {
                    adjustY1: 0,
                    adjustX: 0,
                    adjustY2: 0,
                    adjustZ: 0
                };
            }
            else {
                var divisorY1 = ((type === 'FSType2' || type === 'FSType3' || type === 'FSType4' || type === 'SSType1' || type === 'SSType2' || type === 'SSType4' || type === 'SFType2')) ? 12 : 24;
                var adjustY1 = (rowHeight - 36) / divisorY1;
                var adjustX = -(rowHeight - 36) / 4;
                var adjustZ = -2 * (rowHeight - 36) / 24;
                if (rowHeight <= 36) {
                    return {
                        adjustY1: 0,
                        adjustX: 0,
                        adjustY2: 0,
                        adjustZ: 0
                    };
                }
                return {
                    adjustY1: adjustY1,
                    adjustX: adjustX,
                    adjustZ: adjustZ
                };
            }
        };
        ConnectorLine.prototype.getConnectorLineTemplate = function (data) {
            var setInnerChildWidthSSType2 = this.getInnerChildWidthSSType2(data);
            var setInnerElementWidthSSType2 = this.getInnerElementWidthSSType2(data);
            var setInnerElementLeftSSType2 = this.getInnerElementLeftSSType2(data);
            var height = this.getHeightValue(data);
            var isMilestoneParent = data.milestoneParent ? true : false;
            var isMilestone = data.milestoneChild ? true : false;
            var isVirtual = this.parent.virtualScrollModule && this.parent.enableVirtualization;
            var connectorLine = this.getPosition(data, this.getParentPosition(data), height);
            var rowPosition = this.getPosition(data, this.getParentPosition(data), height);
            var rowPositionHeight = rowPosition.top;
            var isMilestoneValue = 0;
            if (this.parent.renderBaseline) {
                var modifiedValue = (this.parent.rowHeight / 36) * 5;
                isMilestoneValue = (data.milestoneParent && data.milestoneChild) ? 0 : data.milestoneParent ? -modifiedValue :
                    data.milestoneChild ? modifiedValue : 0;
            }
            var heightValue = isVirtual ? connectorLine.height : (height + isMilestoneValue);
            var borderTopWidth = 0;
            var addTop = 0;
            var parentOverlapTopValue = 0;
            var childOverlapTopValue = 0;
            var count = 0;
            if (this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
                for (var i = 0; i < this.parent.currentViewData.length; i++) {
                    if (this.parent.getRowByIndex(i).style.display !== 'none') {
                        if (count < data.parentIndex) {
                            count++;
                            parentOverlapTopValue = parentOverlapTopValue + this.parent.getRowByIndex(i).offsetHeight;
                        }
                    }
                }
                count = 0;
                for (var j = 0; j < this.parent.currentViewData.length; j++) {
                    if (this.parent.getRowByIndex(j).style.display !== 'none') {
                        if (count < data.childIndex) {
                            count++;
                            childOverlapTopValue = childOverlapTopValue + this.parent.getRowByIndex(j).offsetHeight;
                        }
                    }
                }
                Eif (!this.parent.enableVirtualization) {
                    heightValue = Math.abs(parentOverlapTopValue - childOverlapTopValue);
                }
            }
            if (this.parent.currentViewData[data.parentIndex] && this.parent.currentViewData[data.childIndex] &&
                this.parent.allowParentDependency) {
                var fromRecordIsParent = this.parent.currentViewData[data.parentIndex].hasChildRecords;
                var toRecordIsParent = this.parent.currentViewData[data.childIndex].hasChildRecords;
                var fromRecordIsManual = this.parent.currentViewData[data.parentIndex].ganttProperties.isAutoSchedule;
                var toRecordIsManual = this.parent.currentViewData[data.childIndex].ganttProperties.isAutoSchedule;
                var isValid = true;
                if (((fromRecordIsParent && fromRecordIsManual) && !toRecordIsParent) || ((toRecordIsParent && toRecordIsManual) &&
                    !fromRecordIsParent) || (fromRecordIsParent && fromRecordIsManual && toRecordIsManual && toRecordIsParent)
                    || (!fromRecordIsParent && !toRecordIsParent)) {
                    isValid = false;
                }
                if (isValid) {
                    Iif (((fromRecordIsParent && !fromRecordIsManual) && (toRecordIsParent && !toRecordIsManual))) {
                        addTop = -11;
                    }
                    else Eif (!((fromRecordIsParent && !fromRecordIsManual) && (toRecordIsParent && !toRecordIsManual))) {
                        if (data.childIndex > data.parentIndex) {
                            Eif (!fromRecordIsParent && toRecordIsParent) {
                                borderTopWidth = -11;
                            }
                            else {
                                borderTopWidth = 11;
                                addTop = -11;
                            }
                        }
                        else {
                            if ((fromRecordIsParent && !toRecordIsParent)) {
                                borderTopWidth = -11;
                            }
                            else {
                                borderTopWidth = 11;
                                addTop = -11;
                            }
                        }
                    }
                    if (this.parent.currentViewData[data.parentIndex].ganttProperties.isMilestone) {
                        Iif (data.parentIndex > data.childIndex) {
                            addTop = -11;
                            borderTopWidth = 12;
                        }
                        else Eif (data.type === 'SS' || data.type === 'FF') {
                            addTop = -5;
                        }
                    }
                    else if (this.parent.currentViewData[data.childIndex].ganttProperties.isMilestone) {
                        Eif (data.parentIndex > data.childIndex) {
                            addTop = 5;
                            borderTopWidth = -10;
                        }
                        else if (data.parentIndex < data.childIndex) {
                            if (data.type === 'SS' || data.type === 'FF') {
                                addTop = -10;
                            }
                        }
                    }
                    else {
                        Iif (data.parentIndex < data.childIndex && fromRecordIsManual && !toRecordIsManual) {
                            addTop = 0;
                            borderTopWidth = -11;
                        }
                        else Iif (data.childIndex < data.parentIndex && !fromRecordIsManual && toRecordIsManual) {
                            addTop = 0;
                            borderTopWidth = -11;
                        }
                    }
                }
            }
            if (this.getParentPosition(data)) {
                var type = this.getParentPosition(data);
                var rowHeight1 = this.parent.rowHeight;
                var adjustments = this.calculateAdjustments(rowHeight1, isMilestone, type);
                this.transform = this.parent.enableRtl ? "translate(" + (this.parent.enableTimelineVirtualization ? this.parent.timelineModule.wholeTimelineWidth : this.parent.timelineModule.totalTimelineWidth) + ", 0) scale(-1, 1)" : '';
                this.connectorId = 'ConnectorLine' + data.connectorLineId;
                this.groupObject = this.renderer.createGroup({
                    id: this.connectorId,
                    transform: this.transform,
                    style: 'pointer-events: stroke',
                    class: cls.connectorLineContainer
                });
                this.connectorPath = this.renderer.drawPath({
                    class: cls.connectorLineSVG,
                    d: this.connectorLinePath,
                    fill: 'transparent',
                    'stroke-width': this.lineStroke
                });
                this.arrowlinePath = this.renderer.drawPath({
                    d: this.arrowPath,
                    class: cls.connectorLineArrow
                });
                var outlineColor = (this.lineColor) && !(this.parent.enableCriticalPath) ? this.lineColor : '';
                this.connectorPath.setAttribute('style', "stroke: " + outlineColor);
                this.arrowlinePath.setAttribute('style', "fill: " + outlineColor);
                this.groupObject.appendChild(this.connectorPath);
                this.groupObject.appendChild(this.arrowlinePath);
                if (this.getParentPosition(data) === 'FSType1') {
                    this.taskLineValue = data.milestoneChild ? 1 : 0;
                    this.x1 = data.parentEndPoint + (data.milestoneParent ? -1 : (data.milestoneChild ? -1 : 0));
                    this.x2 = data.milestoneParent ?
                        ((((data.childLeft - (data.parentLeft + data.parentWidth + 10)) + this.lineStroke) - 10) + 1) :
                        (((data.childLeft - (data.parentLeft + data.parentWidth + 10)) + this.lineStroke) - 10);
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue :
                            (data.parentIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue));
                    this.y2 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    this.connectorLinePath = 'M ' + this.x1 + ' ' + (this.y1) + ' L ' + ((this.x1 + this.x2) + adjustments['adjustZ']) + ' ' + (this.y1) + ' L ' + ((this.x1 + this.x2) + adjustments['adjustZ']) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x2 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1 + this.x2 + 20) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x2 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x2 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 + 4) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FSType2') {
                    this.x1 = data.parentLeft;
                    this.x2 = data.parentWidth + (data.milestoneParent ? -1 : 0);
                    this.x3 = this.x2 + (data.milestoneParent ? 11 : 10);
                    this.x4 = data.parentWidth - ((data.parentEndPoint - data.childLeft) + 20);
                    this.y1 = (this.parent.enableVirtualization ?
                        rowPositionHeight : ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue :
                        (data.parentIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue));
                    this.y2 = heightValue + borderTopWidth - this.getconnectorLineGap(data) - this.lineStroke;
                    this.y3 = this.getconnectorLineGap(data);
                    this.y4 = (!this.parent.allowTaskbarOverlap ? childOverlapTopValue :
                        (this.y1 + this.y2 - ((this.y1 + this.y2) % data.rowHeight)));
                    this.connectorLinePath = 'M ' + (this.x1 + this.x2) + ' ' + (this.y1) + ' ' + ' L ' + (this.x1 + this.x3) + ' ' + (this.y1) + ' L ' + (this.x1 + this.x3) + ' ' + this.y4 +
                        ' L ' + ((this.x1 + this.x4) + adjustments['adjustZ']) + ' ' + this.y4 + ' L ' + ((this.x1 + this.x4) + adjustments['adjustZ']) + ' ' + ((this.y1 + this.y2 + this.y3) + adjustments['adjustY1']) + ' L ' + ((this.x1 + this.x4 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 + this.y3) + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1 + this.x4 + 20) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 + this.y3) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x4 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 + this.y3 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x4 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + this.y2 + this.y3 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FSType3') {
                    this.taskLineValue = data.milestoneChild ? 1 : 0;
                    this.point1 = (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue :
                            (data.childIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue));
                    this.x1 = (data.childLeft + (data.milestoneChild ? -1 : 0) + (data.milestoneParent ? 1 : 0)) - 20;
                    this.x2 = (data.parentEndPoint - data.childLeft) + 30;
                    this.y1 = this.point1 + (this.parent.renderBaseline ?
                        (data.milestoneChild && !(data.milestoneParent) ? 11 :
                            data.milestoneParent && !(data.milestoneChild) ? -12 : 0) : 0);
                    this.y2 = this.point1 + heightValue + borderTopWidth - this.getconnectorLineGap(data) - this.lineStroke +
                        this.taskLineValue;
                    this.y3 = this.getconnectorLineGap(data);
                    this.y4 = this.y2 - (this.y2 % data.rowHeight);
                    this.connectorLinePath = 'M ' + (this.x1 + 12) + ' ' + ((this.y1) + adjustments['adjustY1']) + ' L ' + this.x1 + ' ' + ((this.y1) + adjustments['adjustY1']) + ' L ' + this.x1 + ' ' + this.y4 +
                        ' L ' + (this.x1 + this.x2) + ' ' + this.y4 + ' L ' + (this.x1 + this.x2) + ' ' + (this.y2 + this.y3) + ' L ' + (this.x1 + this.x2 - 12) + ' ' + (this.y2 + this.y3);
                    this.arrowPath = 'M ' + ((this.x1 + 20) + adjustments['adjustX']) + ' ' + ((this.y1) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FSType4') {
                    this.point1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.x1 = data.parentEndPoint + (data.milestoneChild ? -1 : 0) + (data.milestoneParent ? 1 : 0);
                    this.x2 = data.childLeft - data.parentEndPoint - 20;
                    this.y1 = this.point1 + (data.milestoneChild ? -1 : 0);
                    this.y2 = this.point1 + heightValue + borderTopWidth - this.lineStroke + 1 + this.taskLineValue +
                        (this.parent.renderBaseline ? (data.milestoneChild && !(data.milestoneParent) ? -12 :
                            data.milestoneParent && !(data.milestoneChild) ? 11 : 0) : 0);
                    this.connectorLinePath = 'M ' + (this.x1 + this.x2 + 12) + ' ' + ((this.y1) + adjustments['adjustY1']) + ' L ' + (this.x1 + this.x2) + ' ' + ((this.y1) + adjustments['adjustY1']) + ' L ' + (this.x1 + this.x2) + ' ' + this.y2 +
                        ' L ' + this.x1 + ' ' + this.y2;
                    this.arrowPath = 'M ' + ((this.x1 + this.x2 + 20) + adjustments['adjustX']) + ' ' + ((this.y1) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x2 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x2 + 12) + adjustments['adjustX']) + ' ' + ((this.y1 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'SSType4') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 2 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.point1 = heightValue + this.taskLineValue + borderTopWidth;
                    this.point2 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.x1 = data.parentLeft - 10;
                    this.x2 = data.childLeft - data.parentLeft;
                    this.y1 = this.point2 + (data.milestoneChild ? 1 : 0);
                    this.y2 = this.y1 + this.point1 + (this.parent.renderBaseline ? (data.milestoneParent && !(data.milestoneChild) ? 10 :
                        data.milestoneChild && !(data.milestoneParent) ? -13 : 0) : 0);
                    this.connectorLinePath = 'M ' + ((this.x1 + this.x2) + adjustedX) + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y1) +
                        ' L ' + this.x1 + ' ' + this.y2 + ' L ' + (this.x1 + 10) + ' ' + this.y2;
                    this.arrowPath = 'M ' + ((this.x1 + this.x2 + 8) + adjustedX) + ' ' + (this.y1) +
                        ' L ' + ((this.x1 + this.x2) + adjustedX) + ' ' + (this.y1 - (4 + this.lineStroke)) +
                        ' L ' + ((this.x1 + this.x2) + adjustedX) + ' ' + (this.y1 + 4 + this.lineStroke) + ' Z';
                }
                if (this.getParentPosition(data) === 'SSType3') {
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : data.milestoneChild ? 1 : 0;
                    this.point1 = heightValue + this.taskLineValue + borderTopWidth - (this.lineStroke - 1);
                    this.x1 = data.childLeft - 20;
                    this.y1 = (data.milestoneChild ? 1 : 0) + (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.x2 = data.parentLeft - data.childLeft + 21;
                    this.y2 = this.y1 + this.point1 + (this.parent.renderBaseline ? (data.milestoneChild && !(data.milestoneParent) ? -11 :
                        data.milestoneParent && !(data.milestoneChild) ? 10 : 0) : 0);
                    this.connectorLinePath = 'M ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y1) +
                        ' L ' + this.x1 + ' ' + this.y2 + ' L ' + (this.x1 + this.x2) + ' ' + this.y2;
                    this.arrowPath = 'M ' + ((this.x1 + 20) + adjustments['adjustX']) + ' ' + (this.y1) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + (this.y1 - (4 + this.lineStroke)) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + (this.y1 + 4 + this.lineStroke) + ' Z';
                }
                if (this.getParentPosition(data) === 'SSType2') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 2 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : data.milestoneChild ? 1 : 0;
                    this.point1 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    this.x1 = setInnerElementLeftSSType2;
                    this.x2 = setInnerChildWidthSSType2 + 1;
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1)));
                    this.y2 = this.y1 + this.point1;
                    this.connectorLinePath = 'M ' + (this.x1 + this.x2) + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y2 + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + setInnerElementWidthSSType2) + adjustedX) + ' ' + (this.y2 + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1 + setInnerElementWidthSSType2 + 8) + adjustedX) + ' ' + ((this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + setInnerElementWidthSSType2) + adjustedX) + ' ' + ((this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + setInnerElementWidthSSType2) + adjustedX) + ' ' + ((this.y2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'SSType1') {
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : data.milestoneChild ? 1 : 0;
                    this.point1 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    this.x1 = data.childLeft - 20;
                    this.x2 = data.parentLeft - data.childLeft + 21;
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1)));
                    this.y2 = this.y1 + this.point1;
                    this.connectorLinePath = 'M ' + (this.x1 + this.x2) + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y2 + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + (this.y2 + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1 + 20) + adjustments['adjustX']) + ' ' + ((this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + ((this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 12) + adjustments['adjustX']) + ' ' + ((this.y2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FFType1') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : (data.milestoneChild ? 1 : 0);
                    this.x1 = data.childEndPoint;
                    this.x2 = data.parentEndPoint + (data.milestoneParent ? -1 : 0);
                    this.x3 = data.milestoneParent ? 22 : 21;
                    this.x4 = data.milestoneChild ? 4 : 8;
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        parentOverlapTopValue : (data.parentIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1)));
                    this.y2 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    this.connectorLinePath = 'M ' + this.x2 + ' ' + (this.y1) + ' L ' + (this.x2 + this.x3) + ' ' + (this.y1) + ' L ' + (this.x2 + this.x3) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + (this.x1 + this.x4) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1) + adjustedX) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + ((this.y1 + this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + ((this.y1 + this.y2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FFType2') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : (data.milestoneChild ? 1 : 0);
                    this.x1 = data.parentEndPoint;
                    this.x2 = data.childEndPoint + (data.milestoneParent ? 22 : 21);
                    this.x3 = data.childEndPoint + (data.milestoneChild ? 9 : 8);
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue :
                            (data.parentIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(data.milestoneParent) - (this.lineStroke - 1)));
                    this.y2 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    var arrowX = this.parent.renderBaseline ? 0 : adjustedX;
                    this.connectorLinePath = 'M ' + this.x1 + ' ' + (this.y1) + ' L ' + this.x2 + ' ' + (this.y1) + ' L ' + this.x2 + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + this.x3 + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x3 - 8) + arrowX) + ' ' + ((this.y1 + this.y2) + adjustments['adjustY1']) +
                        ' L ' + (this.x3 + arrowX) + ' ' + ((this.y1 + this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + (this.x3 + arrowX) + ' ' + ((this.y1 + this.y2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'FFType3') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.x1 = data.childEndPoint;
                    this.x2 = this.x1 + (data.milestoneChild ? 4 : 8);
                    this.x3 = data.parentEndPoint - data.childEndPoint + (data.milestoneChild ? 16 : 10);
                    this.x4 = data.parentEndPoint + (data.milestoneParent ? -1 : 0);
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.y2 = heightValue + this.taskLineValue + borderTopWidth - this.lineStroke + (this.parent.renderBaseline ?
                        (data.milestoneParent && !(data.milestoneChild) ? 10 : data.milestoneChild && !(data.milestoneParent) ? -11 : 0) : 0);
                    this.connectorLinePath = 'M ' + this.x2 + ' ' + (this.y1) + ' L ' + (this.x2 + this.x3) + ' ' + (this.y1) + ' L ' + (this.x2 + this.x3) + ' ' + (this.y1 + this.y2) +
                        ' L ' + this.x4 + ' ' + (this.y1 + this.y2);
                    this.arrowPath = 'M ' + (this.x1 + adjustedX) + ' ' + (this.y1) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + (this.y1 - (4 + this.lineStroke)) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + (this.y1 + 4 + this.lineStroke) + ' Z';
                }
                if (this.getParentPosition(data) === 'FFType4') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.x1 = data.parentEndPoint;
                    this.x2 = data.childEndPoint + (data.milestoneChild ? 7 : 8);
                    this.x3 = this.x2 + (data.milestoneChild ? 12 : 11);
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.y2 = heightValue + this.taskLineValue + borderTopWidth + (this.parent.renderBaseline ?
                        (data.milestoneParent && !(data.milestoneChild) ? 10 :
                            data.milestoneChild && !(data.milestoneParent) ? -12 : 0) : 0) - this.lineStroke + 1;
                    var arrowX = this.parent.renderBaseline ? 0 : adjustedX;
                    this.connectorLinePath = 'M ' + this.x2 + ' ' + (this.y1) + ' L ' + this.x3 + ' ' + (this.y1) + ' L ' + this.x3 + ' ' + (this.y1 + this.y2) +
                        ' L ' + this.x1 + ' ' + (this.y1 + this.y2);
                    this.arrowPath = 'M ' + ((this.x2 - 8) + arrowX) + ' ' + (this.y1) +
                        ' L ' + (this.x2 + arrowX) + ' ' + (this.y1 - (4 + this.lineStroke)) +
                        ' L ' + (this.x2 + arrowX) + ' ' + (this.y1 + 4 + this.lineStroke) + ' Z';
                }
                if (this.getParentPosition(data) === 'SFType4') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : (data.milestoneChild ? -1 : 0);
                    this.point1 = (this.taskLineValue + heightValue + borderTopWidth - this.getconnectorLineGap(data) - (this.lineStroke - 1));
                    this.point2 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue));
                    this.x1 = data.parentLeft - 10;
                    this.x2 = this.x1 + ((data.childEndPoint - data.parentLeft) + 18);
                    this.x3 = this.x2 + (data.milestoneChild ? 16 : 11);
                    this.y1 = this.point2 + (data.milestoneChild ? 2 : 0) + (this.parent.renderBaseline ? (data.milestoneParent ? -5 : 0) : 0);
                    this.y2 = this.y1 + this.point1 + (this.parent.renderBaseline ? (data.milestoneChild && !(data.milestoneParent) ? -9 :
                        data.milestoneParent && !(data.milestoneChild) ? 9 : 0) : 0);
                    this.y3 = this.getconnectorLineGap(data);
                    this.y4 = this.y2 - (this.y2 % data.rowHeight);
                    var arrowX = this.parent.renderBaseline ? 0 : adjustedX;
                    this.connectorLinePath = 'M ' + this.x2 + ' ' + ((this.y1) - adjustments['adjustY1']) + ' L ' + this.x3 + ' ' + ((this.y1) - adjustments['adjustY1']) + ' L ' + this.x3 + ' ' + this.y4 + ' L ' + this.x1 + ' ' + this.y4 +
                        ' L ' + this.x1 + ' ' + ((this.y2 + this.y3)) + ' L ' + (this.x1 + 11) + ' ' + ((this.y2 + this.y3));
                    this.arrowPath = 'M ' + ((this.x2 - 8) + arrowX) + ' ' + ((this.y1) - adjustments['adjustY1']) +
                        ' L ' + (this.x2 + arrowX) + ' ' + ((this.y1 - (4 + this.lineStroke)) - adjustments['adjustY1']) +
                        ' L ' + (this.x2 + arrowX) + ' ' + ((this.y1 + 4 + this.lineStroke) - adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'SFType3') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.point1 = (data.parentLeft - (data.childEndPoint + (data.milestoneParent ? 23 : 20))) + 1;
                    this.point2 = (this.parent.enableVirtualization ? rowPositionHeight : ((!this.parent.allowTaskbarOverlap ?
                        childOverlapTopValue : (data.childIndex * data.rowHeight)) + addTop +
                        this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1)));
                    this.x1 = data.childEndPoint;
                    this.x2 = this.x1 + (data.milestoneChild ? 9 : 8);
                    this.x3 = this.x2 + (data.milestoneChild ? 17 : 11);
                    this.y1 = this.point2;
                    this.y2 = this.y1 + heightValue + borderTopWidth - (this.lineStroke - 1) + this.taskLineValue +
                        (this.parent.renderBaseline ? (data.milestoneChild && !(data.milestoneParent) ? -12 :
                            data.milestoneParent && !(data.milestoneChild) ? 10 : 0) : 0);
                    this.connectorLinePath = 'M ' + this.x2 + ' ' + (this.y1) + ' L ' + this.x3 + ' ' + (this.y1) +
                        ' L ' + this.x3 + ' ' + this.y2 + ' L ' + (this.x3 + this.point1) + ' ' + this.y2;
                    this.arrowPath = 'M ' + ((this.x2 - 8) + adjustedX) + ' ' + (this.y1) +
                        ' L ' + (this.x2 + adjustedX) + ' ' + (this.y1 - (4 + this.lineStroke)) +
                        ' L ' + (this.x2 + adjustedX) + ' ' + (this.y1 + 4 + this.lineStroke) + ' Z';
                }
                if (this.getParentPosition(data) === 'SFType1') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : data.milestoneChild ? 1 : 0;
                    this.point1 = heightValue + borderTopWidth - this.getconnectorLineGap(data) + this.taskLineValue - this.lineStroke;
                    this.point2 = this.getconnectorLineGap(data);
                    this.x1 = data.parentLeft - 10;
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue :
                            (data.parentIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue));
                    this.x2 = (data.childEndPoint - data.parentLeft) + 31;
                    this.y2 = this.y1 + this.point1;
                    this.x3 = (data.childEndPoint - data.parentLeft) + 18;
                    this.y3 = this.y2 - (this.y2 % data.rowHeight);
                    var arrowX = this.parent.renderBaseline ? 0 : adjustedX;
                    this.connectorLinePath = 'M ' + (this.x1 + 11) + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + (this.y1) + ' L ' + this.x1 + ' ' + this.y3 +
                        ' L ' + (this.x1 + this.x2) + ' ' + this.y3 + ' L ' + (this.x1 + this.x2) + ' ' + ((this.y2 + this.point2) + adjustments['adjustY1']) + ' L ' + (this.x1 + this.x3) + ' ' + ((this.y2 + this.point2) + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + ((this.x1 + this.x3 - 8) + arrowX) + ' ' + ((this.y2 + this.point2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x3) + arrowX) + ' ' + ((this.y2 + this.point2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + this.x3) + arrowX) + ' ' + ((this.y2 + this.point2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                if (this.getParentPosition(data) === 'SFType2') {
                    var adjustedX = adjustments['adjustX'] !== 0 ? adjustments['adjustX'] + 11 : adjustments['adjustX'];
                    this.taskLineValue = this.parent.renderBaseline ? this.taskLineValue : 0;
                    this.x1 = data.childEndPoint;
                    this.y1 = (this.parent.enableVirtualization ? rowPositionHeight :
                        ((!this.parent.allowTaskbarOverlap ? parentOverlapTopValue :
                            (data.parentIndex * data.rowHeight)) + addTop +
                            this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1)));
                    this.x2 = (data.parentLeft - data.childEndPoint);
                    this.y2 = this.y1 + heightValue + this.taskLineValue + borderTopWidth - this.lineStroke;
                    this.connectorLinePath = 'M ' + (this.x1 + this.x2 + 1) + ' ' + (this.y1) + ' L ' + (this.x1 + this.x2 - 10) + ' ' + (this.y1) +
                        ' L ' + (this.x1 + this.x2 - 10) + ' ' + (this.y2 + adjustments['adjustY1']) + ' L ' + (this.x1 + 8) + ' ' + (this.y2 + adjustments['adjustY1']);
                    this.arrowPath = 'M ' + (this.x1 + adjustedX) + ' ' + ((this.y2) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + ((this.y2 - (4 + this.lineStroke)) + adjustments['adjustY1']) +
                        ' L ' + ((this.x1 + 8) + adjustedX) + ' ' + ((this.y2 + 4 + this.lineStroke) + adjustments['adjustY1']) + ' Z';
                }
                this.connectorPath.setAttribute('d', this.connectorLinePath);
                this.arrowlinePath.setAttribute('d', this.arrowPath);
            }
            return this.groupObject.outerHTML;
        };
        ConnectorLine.prototype.getPosition = function (data, type, heightValue) {
            var topPosition = 0;
            var lineHeight = 0;
            if (this.parent.virtualScrollModule && this.parent.enableVirtualization) {
                var isMilestoneParent = data.milestoneParent ? true : false;
                var isMilestone = data.milestoneChild ? true : false;
                var midPointParent = this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1);
                var midPoint = this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1);
                var isParentIndex = data.parentIndexInCurrentView !== -1;
                var isChildIndex = data.childIndexInCurrentView !== -1;
                var lastRowIndex = this.parent.currentViewData.length - 1;
                if (type === 'SSType1' || type === 'SSType2' || type === 'FFType1' || type === 'FFType2' || type === 'SFType2') {
                    topPosition = isParentIndex ? (data.parentIndexInCurrentView * data.rowHeight) + midPointParent : 0;
                    lineHeight = (isParentIndex && isChildIndex) ? heightValue : isChildIndex ?
                        (data.childIndexInCurrentView * data.rowHeight) + midPointParent : (lastRowIndex * data.rowHeight) + midPointParent;
                }
                else if (type === 'SSType3' || type === 'SSType4' || type === 'FSType4' || type === 'FFType3' ||
                    type === 'FFType4' || type === 'SFType4' || type === 'SFType3') {
                    topPosition = isChildIndex ? (data.childIndexInCurrentView * data.rowHeight) + midPoint : 0;
                    lineHeight = (isParentIndex && isChildIndex) ? heightValue : isParentIndex ?
                        (data.parentIndexInCurrentView * data.rowHeight) + midPoint :
                        (lastRowIndex * data.rowHeight) + midPoint;
                }
                else if (type === 'FSType3') {
                    topPosition = isChildIndex ? (data.childIndexInCurrentView * data.rowHeight) + midPointParent : 0;
                    lineHeight = (isParentIndex && isChildIndex) ? heightValue : isParentIndex ?
                        (data.parentIndexInCurrentView * data.rowHeight) + midPoint :
                        (lastRowIndex * data.rowHeight) + midPointParent;
                }
                else Eif (type === 'SFType1' || type === 'FSType1' || type === 'FSType2') {
                    topPosition = isParentIndex ? (data.parentIndexInCurrentView * data.rowHeight) + midPoint : 0;
                    lineHeight = (isParentIndex && isChildIndex) ? heightValue : isChildIndex ?
                        (data.childIndexInCurrentView * data.rowHeight) + midPoint :
                        (lastRowIndex * data.rowHeight) + midPoint;
                }
            }
            return { top: topPosition, height: lineHeight };
        };
        ConnectorLine.prototype.createConnectorLineTooltipTable = function () {
            this.tooltipTable = ej2_base_1.createElement('table', { className: '.e-tooltiptable', styles: 'margin-top:0px', attrs: { 'cellspacing': '2px', 'cellpadding': '2px' } });
            var tooltipBody = ej2_base_1.createElement('tbody');
            tooltipBody.innerHTML = '';
            this.tooltipTable.appendChild(tooltipBody);
        };
        ConnectorLine.prototype.getConnectorLineTooltipInnerTd = function (fromTaskName, fromPredecessorText, toTaskName, toPredecessorText) {
            var innerTd = '<tr  id="fromPredecessor"><td style="padding: 2px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
            innerTd = innerTd + fromTaskName + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(fromPredecessorText) + ' </td> </tr>';
            innerTd = innerTd + '<tr id="toPredecessor"><td style="padding: 2px;">' + this.parent.localeObj.getConstant('to') + '</td><td> ' + toTaskName;
            innerTd = innerTd + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
            return innerTd;
        };
        ConnectorLine.prototype.generateAriaLabel = function (data) {
            var type = data.type;
            var updatedRecords = this.expandedRecords;
            var fromName = updatedRecords[data.parentIndex].ganttProperties.taskName;
            var toName = updatedRecords[data.childIndex].ganttProperties.taskName;
            var start = this.parent.localeObj.getConstant('start');
            var finish = this.parent.localeObj.getConstant('finish');
            var value = '';
            if (type === 'FS') {
                value = fromName + ' ' + finish + ' to ' + toName + ' ' + start;
            }
            else if (type === 'FF') {
                value = fromName + ' ' + finish + ' to ' + toName + ' ' + finish;
            }
            else if (type === 'SS') {
                value = fromName + ' ' + start + ' to ' + toName + ' ' + start;
            }
            else {
                value = fromName + ' ' + start + ' to ' + toName + ' ' + finish;
            }
            return value;
        };
        ConnectorLine.prototype.getRecordByID = function (id) {
            Iif (ej2_base_1.isNullOrUndefined(id)) {
                return null;
            }
            if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
                this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
                var a = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'].filter(function (data) {
                    return data.ganttProperties.taskId.toString() === id.toString();
                })[0];
                return a;
            }
            else {
                return this.parent.viewType === 'ResourceView' ? this.parent.flatData[this.parent.getTaskIds().indexOf('T' + id.toString())] :
                    this.parent.flatData[this.parent.ids.indexOf(id.toString())];
            }
        };
        ConnectorLine.prototype.removePreviousConnectorLines = function (records) {
            var isObjectType;
            if (ej2_base_1.isObject(records) === true) {
                isObjectType = true;
            }
            else {
                isObjectType = false;
            }
            var length = isObjectType ? Object.keys(records).length : records.length;
            var keys = Object.keys(records);
            for (var i = 0; i < length; i++) {
                var data = void 0;
                if (isObjectType) {
                    var uniqueId = keys[i];
                    data = records[uniqueId];
                }
                else {
                    data = records[i];
                }
                var predecessors = data.ganttProperties && data.ganttProperties.predecessor;
                if (predecessors && predecessors.length > 0) {
                    for (var pre = 0; pre < predecessors.length; pre++) {
                        var lineId = 'parent' + predecessors[pre].from + 'child' + predecessors[pre].to;
                        this.removeConnectorLineById(lineId);
                    }
                }
            }
        };
        ConnectorLine.prototype.removeConnectorLineById = function (id) {
            var element = this.parent.connectorLineModule.dependencyViewContainer.querySelector('#ConnectorLine' + id.replace(/([.])/g, '\\$1'));
            if (!ej2_base_1.isNullOrUndefined(element)) {
                ej2_base_1.remove(element);
            }
        };
        return ConnectorLine;
    }());
    exports.ConnectorLine = ConnectorLine;
});