InteractiveNode¶
-
class
visualife.diagrams.InteractiveNode(node, code_snippet, **params)¶ Bases:
visualife.diagrams.NodeBaseExtends
InteractiveNodewith a code snipped.This class both contains and extends a
NodeBase, calls to the base class are delegated to the node instanceAttributes Summary
bottomCoordinates of the point in the middle of the bottom side of this node code_snippetReturns the code snippet assigned to this node heightThe height of this node. idReturns ID of this node leftCoordinates of the point in the middle of the left side of this node nodeReturns the node object used to display this InteractiveNoderightCoordinates of the point in the middle of the right side of this node topCoordinates of the point in the middle of the top side of this node widthThe width of this node. xyMethods Summary
draw(viewport, **kwargs)Draw this node on a viewport execute(global_variables, local_variables)highlight([state])Highlights this box or turns it back to normal. Attributes Documentation
-
bottom¶ Coordinates of the point in the middle of the bottom side of this node
Abstract method, raises
NotImplementedError
-
code_snippet¶ Returns the code snippet assigned to this node
Returns: ( string) code snippet that will be executed by this node
-
height¶ The height of this node.
This property is evaluated as
self.bottom.y - self.top.y, so it relies onbottom()andtop()implementation of a derived class :return: height of this node.
-
id¶ Returns ID of this node
Returns: unique ID of this node
-
left¶ Coordinates of the point in the middle of the left side of this node
Abstract method, raises
NotImplementedError
-
node¶ Returns the node object used to display this
InteractiveNodeReturns: ( NodeBase) node object
-
right¶ Coordinates of the point in the middle of the right side of this node
Abstract method, raises
NotImplementedError
-
top¶ Coordinates of the point in the middle of the top side of this node
Abstract method, raises
NotImplementedError
-
width¶ The width of this node.
This property is evaluated as
self.right.x - self.left.x, so it relies onleft()andright()implementation of a derived class :return: width of this node.
-
x¶
-
y¶
Methods Documentation
-
draw(viewport, **kwargs)¶ Draw this node on a viewport
Abstract method, raises
NotImplementedErrorParameters: - viewport – (
visualife.core.HtmlViewportorvisualife.core.SvgViewport) where to draw this node - kwargs – node styling parameters
- viewport – (
-
execute(global_variables, local_variables)¶
-
highlight(state=True)¶ Highlights this box or turns it back to normal.
Highlighting this node will change it’s fill color to a reddish tint of its existing (standard) color The new color will be visible until
clear()is called. This method works only whenvisualife.core.HtmlViewportis used to render the graphics; otherwise it has no effect.Parameters: state – ( boolean) ifTrue, this node will be highlighted, otherwise any highlight effectwill be cancelled
-