Compartment¶
Read the compartment information.¶
-
SBMLDiagrams.load.getCompartmentIdList(self)¶ Returns the list of compartment ids.
- Returns:
id_list-list of ids.
id-str-compartment id.
-
SBMLDiagrams.load.getCompartmentPosition(self, id)¶ Get the position of a compartment with given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
position: a Point object with attributes x and y representing the x/y position of the top-left hand corner of the compartment.
- Examples:
p = sd.getCompartmentPosition(‘compartment_id’)
print (‘x = ‘, p.x, ‘y = ‘, p.y)
-
SBMLDiagrams.load.getCompartmentSize(self, id)¶ Get the size of a compartment with given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
size: a Point object with attributes x and y representing the width and height of the compartment.
- Examples:
p = sd.getCompartmentSize(‘compartment_id’)
print (‘Width = ‘, p.x, ‘Height = ‘, p.y)
-
SBMLDiagrams.load.getCompartmentFillColor(self, id)¶ Get the fill color for a compartment with given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
fill_color: list-[rgba 1*4 matrix, html_name str (if any, otherwise ‘’), hex str (8 digits)].
-
SBMLDiagrams.load.getCompartmentBorderColor(self, id)¶ Get the border color of a compartment with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
border_color: list-[rgba 1*4 matrix, html_name str (if any, otherwise ‘’), hex str (8 digits)].
-
SBMLDiagrams.load.getCompartmentBorderWidth(self, id)¶ Get the border width of a compartment with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
border_width: float-compartment border line width.
-
SBMLDiagrams.load.getCompartmentTextPosition(self, id)¶ Get the text position of a compartment with given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
position: a Point object with attributes x and y representing the x/y position of the top-left hand corner of the compartment.
- Examples:
p = sd.getCompartmentTextPosition(‘compartment_id’)
print (‘x = ‘, p.x, ‘y = ‘, p.y)
-
SBMLDiagrams.load.getCompartmentTextSize(self, id)¶ Get the text size of a compartment with given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
size: a Point object with attributes x and y representing the width and height of the compartment.
- Examples:
p = sd.getCompartmentTextSize(‘compartment_id’)
print (‘Width = ‘, p.x, ‘Height = ‘, p.y)
-
SBMLDiagrams.load.getCompartmentTextContent(self, id)¶ Get the text content of a compartment with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
txt_content: str-the content of the compartment text.
-
SBMLDiagrams.load.getCompartmentTextFontColor(self, id)¶ Get the text font color of a compartment with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
txt_font_color: list-[rgba 1*4 matrix, html_name str (if any, otherwise ‘’), hex str (8 digits)].
-
SBMLDiagrams.load.getCompartmentTextLineWidth(self, id)¶ Get the text line width of a compartment with a given compartment id.
- Args:
id: int-the id of the compartment.
- Returns:
txt_line_width: float-compartment text line width.
-
SBMLDiagrams.load.getCompartmentTextFontSize(self, id)¶ Get the text font size of a compartment with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
txt_font_size: float.
-
SBMLDiagrams.load.getCompartmentTextAnchor(self, id)¶ Get the horizontal anchor of a compartment text with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
txt_anchor: str-the horizantal anchor of the compartment text, which can be “start”, “middle” and “end”.
-
SBMLDiagrams.load.getCompartmentTextVAnchor(self, id)¶ Get the vertical anchor of a compartment text with a given compartment id.
- Args:
id: str-the id of the compartment.
- Returns:
txt_anchor: str-the vertical anchor of the compartment text, which can be “top”, “middle”, “baseline” and “bottom”.
Edit the compartment information.¶
-
SBMLDiagrams.load.setCompartmentPosition(self, id, position)¶ Set the x,y coordinates of the compartment position.
- Args:
id: str-compartment id.
position: list or point.Point()
list- [position_x, position_y], the coordinate represents the top-left hand corner of the compartment.
point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the compartment.
-
SBMLDiagrams.load.setCompartmentSize(self, id, size)¶ Set the compartment size.
- Args:
df: DataFrame-initial information.
id: str-compartment id.
size: list or point.Point()
list- 1*2 matrix-size of the compartment [width, height].
point.Point()- a Point object with attributes x and y representing the width and height of the compartment.
-
SBMLDiagrams.load.setCompartmentFillColor(self, id, fill_color, opacity=1.0)¶ Set the compartment fill color.
- Args:
id: str-compartment id.
fill_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).
opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).
-
SBMLDiagrams.load.setCompartmentBorderColor(self, id, border_color, opacity=1.0)¶ Set the compartment border color.
- Args:
id: str-compartment id.
border_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).
opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).
-
SBMLDiagrams.load.setCompartmentBorderWidth(self, id, border_width)¶ Set the compartment border width.
- Args:
id: str-compartment id.
border_width: float-compartment border line width.
-
SBMLDiagrams.load.setCompartmentTextPosition(self, id, position)¶ Set the x,y coordinates of the compartment text position.
- Args:
id: str-compartment id.
position: list or point.Point()
list- [position_x, position_y], the coordinate represents the top-left hand corner of the compartment.
point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the compartment.
-
SBMLDiagrams.load.setCompartmentTextSize(self, id, size)¶ Set the compartment text size.
- Args:
df: DataFrame-initial information.
id: str-compartment id.
size: list or point.Point()
list- 1*2 matrix-size of the compartment [width, height].
point.Point()- a Point object with attributes x and y representing the width and height of the compartment.
-
SBMLDiagrams.load.setCompartmentTextContent(self, id, txt_content)¶ Set the compartment text content for a compartment of given id.
- Args:
id: str-compartment id.
txt_content: str-compartment text content.
- Examples:
la.setCompartmentTextContent (‘compartment4’, ‘C4’)
-
SBMLDiagrams.load.setCompartmentTextFontColor(self, id, txt_font_color, opacity=1.0)¶ Set the compartment text font color for a compartment of given id.
- Args:
id: str-compartment id.
txt_font_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).
opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).
- Examples:
la.setCompartmentTextFontColor (‘commpartment1’, ‘CornflowerBlue’)
-
SBMLDiagrams.load.setCompartmentTextLineWidth(self, id, txt_line_width)¶ Set the compartment text line width for a compartment of given id.
- Args:
id: str-compartment id.
txt_line_width: float-compartment text line width.
-
SBMLDiagrams.load.setCompartmentTextFontSize(self, id, txt_font_size)¶ Set the compartment text font size for a compartment of given id.
- Args:
id: str-compartment id.
txt_font_size: float-compartment text font size, the units for size are assumed to be in points.
-
SBMLDiagrams.load.setCompartmentTextAnchor(self, id, txt_anchor)¶ Set the horizontal anchor for a compartment text of given id.
- Args:
id: str-compartment id.
txt_anchor: str-compartment text horizontal anchor, which can be “start”, “middle” and “end”.
-
SBMLDiagrams.load.setCompartmentTextVAnchor(self, id, txt_vanchor)¶ Set the vertical anchor for a compartment text of given id.
- Args:
id: str-compartment id.
txt_vanchor: str-compartment text vertical anchor, which can be which can be “top”, “middle”, “baseline” and “bottom”.