Class GraphTranslatorJson


  • public class GraphTranslatorJson
    extends GraphTranslator
    The Class GraphTranslatorJson to translate internal graph structures into JSON format. (e.g. to pass the graph to CytoscapeJS) The resulting graph will look like:
     {
            "elements": {
                    "edges": [
                            {
                                    "classes": "bives-ioedge",
                                    "data": {
                                            "source": "s2",
                                            "target": "r3"
                                    }
                            },
                            {
                                    "classes": "bives-stimulator bives-deleted",
                                    "data": {
                                            "source": "s4",
                                            "target": "r3"
                                    }
                            },
                            [...]
                    ],
                    "nodes": [
                            {
                                    "classes": "compartment",
                                    "data": {
                                            "id": "c1",
                                            "name": "compartment"
                                    }
                            },
                            {
                                    "classes": "species",
                                    "data": {
                                            "id": "s2",
                                            "name": "sigb",
                                            "parent": "c1"
                                    }
                            },
                            {
                                    "classes": "reaction bives-modified",
                                    "data": {
                                            "id": "r3",
                                            "name": "sigb degr",
                                            "parent": "c1"
                                    }
                            },
                            [...]
                    ]
            }
     }
     
    for more information see JsonGraphFormatDescription
    Author:
    Martin Scharm
    • Constructor Detail

      • GraphTranslatorJson

        public GraphTranslatorJson()
    • Method Detail

      • getJsonGraph

        public org.json.simple.JSONObject getJsonGraph()
        Gets the JSON object.
        Returns:
        the JSON object representing the graph