How to have a node's name be different than its ID using Cytoscape.js?

时间:2019-02-18 00:45:39

标签: javascript graph-theory cytoscape.js cytoscape-web

I'm building a web application using Cytoscape.js that visualizes protein interaction data.

Proteins (nodes) need to have ID's corresponding to strings representing their chromosome locations, because this is universal. However, I would like them to be visualized or displayed alongside their common names, and not their ID's.

Any idea how to do this? The Cytoscape documentation doesn't seem to have an answer.

1 个答案:

答案 0 :(得分:3)

您可以在数据字段中指定节点名称。如果要将该名称显示为节点标签,只需使用字段name

{AZURE_ACCOUNT_NAME}.blob.core.windows.net
location
 $(".check").click(function() {
    if ($(this).is(":checked")) {
      var add1 = $('.add1').val();
      $('.add2').val(add1);
    }
 });

您也可以在文档中找到它: