示例#1
0
def my_layout(node):

	style2 = NodeStyle()
	style2["fgcolor"] = "#000000"
	style2["shape"] = "circle"
	# style2["vt_line_color"] = "#0000aa"
	# style2["hz_line_color"] = "#0000aa"
	# style2["vt_line_width"] = 2
	# style2["hz_line_width"] = 2
	# style2["vt_line_type"] = 1 # 0 solid, 1 dashed, 2 dotted
	# style2["hz_line_type"] = 1
	node.img_style = style2
 	node.img_style["bgcolor"] = "LightSteelBlue"

	if node.is_leaf():
		# If terminal node, draws its name
		# name_faces = AttrFace("name")
		node.img_style["size"] = 40
		# node.img_style["shape"] = "sphere"
		node.img_style["fgcolor"] = "#FFFFFF"
		# node.img_style["fgcolor"] = "#9db0cf"
		# node.img_style["bgcolor"] = "#9db0cf"
		# node.img_style["faces_bgcolor"] = "#9db0cf"
		# node.img_style["bgcolor"] = "#9db0cf"
		# node.img_style["bgcolor"] = "#9db0cf"
		pass
	else:
		# If internal node, draws label with smaller font size
		# name_faces = AttrFace("name", fsize=15)
		# Adds the name face to the image at the preferred position
		# faces.add_face_to_node(name_faces, node, column=0, position="branch-top")
		# tempo = faces.ImgFace(plot_folder + "/" + node.name + '.jpg')
		# faces.add_face_to_node(tempo, node, column=0, position="branch-bottom")
		node.img_style["size"] = 40
		node.img_style["shape"] = "sphere"
		node.img_style["fgcolor"] = "#FFFFFF"

	tempt = AttrFace('name', fsize=80)
	tempt.fgcolor = "Black"
	tempt.margin_top = 10
	tempt.margin_right = 10
	tempt.margin_left = 10
	tempt.margin_bottom = 10
	tempt.opacity = 0.5 # from 0 to 1
	tempt.inner_border.width = 1 # 1 pixel border
	tempt.inner_border.type = 1  # dashed line
	tempt.border.width = 1
	# tempt.background.color = "LightGreen"
	# tempt.penwidth = 40
	node.add_face(tempt, column=0, position="branch-top")
示例#2
0
def my_layout(node):
	style2 = NodeStyle()
	style2["fgcolor"] = "#000000"
	style2["shape"] = "circle"
	node.img_style = style2
 	node.img_style["bgcolor"] = "LightSteelBlue"
	if node.is_leaf():
		node.img_style["size"] = 40
		node.img_style["fgcolor"] = "#FFFFFF"
		pass
	else:
		node.img_style["size"] = 40
		node.img_style["shape"] = "sphere"
		node.img_style["fgcolor"] = "#FFFFFF"

	tempt = AttrFace('name', fsize=80)
	tempt.fgcolor = "Black"
	tempt.margin_top = 10
	tempt.margin_right = 10
	tempt.margin_left = 10
	tempt.margin_bottom = 10
	tempt.opacity = 0.5 # from 0 to 1
	tempt.inner_border.width = 1 # 1 pixel border
	tempt.inner_border.type = 1  # dashed line
	tempt.border.width = 1
	node.add_face(tempt, column=0, position="branch-top")
	tempt = AttrFace('alias', fsize=80)
	tempt.fgcolor = "Black"
	tempt.margin_top = 10
	tempt.margin_right = 10
	tempt.margin_left = 10
	tempt.margin_bottom = 10
	tempt.opacity = 0.5 # from 0 to 1
	tempt.inner_border.width = 1 # 1 pixel border
	tempt.inner_border.type = 1  # dashed line
	tempt.border.width = 1
	node.add_face(tempt, column=0, position="branch-bottom")