How to use pyyed - 2 common examples

To help you get started, we’ve selected a few pyyed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RackTables / racktables-contribs / python-graph-topology / functions.py View on Github external
router_label    = fnc_router_metadata(global_dict, router_name, 'labelHtml', router_function, router_ckt_id, router_mode)
			router_system   = get_attribute(router_name,"system",global_dict)

			G.add_node(router_name,label=router_name + "\n" + router_system, shape_fill=router_color)

		for link in links.itertuples():
			edgeLabel = link.cableID
			G.add_edge(link.routerA,link.routerB, arrowhead='none',arrowfoot='none',label=edgeLabel)

		print(filename)
		G.write_graph(filename+'.graphml')
		sys.exit(4)

	elif router_mode in ['0']:

		G = pyyed.Graph()
		
		for router in routers:

			# Variables
			router_name     = router[0][0]
			router_function = get_attribute(router_name,"HWfunction",global_dict)
			router_int      = get_attribute(router_name,"Integrado",global_dict)
			router_ckt_id   = get_attribute(router_name,"ckt_id",global_dict)
			router_color    = get_attribute(router_name,"color",global_dict)['yEd']
			router_label    = fnc_router_metadata(global_dict, router_name, 'labelHtml', router_function, router_ckt_id, router_mode)
			router_system   = get_attribute(router_name,"system",global_dict)

			grupo = G.add_group(router_name,label=router_name + "\n" + router_system, fill=router_color)

			for port in router:
				node_id = port[1]
github RackTables / racktables-contribs / python-graph-topology / functions.py View on Github external
def fnc_build_graphml(routers,edges,global_dict,router_mode,filename):

	if router_mode in ['1','2','3','4']:

		G = pyyed.Graph()

		nodes = pd.DataFrame(routers)

		nodes.columns=['router_name','port','label']
		nodes = nodes[['router_name']]
		nodes = nodes.drop_duplicates()

		links = pd.DataFrame(edges)
		links.columns=['routerA','routerB','cableID']		

		for router in nodes.itertuples():
			router_name   	= router.router_name
			router_function = get_attribute(router_name,"HWfunction",global_dict)
			router_int      = get_attribute(router_name,"Integrado",global_dict)
			router_ckt_id   = get_attribute(router_name,"ckt_id",global_dict)
			router_color    = get_attribute(router_name,"color",global_dict)['yEd']

pyyed

A simple Python library to export graphs to the yEd graph editor

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular pyyed functions

Similar packages