Internal JSON Model Format

Instructon

In addition to supporting the standard SBML level 3 layout and render for exchanging models with other tools, SBcoyote also supports an internal JSON model format to save and load models within itself. To export a JSON file of an existing model on canvas, users need to click the button “Save As” under the “File” dropdown to save it locally. To import a JSON file generated by SBcoyoe, users need to click the button “Load” under the “File” dropdown to visualize it on the canvas.

Information

  1. Required information in the internal JSON model format:

  1. Compartment basic information (i.e., ID) and layout information (i.e., position, size).

  2. Node basic information (i.e., ID) and layout information (i.e., position, size).

  3. Reaction basic information (i.e., ID, reactants, products) and layout information (i.e., handle positions).

  1. Optional information in the internal JSON model format:

  1. Compartment render information (i.e., fill color, border color, border width).

  2. Node render information (i.e., fill color, border color, border width).

  3. Reaction render information (i.e., fill color, line width), and rateLaw.

  1. How to extend the interal JSON model file:

Users can either use SBcoyote to modify the internal JSON model file by editing the model on the canvas, or update the JSON file manually by editing it directly.

Example

{
    "compartments": {
        "0": {
            "fillColor": [
                158,
                169,
                255,
                200
            ],
            "id": "c_0",
            "outlineColor": [
                0,
                29,
                255
            ],
            "outlineThickness": 8.0,
            "position": [
                354.0,
                130.0
            ],
            "rectSize": [
                350,
                200
            ],
            "volume": 1.0
        }
    },
    "id": "the one",
    "nodes": {
        "0": {
            "compi": 0,
            "floating": true,
            "id": "x_0",
            "nodeLocked": false,
            "position": [
                489.0,
                239.0
            ],
            "rectSize": [
                50,
                30
            ],
            "shape": {
                "items": [
                    [
                        {
                            "border_color": [
                                255,
                                108,
                                9
                            ],
                            "border_width": 2.0,
                            "corner_radius": 4.0,
                            "fill_color": [
                                255,
                                204,
                                153,
                                200
                            ],
                            "name": "rectangle"
                        },
                        {
                            "rotation": 0.0,
                            "scale": [
                                1,
                                1
                            ],
                            "translation": [
                                0,
                                0
                            ]
                        }
                    ]
                ],
                "name": "rectangle",
                "text_item": [
                    {
                        "alignment": "center",
                        "bg_color": [
                            255,
                            255,
                            0,
                            0
                        ],
                        "font_color": [
                            0,
                            0,
                            0
                        ],
                        "font_family": "sans-serif",
                        "font_size": 11,
                        "font_style": "normal",
                        "font_weight": "normal"
                    },
                    {
                        "rotation": 0.0,
                        "scale": [
                            1,
                            1
                        ],
                        "translation": [
                            0,
                            0
                        ]
                    }
                ]
            }
        },
        "1": {
            "compi": -1,
            "floating": true,
            "id": "x_1",
            "nodeLocked": false,
            "position": [
                419.0,
                414.0
            ],
            "rectSize": [
                50,
                30
            ],
            "shape": {
                "items": [
                    [
                        {
                            "border_color": [
                                255,
                                108,
                                9
                            ],
                            "border_width": 2.0,
                            "corner_radius": 4.0,
                            "fill_color": [
                                255,
                                204,
                                153,
                                200
                            ],
                            "name": "rectangle"
                        },
                        {
                            "rotation": 0.0,
                            "scale": [
                                1,
                                1
                            ],
                            "translation": [
                                0,
                                0
                            ]
                        }
                    ]
                ],
                "name": "rectangle",
                "text_item": [
                    {
                        "alignment": "center",
                        "bg_color": [
                            255,
                            255,
                            0,
                            0
                        ],
                        "font_color": [
                            0,
                            0,
                            0
                        ],
                        "font_family": "sans-serif",
                        "font_size": 11,
                        "font_style": "normal",
                        "font_weight": "normal"
                    },
                    {
                        "rotation": 0.0,
                        "scale": [
                            1,
                            1
                        ],
                        "translation": [
                            0,
                            0
                        ]
                    }
                ]
            }
        },
        "2": {
            "compi": -1,
            "floating": true,
            "id": "x_2",
            "nodeLocked": false,
            "position": [
                647.0,
                416.0
            ],
            "rectSize": [
                50,
                30
            ],
            "shape": {
                "items": [
                    [
                        {
                            "border_color": [
                                255,
                                108,
                                9
                            ],
                            "border_width": 2.0,
                            "corner_radius": 4.0,
                            "fill_color": [
                                255,
                                204,
                                153,
                                200
                            ],
                            "name": "rectangle"
                        },
                        {
                            "rotation": 0.0,
                            "scale": [
                                1,
                                1
                            ],
                            "translation": [
                                0,
                                0
                            ]
                        }
                    ]
                ],
                "name": "rectangle",
                "text_item": [
                    {
                        "alignment": "center",
                        "bg_color": [
                            255,
                            255,
                            0,
                            0
                        ],
                        "font_color": [
                            0,
                            0,
                            0
                        ],
                        "font_family": "sans-serif",
                        "font_size": 11,
                        "font_style": "normal",
                        "font_weight": "normal"
                    },
                    {
                        "rotation": 0.0,
                        "scale": [
                            1,
                            1
                        ],
                        "translation": [
                            0,
                            0
                        ]
                    }
                ]
            }
        }
    },
    "reactions": {
        "0": {
            "bezierCurves": true,
            "centerHandlePos": [
                533.5555555555555,
                332.22222222222223
            ],
            "centerPos": [
                543.3333333333334,
                371.3333333333333
            ],
            "fillColor": [
                91,
                176,
                253
            ],
            "id": "r_0",
            "modifiers": [],
            "products": {
                "1": {
                    "handlePos": [
                        510.2222222222223,
                        390.55555555555554
                    ],
                    "stoich": 1.0
                },
                "2": {
                    "handlePos": [
                        586.2222222222223,
                        391.22222222222223
                    ],
                    "stoich": 1.0
                }
            },
            "rateLaw": "",
            "reactants": {
                "0": {
                    "handlePos": [
                        528.6666666666667,
                        312.66666666666663
                    ],
                    "stoich": 1.0
                }
            },
            "thickness": 3.0,
            "tipStyle": "circle"
        }
    },
    "serialVersion": "1.0.0"
}