gojs双轮图,节点和线带弹框,学习备份

fn: function(nodeDataArray, linkDataArray) {
                var that=this;
                var fang = "/static/img/icon-fang.png"; //+号
                var user = "/static/img/icon-user.png"; //减号
                var wen = "/static/img/icon-wen.png"; //当前企业
                var userBig = "/static/img/icon-fangBig.png"; //公司
                var fangBig = "/static/img/icon-userBig.png"; //当前企业
                var myDiagram = null;
                //图谱图片
                function convertKeyImage(type) {
                    if (type == 1) { //跟节点
                        return fang;
                    } else if (type == 2) { 
                        return user;
                    } else if (type == 3) { 
                        return wen;
                    } else if (type == 4) { 
                        return userBig;
                    }else if (type == 5) { 
                        return fangBig;
                    }
                }
                init();
                function init(nodeDataArray, linkDataArray) {
                       if (window.goSamples) goSamples(); 
                       var GO = go.GraphObject.make;
                    myDiagram = GO(go.Diagram, "myDiagramDiv", {
                        initialAutoScale: go.Diagram.Uniform,
                        initialContentAlignment: go.Spot.Center,
                        "toolManager.mouseWheelBehavior": go.ToolManager.WheelZoom,
                        "toolManager.hoverDelay": 100,
                        "toolManager.toolTipDuration":999999999,
                        padding: 10,
                        isReadOnly: true,
                        layout: GO(RadialLayout, {
                            maxLayers: 2,
                            rotateNode: function(node, angle, sweep, radius) {
                                node.angle = angle;
                                var label = node.findObject("TEXTBLOCK");
                                if (label !== null) {
                                    label.angle = ((angle > 90 && angle < 270 || angle < -90) ? 180 : 0);
                                    if (radius == 100) {
                                        node.angle = 0;
                                        label.angle = 0;
                                    }else{
                                        node.angle= angle +90;
                                    }
                                }
                            },
                            commitLayers: function() {
                                var diagram = this.diagram;
                                var gridlayer = diagram.findLayer("Grid");
                                var circles = new go.Set(go.Part);
                                gridlayer.parts.each(function(circle) {
                                    if (circle.name === "CIRCLE") circles.add(circle);
                                });
                                circles.each(function(circle) {
                                    diagram.remove(circle);
                                });
                                var GO = go.GraphObject.make; // for conciseness in defining templates
                                for (var lay = 1; lay <= this.maxLayers; lay++) {
                                    var radius = lay * this.layerThickness - 12;
                                    var circle = GO(go.Part, {
                                            name: "CIRCLE",
                                            layerName: "Grid"
                                        }, {
                                            locationSpot: go.Spot.Center,
                                            location: this.root.location
                                        },
                                        GO(go.Shape, "Circle", {
                                            width: radius * 2,
                                            height: radius * 2
                                        }, {
                                            fill: "transparent",
                                            stroke: "#cccccc"
                                        })
                                    )
                                    diagram.add(circle);
                                }
                            }
                        }),
                        "animationManager.isEnabled": false
                    });
                       // 节点实体弹窗
                       var commonToolTipNode = GO(go.Adornment, "Auto", 
                          GO(go.Shape, {width: 260,fill: "#fff",stroke: "#7ecbfa",strokeWidth: 1,figure: "Border" }), 
                          GO(go.Panel, "Vertical", 
                                //标题
                               GO(go.Panel, "Auto",{stretch: go.GraphObject.Horizontal},// 与节点同宽
                                   GO(go.Shape, 
                                       {width: 260,fill: "#7ecbfa",strokeWidth: 0,figure: "Border"}
                                   ), 
                                   GO(go.Picture, { source: "/static/img/icon-company.png", background: "transparent", width: 16, height: 16 ,alignment: go.Spot.Left,margin: new go.Margin(0,6,0,6)},
                                       new go.Binding("source","nodeImg",function(val){
                                           return val ==="personnel" ? "/static/img/personnelBlack.png" : "/static/img/enterpriseBlack.png"
                                       })
                                   ),
                                   GO(go.TextBlock,
                                       {stroke: "#fff",margin: new go.Margin(6,0,6,30), font: " 14px 微软雅黑, Arial, sans-serif", wrap: go.TextBlock.OverflowEllipsis,alignment: go.Spot.Left},
                                       new go.Binding("text", "text")
                                   )
                               ), 
                               //可疑交易
                               GO(go.Panel, "Auto",{stretch: go.GraphObject.Horizontal},// 与节点同宽
                                   GO(go.Shape, 
                                       {width: 260, height:28,fill: "transparent",strokeWidth: 0,figure: "Border"}
                                   ), 
                                   GO(go.Picture, { source: "/static/img/connection.png", background: "transparent", width: 23, height: 11 ,alignment: go.Spot.Left,margin: new go.Margin(0,0,0,6)}
                                   ),
                                   GO(go.TextBlock, 
                                       {height:28, stroke: "#000",margin: new go.Margin(15,6,5,30), font: " 14px 微软雅黑, Arial, sans-serif", wrap: go.TextBlock.OverflowEllipsis,alignment: go.Spot.Left},
                                       new go.Binding("text", "classification1")
                                   )
                               ), 
                               //可疑交易内容
                               GO(go.Panel, "Table", 
                                   {name: "TABLE"},
                                   GO(go.TextBlock, 
                                        {width: 200,stroke: "#666", font: "12px 微软雅黑, Arial, sans-serif",margin: new go.Margin(0,0,0,0)},
                                       new go.Binding("text", "", tooltipTextConverter1)
                                   )
                               ),
                               //客户资料
                               GO(go.Panel, "Auto",{stretch: go.GraphObject.Horizontal},// 与节点同宽
                                   GO(go.Shape, 
                                       {width: 260, height:28,fill: "transparent",strokeWidth: 0,figure: "Border"}
                                   ), 
                                   GO(go.Picture, { source: "/static/img/connection.png", background: "transparent", width: 23, height: 11 ,alignment: go.Spot.Left,margin: new go.Margin(0,0,0,6)}
                                   ),
                                   GO(go.TextBlock, 
                                       {height:28, stroke: "#000",margin: new go.Margin(15,6,5,30), font: " 14px 微软雅黑, Arial, sans-serif", wrap: go.TextBlock.OverflowEllipsis,alignment: go.Spot.Left},
                                       new go.Binding("text", "classification2")
                                   )
                               ),
                               //客户资料内容
                               GO(go.Panel, "Table", 
                                   {name: "TABLE"},
                                   GO(go.TextBlock, "Yes",
                                       {width: 200,stroke: "#666", font: "12px 微软雅黑, Arial, sans-serif",margin: new go.Margin(0,0,10,0)},
                                   new go.Binding("text", "", tooltipTextConverter2)
                                   )
                               )
                           )
                       );
                      // 单笔线交易弹窗
                      var commonToolTipLink =GO(go.Adornment, "Auto",
                          GO(go.Shape, {width: 160, height:80,fill: "#fff",stroke: "#7ecbfa",strokeWidth: 1,figure: "Border" }), 
                          GO(go.Panel, "Table", 
                              {name: "TABLE"},
                              GO(go.TextBlock, 
                                  {width: 140,stroke: "#666", font: "12px 微软雅黑, Arial, sans-serif",margin: new go.Margin(10,10,10,10)},
                                  new go.Binding("text", "", tooltipTextConverterLink)
                              )
                          ),
                       ); 
                    // 双笔线交易弹窗
                    var commonToolTipDoubleLink = GO(go.Adornment, "Auto",
                        GO(go.Shape, 
                            {width: 371,fill: "#fff",stroke: "#7ecbfa",strokeWidth: 1,figure: "Border"}
                        ), 
                        GO(go.Panel, go.Panel.Vertical, 
                            {
                                background: "#F5F5F5",
                                alignment: go.Spot.Center
                                //verticalAlignment: go.Spot.Center
                            },
                            //top
                            GO(go.Panel, "Horizontal", {}, // 定义一行  一行的容器 
                                GO(go.Panel, "Auto", {}, // 定义一行  一行的容器 
                                    GO(go.Shape, {width: 210,height: 30,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border",margin: new go.Margin(0, 0, 0, 0)}
                                    ),
                                    GO(go.Picture, 
                                        {source: "/static/img/alarmClock.png",background: "transparent",width: 14,height: 14,margin: new go.Margin(0, 0, 0, 6),alignment: go.Spot.Left}
                                    ),
                                    GO(go.TextBlock, 
                                        {width: 210,stroke: "#fff",font: "12px 微软雅黑, Arial, sans-serif",margin: new go.Margin(0, 0, 0, 26),alignment: go.Spot.Left},
                                        new go.Binding("text", "", tooltipTextConverterDoubleLinkTime)
                                    )

                                ),
                                GO(go.Panel, "Auto", {}, // 定义一行  一行的容器 
                                    GO(go.Shape, {width: 160,height: 30,fill: "#7ecbfa",stroke: '',strokeWidth: 0,figure: "Border"}
                                    ),
                                    GO(go.TextBlock, 
                                        {width: 160,stroke: "#fff",font: "12px 微软雅黑, Arial, sans-serif"},
                                        new go.Binding("text", "", tooltipTextConverterDoubleLinkAccumulative)
                                    )
                                )
                            ),
                            GO(go.Panel, "Horizontal", {}, // 与节点同宽
                                GO(go.Panel, "Auto", {}, // 与节点同宽
                                    GO(go.Shape, {width: 130,height: 60,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                    GO(go.TextBlock, 
                                        {width: 130,stroke: "#fff",font: "14px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                        new go.Binding("text", "", tooltipTextConverterDoubleLinkTxtLeft)
                                    )
                                ),
                                GO(go.Panel, "Auto", {}, // 与节点同宽
                                    GO(go.Shape, {width: 110,height: 60,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                    GO(go.Panel, "Vertical", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                        GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Shape, {width: 110,height: 23,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                            GO(go.TextBlock, 
                                                {width: 110,stroke: "#fff",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center",margin:new go.Margin(5,0,0,0)},
                                                new go.Binding("text", "", tooltipTextConverterDoubleLinkTxtCenterTop)
                                            )
                                        ),
                                        GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Shape, {width: 110,height: 14,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                            GO(go.Picture, {source: "/static/img/arrowheadLine.png",background: "transparent",width: 103,height: 14}
                                            )
                                        ),
                                        GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Shape, {width: 110,height: 23,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                            GO(go.TextBlock, 
                                                {width: 110,stroke: "#fff",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                                new go.Binding("text", "", tooltipTextConverterDoubleLinkTxtCenterBottom)
                                            )
                                        )
                                    )
                                ),
                                GO(go.Panel, "Auto", {}, // 与节点同宽
                                    GO(go.Shape, {width: 130,height: 60,fill: "#7ecbfa",stroke: "",strokeWidth: 0,figure: "Border"}),
                                    GO(go.TextBlock, 
                                        {width: 130,stroke: "#fff",font: "14px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                        new go.Binding("text", "", tooltipTextConverterDoubleLinkTxtRight)
                                    )
                                )
                            ),
                            //bottom
                            GO(go.Panel, "Vertical", {
                                //定义数组模版
                                itemTemplate: GO(go.Panel, "Horizontal",
                                    GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                        GO(go.Shape, {width: 130,height: 56,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                        GO(go.Panel, "Vertical", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                                GO(go.Shape, {width: 130,height: 56,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                                GO(go.TextBlock,
                                                    {width: 130,stroke: "#666",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                                    new go.Binding("text", "", tooltipDoubleLinkBankLeft)
                                                )
                                            )
                                        )
                                    ), //第1个Auto的括号
                                    GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                        GO(go.Shape, {width: 110,height: 56,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                        GO(go.Panel, "Vertical", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                                GO(go.Shape, {width: 110,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                                GO(go.TextBlock, {width: 110,stroke: "#20bbf4",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                                    new go.Binding("text", "", tooltipDoubleLinkBankMoney),
                                                    new go.Binding("stroke","arrowheadLine",function(val){
                                                        return val ==="left" ? "#f66957" : "#20bbf4"
                                                    })
                                                )
                                            ),
                                            GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                                GO(go.Shape, {width: 110,height: 5,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                                GO(go.Picture, {source: "/static/img/arrowheadLineRight.png",background: "transparent",width: 83,height: 5}, 
                                                    new go.Binding("source", "arrowheadLine", function(val) {
                                                    return val === "left" ? "/static/img/arrowheadLineLeft.png" : "/static/img/arrowheadLineRight.png"
                                                }))
                                            ),
                                            GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                                GO(go.Shape, {width: 110,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                                GO(go.TextBlock, 
                                                    {width: 110,stroke: "#999",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                                    new go.Binding("text", "", tooltipDoubleLinkBankTimer)
                                                )
                                            )
                                        )
                                    ), //第2个Auto的括号
                                    GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                        GO(go.Shape, {width: 130,height: 56,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                        GO(go.Panel, "Vertical", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                            GO(go.Panel, "Auto", {stretch: go.GraphObject.Horizontal}, // 与节点同宽
                                                GO(go.Shape, {width: 130,height: 56,fill: "#fff",stroke: "",strokeWidth: 0,figure: "Border"}),
                                                GO(go.TextBlock, 
                                                    {width: 130,stroke: "#666",font: "12px 微软雅黑, Arial, sans-serif",textAlign:"center"},
                                                    new go.Binding("text", "", tooltipDoubleLinkBankRight)
                                                )
                                            )
                                        )
                                    ) //第3个Auto的括号
                                )
                            }, new go.Binding("itemArray"))
                        ) //go.Panel的括号
                    );
                    //可疑交易数据展示
                    function tooltipTextConverter1(person){
                          var str = "";    
                          var shoukuan = person.shoukuan;    
                          var fukuan = person.fukuan;        
                          if(person.time !== undefined){
                              str += "时间:" + person.time+"";
                          }else{
                              str += "时间:  \\\ ";
                          } 
                         if(shoukuan !== undefined){
                             let filter = shoukuan.match(/\d{2,}/g);
                             if(filter){
                                 let num = parseInt(filter);
                                 let unit = shoukuan.split(num)[1];
                                 let type = shoukuan.split(num)[0];
                                 str += "\n收款:" + type + num.toLocaleString() + unit; 
                             }else{
                                 str += "\n收款:" + shoukuan;
                             }
                         }else{
                             str += "\n收款:  \\\ ";
                         } 
                         if(fukuan !== undefined){
                             let filter = fukuan.match(/\d{2,}/g);
                              if(filter){
                                  let num = parseInt(filter);
                                  let unit = fukuan.split(num)[1];
                                  let type = fukuan.split(num)[0];
                                  str += "\n付款: " + type + num.toLocaleString() + unit;
                              }else{
                                  str += "\n付款: " + fukuan;
                              }
                         }else{
                             str += "\n付款:  \\\ ";
                         } 
                         return str;
                    }
                    //客户资料内容数据展示
                    function tooltipTextConverter2(person){
                          var str = "";    
                          var income = person.income;    
                          var total = person.total;    

                          if(person.objective !== undefined){
                              str += "开户目的:" + person.objective+"";
                          }else{
                              str += "开户目的:  \\\ ";
                          } 
                         if(person.capital !== undefined){
                             str += "\n交易方式: " + person.capital+"";
                         }else{
                             str += "\n交易方式:  \\\ ";
                         } 
                         if(income !== undefined){
                              let filter = income.match(/\d{2,}/g);
                              if(filter){
                                  let num = parseInt(filter);
                                  let unit = income.split(num)[1];
                                  let type = income.split(num)[0];
                                  str += "\n收入: " + type + num.toLocaleString() + unit;
                              }else{
                                  str +=income;
                              }
                         }else{
                             str += "\n收入:  \\\ ";
                         } 
                         if(total !== undefined){
                              let filter = total.match(/\d{2,}/g);
                              if(filter){
                                  let num = parseInt(filter);
                                  let unit = total.split(num)[1];
                                  let type = total.split(num)[0];
                                  str += "\n预计收付总额: " + type + num.toLocaleString() + unit;
                              }else{
                                  str +=total;
                              }
                         }else{
                             str += "\n预计收付总额:  \\\ ";
                         } 
                         if(person.count !== undefined){
                             str += "\n交易次数: " + person.count+"";
                         }else{
                             str += "\n交易次数:  \\\ ";
                         } 
                         return str;
                    }
                    // 单笔线交易数据展示
                    function tooltipTextConverterLink(person){
                          var str = "";                  
                          if(person.SingleLineMoney !== undefined){
                              str += "交易金额:" + person.SingleLineMoney+"";
                          }else{
                              str += "交易金额:  \\\ ";
                          } 
                         if(person.SingleLineTime !== undefined){
                             str += "\n交易时间: " + person.SingleLineTime+"";
                         }else{
                             str += "\n交易时间:  \\\ ";
                         } 
                         if(person.SingleLineCapital !== undefined){
                             str += "\n资金来源: " + person.SingleLineCapital+"";
                         }else{
                             str += "\n资金来源:  \\\ ";
                         } 
                         return str;
                    }
                    // 双笔线交易时间数据展示
                    function tooltipTextConverterDoubleLinkTime(person){
                          var str = "";                  
                          if(person.SingleDoubleLineTime !== undefined){
                              str += person.SingleDoubleLineTime+"";
                          }else{
                              str += "  \\\ ";
                          } 
                         return str;
                    }
                    // 双笔线交易累计数据展示
                    function tooltipTextConverterDoubleLinkAccumulative(person){
                          var str = "";    
                          let money = person.SingleDoubleLineAccumulative;              
                         if(money !== undefined){
                              let filter = money.match(/\d{2,}/g);
                              if(filter){
                                  let num = parseInt(filter);
                                  let unit = money.split(num)[1];
                                  let type = money.split(num)[0];
                                  str += "累计:" + type + num.toLocaleString() + unit;
                              }else{
                                  str +=money;
                              }
                         }else{
                             str += "累计: ";
                         }  
                         return str;
                    }
                    // 双笔线交易txtLeft数据展示
                    function tooltipTextConverterDoubleLinkTxtLeft(person){
                          var str = "";                  
                         if(person.SingleDoubleLineTxtLeft !== undefined){
                             str += person.SingleDoubleLineTxtLeft+"";
                         }else{
                             str += " \\\ ";
                         }  
                         return str;
                    }
                    // 双笔线交易txtRight数据展示
                    function tooltipTextConverterDoubleLinkTxtRight(person){
                          var str = "";                  
                         if(person.SingleDoubleLineTxtRight !== undefined){
                             str += person.SingleDoubleLineTxtRight+"";
                         }else{
                             str += " \\\ ";
                         }  
                         return str;
                    }
                    // 双笔线交易txtCenterTop数据展示
                    function tooltipTextConverterDoubleLinkTxtCenterTop(person){
                        //console.log('www',person.SingleDoubleLineTxtCenterTop);
                         var str = "";
                         let money = person.SingleDoubleLineTxtCenterTop;
                         if(money !== undefined) {
                              let filter = money.match(/\d{2,}/g);
                              if(filter){
                                  let num = parseInt(filter);
                                  let unit = money.split(num)[1];
                                  let type = money.split(num)[0];
                                  str += num.toLocaleString() + unit;
                              }else{
                                  str +=money;
                              }
                         } else {
                             str += "\\\ ";
                         } 
                         return str;
                    }
                    // 双笔线交易txtCenterTop数据展示
                    function tooltipTextConverterDoubleLinkTxtCenterBottom(person) {
                        //console.log('www',person.SingleDoubleLineTxtCenterBottom);
                        var str = "";
                        let money = person.SingleDoubleLineTxtCenterBottom;
                        // 0笔
                        if(money !== undefined) {
                            let filter = money.match(/\d{2,}/g);
                            if(filter){
                                let num =  parseInt(filter);
                                let unit = money.split(num)[1];
                                let type = money.split(num)[0]; 
                                str += num.toLocaleString() + unit;
                            }else{
                                str += money;
                            }    
                        } else {
                            str += " \\\ ";
                        } 
                        return str;
                    }
                    // 以下为详情 - 双笔线交易txtCenter数据展示
                    function tooltipDoubleLinkBankLeft(person) {
                        var str = "";
                        if(person.singleDoubleLinkTxtBankLeft !== undefined) {
                            str += person.singleDoubleLinkTxtBankLeft + "";
                        } else {
                            str += " \\\ ";
                        }
                        return str;
                    }
                    // 以下为详情 - 双笔线交易txtCenter数据展示
                    function tooltipDoubleLinkBankRight(person) {
                        var str = "";
                        if(person.singleDoubleLinkTxtBankRight !== undefined) {
                            str += person.singleDoubleLinkTxtBankRight + "";
                        } else {
                            str += " \\\ ";
                        }
                        return str;
                    }
                    // 以下为详情 - 双笔线交易txtCenter数据展示
                    function tooltipDoubleLinkBankCardNumberLeft(person) {
                        var str = "";
                        /*if(person.singleDoubleLinkTxtBankCardNumberLeft !== undefined) {
                            str += "\n" + person.singleDoubleLinkTxtBankCardNumberLeft + "";
                        } else {
                            str += "\n \\\ ";
                        }*/
                        return str;
                    }
                    function tooltipDoubleLinkBankCardNumberRight(person) {
                        var str = "";
                        /*if(person.singleDoubleLinkTxtBankCardNumberRight !== undefined) {
                            str += "\n" + person.singleDoubleLinkTxtBankCardNumberRight + "";
                        } else {
                            str += "\n \\\ ";
                        }*/
                        return str;
                    }
                    // 以下为详情 - 双笔线交易txtCenter数据展示
                    function tooltipDoubleLinkBankMoney(person) {
                        //console.log('ttt',person.singleDoubleLinkTxtBankCardMoney);
                        var str = "";
                        let money = person.singleDoubleLinkTxtBankCardMoney;
                        if(money !== undefined) {
                             let filter = money.match(/\d{2,}/g);
                             if(filter){
                                 let num = parseInt(filter);
                                 let unit = money.split(num)[1];
                                 let type = money.split(num)[0];
                                 str += type + num.toLocaleString() + unit;
                             }else{
                                 str +=money;
                             }
                        } else {
                            str += " \\\ ";
                        }
                        return str;
                    }
                    // 以下为详情 - 双笔线交易txtCenter数据展示
                    function tooltipDoubleLinkBankTimer(person) {
                        var str = "";
                        if (person.singleDoubleLinkTxtBankCardTimer !== undefined) {
                            str += person.singleDoubleLinkTxtBankCardTimer + "";
                        } else {
                            str += " \\\ ";
                        }
                        return str;
                    }
                    myDiagram.nodeTemplate = GO(go.Node, "Spot", 
                        {
                            locationSpot: go.Spot.Center,
                            locationObjectName: "SHAPE",
                            selectionAdorned: false,
                            click: nodeClicked,
                            toolTip: commonToolTipNode,
                        },
                        GO(go.Shape, "Circle", 
                            {
                                name: "SHAPE",
                                fill: "transparent", // default value, but also data-bound
                                stroke: "transparent",
                                strokeWidth: 2,
                                desiredSize: new go.Size(20, 20)
                            } 
                        ),
                        GO(go.Picture, 
                            {
                                margin: 0,
                                width: 24,
                                height: 24
                            },
                            new go.Binding("source", "type", convertKeyImage)
                        ),
                        GO(go.TextBlock, {
                                name: "TEXTBLOCK",
                                alignment: go.Spot.Right,
                                alignmentFocus: go.Spot.Left
                            },
                            //new go.Binding("text")
                        )
                    );


                    myDiagram.nodeTemplateMap.add("Root",
                        GO(go.Node, "Auto", {
                                locationSpot: go.Spot.Center,
                                selectionAdorned: false

                            },
                            GO(go.Shape, "Circle", {
                                fill: "transparent",
                                stroke: "#cccccc"
                            }),
                            GO(go.Picture, {
                                source: "../../../static/img/companyLogo.png",
                                background: "transparent",
                                width: 50,
                                height: 50
                            })
                        )
                    );
                    //单方向箭头
                    myDiagram.linkTemplate = GO(go.Link, 
                        {
                            routing: go.Link.Normal,
                            curve: go.Link.None, //Bezier,None
                            selectionAdorned: false,
                            layerName: "Background",
                            toolTip: commonToolTipDoubleLink,
                        },
                        GO(go.Shape, 
                            {strokeWidth: 0.8,stroke: "#616161"}, 
                            {
                                mouseEnter: function(e, obj) {
                                    obj.stroke = "#00a8ff";
                                    //obj.strokeWidth = 1.5;
                                },
                                mouseLeave: function(e, obj) {
                                    obj.stroke = "#616161";
                                    //obj.strokeWidth = obj.strokeWidth;
                                },
                                cursor: "pointer"
                            },
                            new go.Binding("strokeWidth", "strokeWidth")
                        ),
                           //如果我们要显示箭头,就应该定义一个有箭头的形状
                           GO(go.Shape, 
                               { 
                                toArrow: "Standard", 
                                stroke: "#616161" ,
                                //toShortLength:4,
                                //segmentIndex: Infinity
                                //segmentFraction:1,
                                segmentOffset: new go.Point(-10, 0)
                               },
                               //修改箭头背景
                               new go.Binding("fill", "",function(){
                                   return "#616161";
                               })
                        ),
                           //修改线条颜色
                           GO(go.TextBlock,
                               { 
                                   textAlign: "center",
                                       font: "8pt Verdana, sans-serif",
                                   stroke: "#616161",
                                   margin: 0 
                               }
                           )
                    ); 

                    //双方向箭头
                    myDiagram.linkTemplateMap.add("double",
                        GO(go.Link, {
                                routing: go.Link.Normal,
                                curve: go.Link.None, //Bezier,None
                                selectionAdorned: false,
                                layerName: "Background",
                                toolTip: commonToolTipDoubleLink,
                            },
                            GO(go.Shape, {
                                    strokeWidth: 0.8,
                                    stroke: "#616161"
                                }, {
                                    mouseEnter: function(e, obj) {
                                        obj.stroke = "#00a8ff";
                                        //obj.strokeWidth = 1.5;
                                    },
                                    mouseLeave: function(e, obj) {
                                        obj.stroke = "#616161";
                                        //obj.strokeWidth = 0.8;
                                    },
                                    cursor: "pointer"
                                },
                                new go.Binding("strokeWidth", "strokeWidth")
                            ),
                            //如果我们要显示箭头,就应该定义一个有箭头的形状
                            GO(go.Shape, {
                                    fromArrow: "Backward",
                                    stroke: "#616161",
                                    segmentOffset: new go.Point(10, 0)
                                },
                                //修改箭头背景
                                new go.Binding("fill", "", function() {
                                    return "#616161";
                                })
                            ),
                            GO(go.Shape, {
                                    toArrow: "Standard",
                                    stroke: "#616161",
                                    toShortLength: 4,
                                    segmentOffset: new go.Point(-10, 0)
                                },
                                //修改箭头背景
                                new go.Binding("fill", "", function() {
                                    return "#616161";
                                })
                            ),
                            //修改线条颜色
                            GO(go.TextBlock, {
                                textAlign: "center",
                                font: "8pt Verdana, sans-serif",
                                stroke: "#616161",
                                margin: 0
                            })
                        )
                    );
                    generateGraph();
                }
                function generateGraph() {
                    // var nodeDataArray =[
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":0,"text":"a","type":1,"time":"2015-09-08至2016-06-12","shoukuan":"1111万元/3笔","fukuan":"1011万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":1,"text":"b","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"2222万元/3笔","fukuan":"1012万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":2,"text":"c","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"3333万元/3笔","fukuan":"1013万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":3,"text":"d","type":4,"time":"2015-09-08至2016-06-12","shoukuan":"4444万元/3笔","fukuan":"1014万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":4,"text":"e","type":4,"time":"2015-09-08至2016-06-12","shoukuan":"5555万元/3笔","fukuan":"1015万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":5,"text":"f","type":1,"time":"2015-09-08至2016-06-12","shoukuan":"11sadf11万元/3笔","fukuan":"1016万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":6,"text":"g","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11f11万元/3笔","fukuan":"1017万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":7,"text":"h","type":1,"time":"2015-09-08至2016-06-12","shoukuan":"51f11万元/3笔","fukuan":"1018万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":8,"text":"i","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"1s111万元/3笔","fukuan":"1019万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":9,"text":"j","type":1,"time":"2015-09-08至2016-06-12","shoukuan":"11151万元/3笔","fukuan":"1020万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":10,"text":"k","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11e511万元/3笔","fukuan":"1021万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":11,"text":"l","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"1111万元/3笔","fukuan":"1022万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":12,"text":"m","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11t411万元/3笔","fukuan":"1023万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":13,"text":"n","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"1111e万元/3笔","fukuan":"1024万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":14,"text":"o","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"111fs1万元/3笔","fukuan":"1025万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":15,"text":"p","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"e11t11万元/3笔","fukuan":"1026万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":16,"text":"q","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11f11万元/3笔","fukuan":"1027万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":17,"text":"r","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"1111万元/3笔","fukuan":"10128万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":18,"text":"s","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11t1re1万元/3笔","fukuan":"10129万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":19,"text":"t","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11e11万元/3笔","fukuan":"1030万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":20,"text":"u","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"1111万元/3笔","fukuan":"1031万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":21,"text":"v","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"1111万元/3笔","fukuan":"10132万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":22,"text":"w","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11ge1万元/3笔","fukuan":"10133万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":23,"text":"x","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"11f1e1万元/3笔","fukuan":"10134万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":24,"text":"y","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"111d1万元/3笔","fukuan":"10135万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":25,"text":"z","type":2,"time":"2015-09-08至2016-06-12","shoukuan":"111g1t万元/3笔","fukuan":"10136万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":26,"text":"aa","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"11df11万元/3笔","fukuan":"10137万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":27,"text":"bb","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"11fg11万元/3笔","fukuan":"10138万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":28,"text":"cc","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"111ds1万元/3笔","fukuan":"10139万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":29,"text":"dd","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"11dd11万元/3笔","fukuan":"1040万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":30,"text":"ee","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"11gas11万元/3笔","fukuan":"1041万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":31,"text":"ff","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"111dd1万元/3笔","fukuan":"1042万元/2笔"},
                    //     {"nodeImg":"personnel","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":32,"text":"gg","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"111ss1万元/3笔","fukuan":"1043万元/2笔"},
                    //     {"nodeImg":"","count":"26-50笔","total":"10W-50W港币","income":"10万-20万港币","capital":"受雇资金","objective":"储蓄","classification1":"可疑交易","classification2":"客户资料","key":33,"text":"hh","type":3,"time":"2015-09-08至2016-06-12","shoukuan":"11fd11万元/3笔","fukuan":"1044万元/2笔"}
                    // ]
                    // var linkDataArray =[
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 3,
                    //         "to": 27,
                    //         "color": "#673213",
                    //         "category": "double",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 3,
                    //         "to": 26,
                    //         "color": "#673213",
                    //         "category": "",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 3,
                    //         "to": 28,
                    //         "color": "#673213",
                    //         "category": "double",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 3,
                    //         "to": 29,
                    //         "color": "#673213",
                    //         "category": "",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 26,
                    //         "to": 0,
                    //         "color": "#673213",
                    //         "category": "double",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 27,
                    //         "to": 1,
                    //         "color": "#673213",
                    //         "category": "",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 28,
                    //         "to": 2,
                    //         "color": "#673213",
                    //         "category": "double",
                    //         "strokeWidth": 2
                    //     },
                    //     {
                    //         "itemArray": [
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "1111111111",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港1",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港111"
                    //             }, 
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "22222222",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港222"
                    //             },
                    //             {
                    //                 "singleDoubleLinkTxtBankCardNumberLeft": "6228352739773665",
                    //                 "singleDoubleLinkTxtBankCardNumberRight": "33333333",
                    //                 "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //                 "singleDoubleLinkTxtBankCardMoney": "汇款155万",
                    //                 "singleDoubleLinkTxtBankLeft": "中国香港2",
                    //                 "singleDoubleLinkTxtBankRight": "中国香港2",
                    //                 "arrowheadLine": "left"
                    //             }
                    //         ],
                            
                    //         "singleDoubleLinkTxtBankCardMoney": "转账125万",
                    //         "singleDoubleLinkTxtBankCardTimer": "2018-08-16",
                    //         "SingleDoubleLineTxtCenterBottom": "126万/14笔",
                    //         "SingleDoubleLineTxtCenterTop": "125万/13笔",
                    //         "SingleDoubleLineTxtLeft": "中国电力",
                    //         "SingleDoubleLineTxtRight": "中国水利",
                    //         "SingleDoubleLineAccumulative": "4770万元/26笔",
                    //         "SingleDoubleLineTime": "2015-03-30 - 2016-07-31",
                    //         "SingleLineCapital": "转账",
                    //         "SingleLineTime": "2018-06-02",
                    //         "SingleLineMoney": "10000元",
                    //         "from": 29,
                    //         "to": 4,
                    //         "color": "#673213",
                    //         "category": "",
                    //         "strokeWidth": 2

                    //     },
                    // ]
                       myDiagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
                       var someone = nodeDataArray[0];
                       nodeClicked(null, myDiagram.findNodeForData(someone));
                }

                function nodeClicked(e, root){
                    console.info(root);
                    that.name_id = root.key;
                       that.name = root.Zd.text;
                       console.info(that.name_id);
                       console.info(that.name);
                       var diagram = root.diagram;
                       if (diagram === null) return;
                       // all other nodes should be visible and use the default category
                       diagram.nodes.each(function(n) {
                         n.visible = true;
                         if (n !== root) n.category = "";
                       })
                       // make this Node the root
                       root.category = "Root";
                       // tell the RadialLayout what the root node should be
                       diagram.layout.root = root;
                       diagram.layoutDiagram(true);
                }
                // called when "Set Max Layers" button is clicked
                function adjustMaxLayers() {
                       var newMaxLayers = parseInt(document.getElementById('maxLayersChanger').value);
                       function isInteger(val) {
                         return typeof val === 'number' &&
                           isFinite(val) &&
                           Math.floor(val) === val;
                       }
                       if (!isInteger(newMaxLayers) || newMaxLayers < 1 || newMaxLayers > 10) {
                         alert("Please enter an integer larger than zero and less than or equal to 10.");
                       } else {
                         myDiagram.layout.maxLayers = Math.max(1, Math.min(newMaxLayers, 10));
                         nodeClicked(null, myDiagram.layout.root);
                       }
                }
            },

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值