ArbitraryShape

Read the information of arbitrary shape.

SBMLDiagrams.processSBML.load.getShapeNameList(self)

Returns a list of possible shape names.

Returns:

shape_name_list-list of shape_name.

shape_name-str-arbitrary shape name.

SBMLDiagrams.processSBML.load.getShapePosition(self, shape_name_str)

Get the arbitrary shape position with its shape name.

Args:

shape_name_str: str-the shape name of the arbitrary shape.

Returns:

position: a Point object with attributes x and y representing the x/y position of the top-left hand corner of the shape.

Examples:

p = sd.getShapePosition(‘shape_name’)

print (‘x = ‘, p.x, ‘y = ‘, p.y)

SBMLDiagrams.processSBML.load.getShapeSize(self, shape_name_str)

Get the arbitrary shape size with its shape name.

Args:

shape_name_str: str-the shape name.

Returns:

shape_size: a Point object with attributes x and y representing the width and height of the shape.

Examples:

p = sd.getShapeSize(‘shape_name’)

print (‘Width = ‘, p.x, ‘Height = ‘, p.y)

Add or remove an arbitrary shape.

SBMLDiagrams.processSBML.load.addRectangle(self, shape_name, position, size, fill_color=[255, 255, 255], fill_opacity=1.0, border_color=[0, 0, 0], border_opacity=1.0, border_width=2.0)

Add a rectangle onto canvas.

Args:

shape_name: str-the name of the rectangle.

position: list or point.Point()

list- [position_x, position_y], the coordinate represents the top-left hand corner of the rectangle.

point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the rectangle.

size: list or point.Point()

list- 1*2 matrix-size of the rectangle [width, height].

point.Point()- a Point object with attributes x and y representing the width and height of the rectangle.

fill_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

fill_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

border_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_width: float-node text line width.

SBMLDiagrams.processSBML.load.addEllipse(self, shape_name, position, size, fill_color=[255, 255, 255], fill_opacity=1.0, border_color=[0, 0, 0], border_opacity=1.0, border_width=2.0)

Add an ellipse onto canvas.

Args:

shape_name: str-the name of the ellipse.

position: list or point.Point()

list- [position_x, position_y], the coordinate represents the top-left hand corner of the ellipse.

point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the ellipse.

size: list or point.Point()

list- 1*2 matrix-size of the ellipse [width, height].

point.Point()- a Point object with attributes x and y representing the width and height of the ellipse.

fill_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

fill_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

border_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_width: float-node text line width.

SBMLDiagrams.processSBML.load.addPolygon(self, shape_name, shape_info, position, size, fill_color=[255, 255, 255], fill_opacity=1.0, border_color=[0, 0, 0], border_opacity=1.0, border_width=2.0)

Add an ellipse onto canvas.

Args:

shape_name: str-the name of the polygon.

shape_info: list-[[x1,y1],[x2,y2],[x3,y3],etc], where x,y are floating numbers from 0 to 100. x represents the percentage of width, and y represents the percentage of height.

position: list or point.Point()

list- [position_x, position_y], the coordinate represents the top-left hand corner of the Polygon.

point.Point()- a Point object with attributes x and y representing the x/y position of the top-left hand corner of the polygon.

size: list or point.Point()

list- 1*2 matrix-size of the polygon [width, height].

point.Point()- a Point object with attributes x and y representing the width and height of the Polygon.

fill_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

fill_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_color: list-decimal_rgb 1*3 matrix/str-html_name/str-hex_string (6-digit).

border_opacity: float-value is between [0,1], default is fully opaque (opacity = 1.).

border_width: float-node text line width.

SBMLDiagrams.processSBML.load.removeShape(self, shape_name_str)

Remove the arbitrary shape from canvas.

Args:

shape_name_str: str-the shape name.