Loading and using JSON for Cytoscape.js

后端 未结 2 1718
余生分开走
余生分开走 2021-02-09 19:37

Context

I want to use cytoscape.js for visualizing graphs. While I am capable with a myriad of languages (C++, Mathematica,

2条回答
  •  长情又很酷
    2021-02-09 20:07

    
        
        
        
    
    
    
    
    
        

    in cyto.js you can input valid JSON data, for example

      {
        "nodes": [
                {
                "data": {"id": "a", "label": "Gene1"}
                },
                {
                "data": {"id": "b", "label": "Gene2"}
                },
                {
                "data": {"id": "c", "label": "Gene3"}
                },
                {
                "data": {"id": "d", "label": "Gene4"}
                },
                {
                "data": {"id": "e", "label": "Gene5"}
                },
                {
                "data": {"id": "f", "label": "Gene6"}
                }
        ],
                "edges": [
                {
                "data": {
                "id": "ab",
                        "source": "a",
                        "target": "b"
                }
                },
                {
                "data": {
                "id": "cd",
                        "source": "c",
                        "target": "d"
                }
                },
                {
                "data": {
                "id": "ef",
                        "source": "e",
                        "target": "f"
                }
                },
                {
                "data": {
                "id": "ac",
                        "source": "a",
                        "target": "d"
                }
                },
                {
                "data": {
                 "id": "be",
                        "source": "b",
                        "target": "e"
                    }
                    }]    
        }
    

提交回复
热议问题