Source

phylogeny-d3 / itis_sql_to_json.py

Diff from to

itis_sql_to_json.py

 	def node(self):
 		"""Get node data in d3.json format"""
 		# {"name":"Napoleon","group":1}
-		return {"name":self.name, "group":1}
+		return {"name":self.name, "group":1, "year":self.year, "itis_id":self.id}
 		
 	def link(self):
 		"""Get the subtending branch in d3.json format"""
 	
 	tree = { 'nodes':[], 'links':[] }  # a dictionary of nodes and links in the tree
 	
-	node_lookup = dict() # Maps from original node_id to position in tree['nodes'] list
+	node_lookup = dict() # Maps from original itis node id to position in tree['nodes'] list
 	
 	
 	#print 'id,parent,name,year'