示例#1
0
sl.drawNetwork()

print("node centroid: ", sl.getNodeCentroid("X0"))
print("rxn centroid: ", sl.getReactionCentroid("_J0"))

print("Bezier Points: ", sl.getReactionBezierPoints("_J0"))

sl.setNodeCentroid("X0", 200, 300)

sl.drawNetwork()

print("node centroid: ", sl.getNodeCentroid("X0"))

print("X1 locked, False: ", sl.getIsNodeLocked("X1"))

sl.lockNode("X1")

print("X1 locked, True: ", sl.getIsNodeLocked("X1"))

sl.regenerateLayout()
sl.drawNetwork()

sl.regenerateLayout()
sl.drawNetwork()

sl.unlockNode("X1")

print("X1 locked, False: ", sl.getIsNodeLocked("X1"))

print(sl.getReactionIds())
示例#2
0
from pathlib import Path
import pkg_resources

from libsbml_draw.model.sbml_layout import SBMLlayout

model_file_name = "model.xml"

model_file = Path(
    pkg_resources.resource_filename("libsbml_draw",
                                    "model/data/" + model_file_name))

applyRender = True

sl = SBMLlayout(str(model_file), applyRender=applyRender)

sl.lockNode("X0")
sl.lockNode("A")

sl.aliasNode("B")

sl.setNodeColor("B_1", "#00ff0030")
sl.setNodeColor("A", "#00ff0030")

sl.lockNode("B_1")
sl.lockNode("D")
sl.unlockNode("X0")
sl.unlockNode("A")


def test_node_locking():
    assert sl.getIsNodeLocked("D") == True