GoJs的二叉树用法

1 篇文章 0 订阅

第一次写博客。

这个二叉树只想着只用,不喜勿喷。

先导入js文件
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.7.2/go-debug.js"></script>

不过最好是自己去官网下载 https://gojs.net/latest/doc/download.html

导入js后写个方法js方法 init(),在页面加载时调用就可以了

function init() {
    var $ = go.GraphObject.make;
    var myDiagram =  $(go.Diagram, "myDiagramDiv",
        {
          initialContentAlignment: go.Spot.Center, // center Diagram contents
          "undoManager.isEnabled": true, // enable Ctrl-Z to undo and Ctrl-Y to redo
          layout: $(go.TreeLayout, // specify a Diagram.layout that arranges trees
                    { angle: 90, layerSpacing: 35 })
        });


    // the template we defined earlier
    myDiagram.nodeTemplate =
      $(go.Node, "Horizontal",
        { background: "#44CCFF" },
        $(go.TextBlock, "Default Text",
          { margin: 3, stroke: "white", font: "bold 14px sans-serif" },
          new go.Binding("text", "name")),
          $(go.TextBlock, "Default Text",
        { margin: 3, stroke: "white", font: "bold 12px sans-serif" },
              new go.Binding("text", "title"))
      );


    var model = $(go.TreeModel);
    //var data = JSON.parse("${list}");
    model.nodeDataArray = [{"key":"16","name":"IP地址:10.0.0.0/23","title":"用途:预留","parent":"",},{"key":"17","name":"IP地址:10.0.0.0/24","title":"用途:预留","parent":"16",},{"key":"18","name":"IP地址:10.0.0.0/25","title":"用途:预留","parent":"17",},{"key":"19","name":"IP地址:10.0.0.0/26","title":"用途:预留","parent":"18",},{"key":"20","name":"IP地址:10.0.0.0/27","title":"用途:预留","parent":"19",},{"key":"21","name":"IP地址:10.0.0.0/28","title":"用途:测试机","parent":"20",},{"key":"22","name":"IP地址:10.0.0.0/29","title":"用途:交换机","parent":"21",},{"key":"23","name":"IP地址:10.0.0.0/30","title":"用途:交换机","parent":"22",},{"key":"24","name":"IP地址:10.0.0.4/30","title":"用途:交换机","parent":"22",},{"key":"25","name":"IP地址:10.0.0.8/29","title":"用途:交换机","parent":"21",},{"key":"26","name":"IP地址:10.0.0.8/30","title":"用途:交换机","parent":"25",},{"key":"27","name":"IP地址:10.0.0.12/30","title":"用途:交换机","parent":"25",},{"key":"28","name":"IP地址:10.0.0.16/28","title":"用途:预留","parent":"20",},{"key":"29","name":"IP地址:10.0.0.16/29","title":"用途:预留","parent":"28",},{"key":"30","name":"IP地址:10.0.0.16/30","title":"用途:预留","parent":"29",},{"key":"31","name":"IP地址:10.0.0.20/30","title":"用途:预留","parent":"29",},{"key":"32","name":"IP地址:10.0.0.24/29","title":"用途:预留","parent":"28",},{"key":"33","name":"IP地址:10.0.0.24/30","title":"用途:预留","parent":"32",},{"key":"34","name":"IP地址:10.0.0.28/30","title":"用途:预留","parent":"32",},{"key":"35","name":"IP地址:10.0.0.32/27","title":"用途:预留","parent":"19",},{"key":"36","name":"IP地址:10.0.0.32/28","title":"用途:预留","parent":"35",},{"key":"37","name":"IP地址:10.0.0.32/29","title":"用途:预留","parent":"36",},{"key":"38","name":"IP地址:10.0.0.32/30","title":"用途:预留","parent":"37",},{"key":"39","name":"IP地址:10.0.0.36/30","title":"用途:预留","parent":"37",},{"key":"40","name":"IP地址:10.0.0.40/29","title":"用途:预留","parent":"36",},{"key":"41","name":"IP地址:10.0.0.40/30","title":"用途:预留","parent":"40",},{"key":"42","name":"IP地址:10.0.0.44/30","title":"用途:预留","parent":"40",},{"key":"43","name":"IP地址:10.0.0.48/28","title":"用途:预留","parent":"35",},{"key":"44","name":"IP地址:10.0.0.48/29","title":"用途:预留","parent":"43",},{"key":"45","name":"IP地址:10.0.0.48/30","title":"用途:预留","parent":"44",},{"key":"46","name":"IP地址:10.0.0.52/30","title":"用途:预留","parent":"44",},{"key":"47","name":"IP地址:10.0.0.56/29","title":"用途:预留","parent":"43",},{"key":"48","name":"IP地址:10.0.0.56/30","title":"用途:预留","parent":"47",},{"key":"49","name":"IP地址:10.0.0.60/30","title":"用途:预留","parent":"47",},{"key":"50","name":"IP地址:10.0.0.64/26","title":"用途:预留","parent":"18",},{"key":"51","name":"IP地址:10.0.0.64/27","title":"用途:预留","parent":"50",},{"key":"52","name":"IP地址:10.0.0.64/28","title":"用途:预留","parent":"51",},{"key":"53","name":"IP地址:10.0.0.64/29","title":"用途:预留","parent":"52",},{"key":"54","name":"IP地址:10.0.0.64/30","title":"用途:预留","parent":"53",},{"key":"55","name":"IP地址:10.0.0.68/30","title":"用途:预留","parent":"53",},{"key":"56","name":"IP地址:10.0.0.72/29","title":"用途:预留","parent":"52",},{"key":"57","name":"IP地址:10.0.0.72/30","title":"用途:预留","parent":"56",},{"key":"58","name":"IP地址:10.0.0.76/30","title":"用途:预留","parent":"56",},{"key":"59","name":"IP地址:10.0.0.80/28","title":"用途:预留","parent":"51",},{"key":"60","name":"IP地址:10.0.0.80/29","title":"用途:预留","parent":"59",},{"key":"61","name":"IP地址:10.0.0.80/30","title":"用途:预留","parent":"60",},{"key":"62","name":"IP地址:10.0.0.84/30","title":"用途:预留","parent":"60",},{"key":"63","name":"IP地址:10.0.0.88/29","title":"用途:预留","parent":"59",},{"key":"64","name":"IP地址:10.0.0.88/30","title":"用途:预留","parent":"63",},{"key":"65","name":"IP地址:10.0.0.92/30","title":"用途:预留","parent":"63",},{"key":"66","name":"IP地址:10.0.0.96/27","title":"用途:预留","parent":"50",},{"key":"67","name":"IP地址:10.0.0.96/28","title":"用途:预留","parent":"66",},{"key":"68","name":"IP地址:10.0.0.96/29","title":"用途:预留","parent":"67",},{"key":"69","name":"IP地址:10.0.0.96/30","title":"用途:预留","parent":"68",},{"key":"70","name":"IP地址:10.0.0.100/30","title":"用途:预留","parent":"68",},{"key":"71","name":"IP地址:10.0.0.104/29","title":"用途:预留","parent":"67",},{"key":"72","name":"IP地址:10.0.0.104/30","title":"用途:预留","parent":"71",},{"key":"73","name":"IP地址:10.0.0.108/30","title":"用途:预留","parent":"71",},{"key":"74","name":"IP地址:10.0.0.112/28","title":"用途:预留","parent":"66",},{"key":"75","name":"IP地址:10.0.0.112/29","title":"用途:预留","parent":"74",},{"key":"76","name":"IP地址:10.0.0.112/30","title":"用途:预留","parent":"75",},{"key":"77","name":"IP地址:10.0.0.116/30","title":"用途:预留","parent":"75",},{"key":"78","name":"IP地址:10.0.0.120/29","title":"用途:预留","parent":"74",},{"key":"79","name":"IP地址:10.0.0.120/30","title":"用途:预留","parent":"78",},{"key":"80","name":"IP地址:10.0.0.124/30","title":"用途:预留","parent":"78",},{"key":"81","name":"IP地址:10.0.0.128/25","title":"用途:null","parent":"17",},{"key":"82","name":"IP地址:10.0.0.128/26","title":"用途:null","parent":"81",},{"key":"83","name":"IP地址:10.0.0.128/27","title":"用途:null","parent":"82",},{"key":"84","name":"IP地址:10.0.0.128/28","title":"用途:null","parent":"83",},{"key":"85","name":"IP地址:10.0.0.128/29","title":"用途:null","parent":"84",},{"key":"86","name":"IP地址:10.0.0.128/30","title":"用途:null","parent":"85",},{"key":"87","name":"IP地址:10.0.0.132/30","title":"用途:null","parent":"85",},{"key":"88","name":"IP地址:10.0.0.136/29","title":"用途:null","parent":"84",},{"key":"89","name":"IP地址:10.0.0.136/30","title":"用途:null","parent":"88",},{"key":"90","name":"IP地址:10.0.0.140/30","title":"用途:null","parent":"88",},{"key":"91","name":"IP地址:10.0.0.144/28","title":"用途:null","parent":"83",},{"key":"92","name":"IP地址:10.0.0.144/29","title":"用途:null","parent":"91",},{"key":"93","name":"IP地址:10.0.0.144/30","title":"用途:null","parent":"92",},{"key":"94","name":"IP地址:10.0.0.148/30","title":"用途:null","parent":"92",},{"key":"95","name":"IP地址:10.0.0.152/29","title":"用途:null","parent":"91",},{"key":"96","name":"IP地址:10.0.0.152/30","title":"用途:null","parent":"95",},{"key":"97","name":"IP地址:10.0.0.156/30","title":"用途:null","parent":"95",},{"key":"98","name":"IP地址:10.0.0.160/27","title":"用途:null","parent":"82",},{"key":"99","name":"IP地址:10.0.0.160/28","title":"用途:null","parent":"98",},{"key":"100","name":"IP地址:10.0.0.160/29","title":"用途:null","parent":"99",},{"key":"101","name":"IP地址:10.0.0.160/30","title":"用途:null","parent":"100",},{"key":"102","name":"IP地址:10.0.0.164/30","title":"用途:null","parent":"100",},{"key":"103","name":"IP地址:10.0.0.168/29","title":"用途:null","parent":"99",},{"key":"104","name":"IP地址:10.0.0.168/30","title":"用途:null","parent":"103",},{"key":"105","name":"IP地址:10.0.0.172/30","title":"用途:null","parent":"103",},{"key":"106","name":"IP地址:10.0.0.176/28","title":"用途:null","parent":"98",},{"key":"107","name":"IP地址:10.0.0.176/29","title":"用途:null","parent":"106",},{"key":"108","name":"IP地址:10.0.0.176/30","title":"用途:null","parent":"107",},{"key":"109","name":"IP地址:10.0.0.180/30","title":"用途:null","parent":"107",},{"key":"110","name":"IP地址:10.0.0.184/29","title":"用途:null","parent":"106",},{"key":"111","name":"IP地址:10.0.0.184/30","title":"用途:null","parent":"110",},{"key":"112","name":"IP地址:10.0.0.188/30","title":"用途:null","parent":"110",},{"key":"113","name":"IP地址:10.0.0.192/26","title":"用途:null","parent":"81",},{"key":"114","name":"IP地址:10.0.0.192/27","title":"用途:null","parent":"113",},{"key":"115","name":"IP地址:10.0.0.192/28","title":"用途:null","parent":"114",},{"key":"116","name":"IP地址:10.0.0.192/29","title":"用途:null","parent":"115",},{"key":"117","name":"IP地址:10.0.0.192/30","title":"用途:null","parent":"116",},{"key":"118","name":"IP地址:10.0.0.196/30","title":"用途:null","parent":"116",},{"key":"119","name":"IP地址:10.0.0.200/29","title":"用途:null","parent":"115",},{"key":"120","name":"IP地址:10.0.0.200/30","title":"用途:null","parent":"119",},{"key":"121","name":"IP地址:10.0.0.204/30","title":"用途:null","parent":"119",},{"key":"122","name":"IP地址:10.0.0.208/28","title":"用途:null","parent":"114",},{"key":"123","name":"IP地址:10.0.0.208/29","title":"用途:null","parent":"122",},{"key":"124","name":"IP地址:10.0.0.208/30","title":"用途:null","parent":"123",},{"key":"125","name":"IP地址:10.0.0.212/30","title":"用途:null","parent":"123",},{"key":"126","name":"IP地址:10.0.0.216/29","title":"用途:null","parent":"122",},{"key":"127","name":"IP地址:10.0.0.216/30","title":"用途:null","parent":"126",},{"key":"128","name":"IP地址:10.0.0.220/30","title":"用途:null","parent":"126",},{"key":"129","name":"IP地址:10.0.0.224/27","title":"用途:null","parent":"113",},{"key":"130","name":"IP地址:10.0.0.224/28","title":"用途:null","parent":"129",},{"key":"131","name":"IP地址:10.0.0.224/29","title":"用途:null","parent":"130",},{"key":"132","name":"IP地址:10.0.0.224/30","title":"用途:null","parent":"131",},{"key":"133","name":"IP地址:10.0.0.228/30","title":"用途:null","parent":"131",},{"key":"134","name":"IP地址:10.0.0.232/29","title":"用途:null","parent":"130",},{"key":"135","name":"IP地址:10.0.0.232/30","title":"用途:null","parent":"134",},{"key":"136","name":"IP地址:10.0.0.236/30","title":"用途:null","parent":"134",},{"key":"137","name":"IP地址:10.0.0.240/28","title":"用途:null","parent":"129",},{"key":"138","name":"IP地址:10.0.0.240/29","title":"用途:null","parent":"137",},{"key":"139","name":"IP地址:10.0.0.240/30","title":"用途:null","parent":"138",},{"key":"140","name":"IP地址:10.0.0.244/30","title":"用途:null","parent":"138",},{"key":"141","name":"IP地址:10.0.0.248/29","title":"用途:null","parent":"137",},{"key":"142","name":"IP地址:10.0.0.248/30","title":"用途:null","parent":"141",},{"key":"143","name":"IP地址:10.0.0.252/30","title":"用途:null","parent":"141",},{"key":"144","name":"IP地址:10.0.1.0/24","title":"用途:null","parent":"16",},{"key":"145","name":"IP地址:10.0.1.0/25","title":"用途:null","parent":"144",},{"key":"146","name":"IP地址:10.0.1.0/26","title":"用途:null","parent":"145",},{"key":"147","name":"IP地址:10.0.1.0/27","title":"用途:null","parent":"146",},{"key":"148","name":"IP地址:10.0.1.0/28","title":"用途:null","parent":"147",},{"key":"149","name":"IP地址:10.0.1.0/29","title":"用途:null","parent":"148",},{"key":"150","name":"IP地址:10.0.1.0/30","title":"用途:null","parent":"149",},{"key":"151","name":"IP地址:10.0.1.4/30","title":"用途:null","parent":"149",},{"key":"152","name":"IP地址:10.0.1.8/29","title":"用途:null","parent":"148",},{"key":"153","name":"IP地址:10.0.1.8/30","title":"用途:null","parent":"152",},{"key":"154","name":"IP地址:10.0.1.12/30","title":"用途:null","parent":"152",},{"key":"155","name":"IP地址:10.0.1.16/28","title":"用途:null","parent":"147",},{"key":"156","name":"IP地址:10.0.1.16/29","title":"用途:null","parent":"155",},{"key":"157","name":"IP地址:10.0.1.16/30","title":"用途:null","parent":"156",},{"key":"158","name":"IP地址:10.0.1.20/30","title":"用途:null","parent":"156",},{"key":"159","name":"IP地址:10.0.1.24/29","title":"用途:null","parent":"155",},{"key":"160","name":"IP地址:10.0.1.24/30","title":"用途:null","parent":"159",},{"key":"161","name":"IP地址:10.0.1.28/30","title":"用途:null","parent":"159",},{"key":"162","name":"IP地址:10.0.1.32/27","title":"用途:null","parent":"146",},{"key":"163","name":"IP地址:10.0.1.32/28","title":"用途:null","parent":"162",},{"key":"164","name":"IP地址:10.0.1.32/29","title":"用途:null","parent":"163",},{"key":"165","name":"IP地址:10.0.1.32/30","title":"用途:null","parent":"164",},{"key":"166","name":"IP地址:10.0.1.36/30","title":"用途:null","parent":"164",},{"key":"167","name":"IP地址:10.0.1.40/29","title":"用途:null","parent":"163",},{"key":"168","name":"IP地址:10.0.1.40/30","title":"用途:null","parent":"167",},{"key":"169","name":"IP地址:10.0.1.44/30","title":"用途:null","parent":"167",},{"key":"170","name":"IP地址:10.0.1.48/28","title":"用途:null","parent":"162",},{"key":"171","name":"IP地址:10.0.1.48/29","title":"用途:null","parent":"170",},{"key":"172","name":"IP地址:10.0.1.48/30","title":"用途:null","parent":"171",},{"key":"173","name":"IP地址:10.0.1.52/30","title":"用途:null","parent":"171",},{"key":"174","name":"IP地址:10.0.1.56/29","title":"用途:null","parent":"170",},{"key":"175","name":"IP地址:10.0.1.56/30","title":"用途:null","parent":"174",},{"key":"176","name":"IP地址:10.0.1.60/30","title":"用途:null","parent":"174",},{"key":"177","name":"IP地址:10.0.1.64/26","title":"用途:null","parent":"145",},{"key":"178","name":"IP地址:10.0.1.64/27","title":"用途:null","parent":"177",},{"key":"179","name":"IP地址:10.0.1.64/28","title":"用途:null","parent":"178",},{"key":"180","name":"IP地址:10.0.1.64/29","title":"用途:null","parent":"179",},{"key":"181","name":"IP地址:10.0.1.64/30","title":"用途:null","parent":"180",},{"key":"182","name":"IP地址:10.0.1.68/30","title":"用途:null","parent":"180",},{"key":"183","name":"IP地址:10.0.1.72/29","title":"用途:null","parent":"179",},{"key":"184","name":"IP地址:10.0.1.72/30","title":"用途:null","parent":"183",},{"key":"185","name":"IP地址:10.0.1.76/30","title":"用途:null","parent":"183",},{"key":"186","name":"IP地址:10.0.1.80/28","title":"用途:null","parent":"178",},{"key":"187","name":"IP地址:10.0.1.80/29","title":"用途:null","parent":"186",},{"key":"188","name":"IP地址:10.0.1.80/30","title":"用途:null","parent":"187",},{"key":"189","name":"IP地址:10.0.1.84/30","title":"用途:null","parent":"187",},{"key":"190","name":"IP地址:10.0.1.88/29","title":"用途:null","parent":"186",},{"key":"191","name":"IP地址:10.0.1.88/30","title":"用途:null","parent":"190",},{"key":"192","name":"IP地址:10.0.1.92/30","title":"用途:null","parent":"190",},{"key":"193","name":"IP地址:10.0.1.96/27","title":"用途:null","parent":"177",},{"key":"194","name":"IP地址:10.0.1.96/28","title":"用途:null","parent":"193",},{"key":"195","name":"IP地址:10.0.1.96/29","title":"用途:null","parent":"194",},{"key":"196","name":"IP地址:10.0.1.96/30","title":"用途:null","parent":"195",},{"key":"197","name":"IP地址:10.0.1.100/30","title":"用途:null","parent":"195",},{"key":"198","name":"IP地址:10.0.1.104/29","title":"用途:null","parent":"194",},{"key":"199","name":"IP地址:10.0.1.104/30","title":"用途:null","parent":"198",},{"key":"200","name":"IP地址:10.0.1.108/30","title":"用途:null","parent":"198",},{"key":"201","name":"IP地址:10.0.1.112/28","title":"用途:null","parent":"193",},{"key":"202","name":"IP地址:10.0.1.112/29","title":"用途:null","parent":"201",},{"key":"203","name":"IP地址:10.0.1.112/30","title":"用途:null","parent":"202",},{"key":"204","name":"IP地址:10.0.1.116/30","title":"用途:null","parent":"202",},{"key":"205","name":"IP地址:10.0.1.120/29","title":"用途:null","parent":"201",},{"key":"206","name":"IP地址:10.0.1.120/30","title":"用途:null","parent":"205",},{"key":"207","name":"IP地址:10.0.1.124/30","title":"用途:null","parent":"205",},{"key":"208","name":"IP地址:10.0.1.128/25","title":"用途:null","parent":"144",},{"key":"209","name":"IP地址:10.0.1.128/26","title":"用途:null","parent":"208",},{"key":"210","name":"IP地址:10.0.1.128/27","title":"用途:null","parent":"209",},{"key":"211","name":"IP地址:10.0.1.128/28","title":"用途:null","parent":"210",},{"key":"212","name":"IP地址:10.0.1.128/29","title":"用途:null","parent":"211",},{"key":"213","name":"IP地址:10.0.1.128/30","title":"用途:null","parent":"212",},{"key":"214","name":"IP地址:10.0.1.132/30","title":"用途:null","parent":"212",},{"key":"215","name":"IP地址:10.0.1.136/29","title":"用途:null","parent":"211",},{"key":"216","name":"IP地址:10.0.1.136/30","title":"用途:null","parent":"215",},{"key":"217","name":"IP地址:10.0.1.140/30","title":"用途:null","parent":"215",},{"key":"218","name":"IP地址:10.0.1.144/28","title":"用途:null","parent":"210",},{"key":"219","name":"IP地址:10.0.1.144/29","title":"用途:null","parent":"218",},{"key":"220","name":"IP地址:10.0.1.144/30","title":"用途:null","parent":"219",},{"key":"221","name":"IP地址:10.0.1.148/30","title":"用途:null","parent":"219",},{"key":"222","name":"IP地址:10.0.1.152/29","title":"用途:null","parent":"218",},{"key":"223","name":"IP地址:10.0.1.152/30","title":"用途:null","parent":"222",},{"key":"224","name":"IP地址:10.0.1.156/30","title":"用途:null","parent":"222",},{"key":"225","name":"IP地址:10.0.1.160/27","title":"用途:null","parent":"209",},{"key":"226","name":"IP地址:10.0.1.160/28","title":"用途:null","parent":"225",},{"key":"227","name":"IP地址:10.0.1.160/29","title":"用途:null","parent":"226",},{"key":"228","name":"IP地址:10.0.1.160/30","title":"用途:null","parent":"227",},{"key":"229","name":"IP地址:10.0.1.164/30","title":"用途:null","parent":"227",},{"key":"230","name":"IP地址:10.0.1.168/29","title":"用途:null","parent":"226",},{"key":"231","name":"IP地址:10.0.1.168/30","title":"用途:null","parent":"230",},{"key":"232","name":"IP地址:10.0.1.172/30","title":"用途:null","parent":"230",},{"key":"233","name":"IP地址:10.0.1.176/28","title":"用途:null","parent":"225",},{"key":"234","name":"IP地址:10.0.1.176/29","title":"用途:null","parent":"233",},{"key":"235","name":"IP地址:10.0.1.176/30","title":"用途:null","parent":"234",},{"key":"236","name":"IP地址:10.0.1.180/30","title":"用途:null","parent":"234",},{"key":"237","name":"IP地址:10.0.1.184/29","title":"用途:null","parent":"233",},{"key":"238","name":"IP地址:10.0.1.184/30","title":"用途:null","parent":"237",},{"key":"239","name":"IP地址:10.0.1.188/30","title":"用途:null","parent":"237",},{"key":"240","name":"IP地址:10.0.1.192/26","title":"用途:null","parent":"208",},{"key":"241","name":"IP地址:10.0.1.192/27","title":"用途:null","parent":"240",},{"key":"242","name":"IP地址:10.0.1.192/28","title":"用途:null","parent":"241",},{"key":"243","name":"IP地址:10.0.1.192/29","title":"用途:null","parent":"242",},{"key":"244","name":"IP地址:10.0.1.192/30","title":"用途:null","parent":"243",},{"key":"245","name":"IP地址:10.0.1.196/30","title":"用途:null","parent":"243",},{"key":"246","name":"IP地址:10.0.1.200/29","title":"用途:null","parent":"242",},{"key":"247","name":"IP地址:10.0.1.200/30","title":"用途:null","parent":"246",},{"key":"248","name":"IP地址:10.0.1.204/30","title":"用途:null","parent":"246",},{"key":"249","name":"IP地址:10.0.1.208/28","title":"用途:null","parent":"241",},{"key":"250","name":"IP地址:10.0.1.208/29","title":"用途:null","parent":"249",},{"key":"251","name":"IP地址:10.0.1.208/30","title":"用途:null","parent":"250",},{"key":"252","name":"IP地址:10.0.1.212/30","title":"用途:null","parent":"250",},{"key":"253","name":"IP地址:10.0.1.216/29","title":"用途:null","parent":"249",},{"key":"254","name":"IP地址:10.0.1.216/30","title":"用途:null","parent":"253",},{"key":"255","name":"IP地址:10.0.1.220/30","title":"用途:null","parent":"253",},{"key":"256","name":"IP地址:10.0.1.224/27","title":"用途:null","parent":"240",},{"key":"257","name":"IP地址:10.0.1.224/28","title":"用途:null","parent":"256",},{"key":"258","name":"IP地址:10.0.1.224/29","title":"用途:null","parent":"257",},{"key":"259","name":"IP地址:10.0.1.224/30","title":"用途:null","parent":"258",},{"key":"260","name":"IP地址:10.0.1.228/30","title":"用途:null","parent":"258",},{"key":"261","name":"IP地址:10.0.1.232/29","title":"用途:null","parent":"257",},{"key":"262","name":"IP地址:10.0.1.232/30","title":"用途:null","parent":"261",},{"key":"263","name":"IP地址:10.0.1.236/30","title":"用途:null","parent":"261",},{"key":"264","name":"IP地址:10.0.1.240/28","title":"用途:null","parent":"256",},{"key":"265","name":"IP地址:10.0.1.240/29","title":"用途:null","parent":"264",},{"key":"266","name":"IP地址:10.0.1.240/30","title":"用途:null","parent":"265",},{"key":"267","name":"IP地址:10.0.1.244/30","title":"用途:null","parent":"265",},{"key":"268","name":"IP地址:10.0.1.248/29","title":"用途:null","parent":"264",},{"key":"269","name":"IP地址:10.0.1.248/30","title":"用途:null","parent":"268",},{"key":"270","name":"IP地址:10.0.1.252/30","title":"用途:null","parent":"268",}];
    myDiagram.model = model;
    }

。。。。。。数据有点多,实际上更多

html代码

<div id="sample">
  <div id="myDiagramDiv" style="background-color: #696969; border: solid 1px black; height: 500px"></div>
</div>

效果图:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值