ArbitraryText¶
Read the information of arbitrary text.¶
-
SBMLDiagrams.processSBML.load.
getTextIdList
(self)¶ Returns a list of text id.
- Returns:
txt_id_list-list of txt_id.
txt_id-str-arbitrary text id.
-
SBMLDiagrams.processSBML.load.
getTextContent
(self, txt_id)¶ Get the arbitrary text content with the text id.
- Args:
txt_id: str-the text id.
- Returns:
txt_content: str-text content.
-
SBMLDiagrams.processSBML.load.
getNodeTextPosition
(self, id, alias=0)¶ Get the text position of a node with a given node id.
- Args:
id: str-the id of node.
alias: int-alias node index: 0 to number of alias nodes -1.
- Returns:
txt_position: a Point object with attributes x and y representing the x/y position of the top-left hand corner of the node text.
- Examples:
p = sd.getNodeTextPosition(‘ATP’)
print (‘x = ‘, p.x, ‘y = ‘, p.y)
-
SBMLDiagrams.processSBML.load.
getTextSize
(self, txt_id)¶ Get the arbitrary text size with its text id.
- Args:
txt_id: str-the text id.
- Returns:
txt_size: a Point object with attributes x and y representing the width and height of the text.
- Examples:
p = sd.getTextSize(‘text_id’)
print (‘Width = ‘, p.x, ‘Height = ‘, p.y)
-
SBMLDiagrams.processSBML.load.
getNodeTextFontColor
(self, id, alias=0)¶ Get the text font color of a node with a given node id.
- Args:
id: str-the id of the node.
alias: int-alias node index: 0 to number of alias nodes -1.
- Returns:
txt_font_color: list-[rgba 1*4 matrix, html_name str (if any, otherwise ‘’), hex str (8 digits)].
-
SBMLDiagrams.processSBML.load.
getNodeTextLineWidth
(self, id, alias=0)¶ Get the text line width of a node with a given node id.
- Args:
id: int-the id of the node.
alias: int-alias node index: 0 to number of alias nodes -1.
- Returns:
txt_line_width: float-node text line width.
-
SBMLDiagrams.processSBML.load.
getTextFontSize
(self, txt_id)¶ Get the arbitrary text font size with the text id.
- Args:
txt_id: str-the text id.
- Returns:
txt_font_size: float-text font size.
Edit the information of arbitrary text.¶
-
SBMLDiagrams.processSBML.load.
setTextContent
(self, txt_id, txt_content)¶ Set the arbitrary text content.
- Args:
txt_id: str-the text id.
txt_content: str-the text content.
-
SBMLDiagrams.processSBML.load.
setTextPosition
(self, txt_id, txt_position)¶ Set the x,y coordinates of the arbitrary text position.
- Args:
txt_id: str-the text id.
txt_position: list or point.Point()
list- [txt_position_x, txt_position_y], the coordinate represents the top-left hand corner of the node text.
point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the text.
-
SBMLDiagrams.processSBML.load.
setTextSize
(self, txt_id, txt_size)¶ Set the arbitrary text size.
- Args:
txt_id: str-the text id.
txt_size: list or point.Point()
list- 1*2 matrix-size of the text [width, height].
point.Point()- a Point object with attributes x and y representing the width and height of the text.
-
SBMLDiagrams.processSBML.load.
setTextFontColor
(self, txt_id, txt_font_color, opacity=1.0)¶ Set the arbitrary text font color.
- Args:
txt_id: str-the text 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.).
-
SBMLDiagrams.processSBML.load.
setTextLineWidth
(self, txt_id, txt_line_width)¶ Set the arbitrary text line width.
- Args:
txt_id: str-the text id.
txt_line_width: float-node text line width.
-
SBMLDiagrams.processSBML.load.
setTextFontSize
(self, txt_id, txt_font_size)¶ Set the arbitrary text font size.
- Args:
txt_id: str-the text id.
txt_font_size: float-text font size.
Add and remove the an arbitrary text.¶
-
SBMLDiagrams.processSBML.load.
addText
(self, txt_id, txt_content, txt_position, txt_size, txt_font_color=[0, 0, 0], opacity=1.0, txt_line_width=1.0, txt_font_size=12.0)¶ Add arbitrary text onto canvas.
- Args:
txt_id: str-the text id.
txt_content: str-the text content.
txt_position: list or point.Point()
list- [position_x, position_y], the coordinate represents the top-left hand corner of the text.
point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the text.
txt_size: list or point.Point()
list- 1*2 matrix-size of the text [width, height].
point.Point()- a Point object with attributes x and y representing the width and height of the text.
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.).
txt_line_width: float-text line width.
txt_font_size: float-text font size.
-
SBMLDiagrams.processSBML.load.
removeText
(self, txt_id)¶ Remove the arbitrary text from canvas.
- Args:
txt_id: str-the text id.