def main( args ):
	a=QApplication(sys.argv)					    
	map_drawer=MapDrawer()

	names=[]
	caller={}
	called={}
	comments={}

	for i in range(0,10,1):
		names.append(str(i))
	import random
	random.seed()
	for i in range(0,len(names),1):
		name=names[i]
		if not caller.has_key(name):
			caller[name]=[]
		for j in range(0,3,1):
			k=random.randint(0,len(names)-1)
			caller[name].append(names[k])

	map_drawer.SetMapData(names,caller,called,comments,layout='graphviz')
	a.setMainWidget(map_drawer)
	map_drawer.show()  
	a.exec_loop()
def main( args ):
	a=QApplication(sys.argv)					    
	map_drawer=MapDrawer()
	names=caller=called=contents=comments=None
	fd=open("sample.map","rb")
	[names,caller,called,contents]=load(fd)
	fd.close()
	
	dst_nums={}
	for src in caller.keys():
		dst_num=len(caller[src])
		if not dst_nums.has_key(dst_num):
			dst_nums[dst_num]=1
		dst_nums[dst_num]+=1
	
	for dst_num in dst_nums.keys():
		print dst_num,dst_nums[dst_num]	

	for i in range(0,1000,1):
		names.append(str(i))
	import random
	random.seed()
	for i in range(0,len(names),1):
		name=names[i]
		if not caller.has_key(name):
			caller[name]=[]
		for j in range(0,3,1):
			k=random.randint(0,len(names)-1)
			caller[name].append(names[k])
	print 'len(names)=',len(names)
	print 'len(caller)=',len(caller)
	map_drawer.SetMapData(names,caller,called,comments,layout='graphviz')
	#map_drawer.Zoom(0.1,0.1)
	a.setMainWidget(map_drawer)
	map_drawer.show()  
	a.exec_loop()
Beispiel #3
0
                  icon=folium.Icon(color='green')).add_to(m)
    for rec in docIncluded:
        folium.Marker(location=[rec[0], rec[1]],
                      tooltip=rec[2],
                      popup=rec[3],
                      icon=folium.Icon(color='blue')).add_to(m)
    m.save('index.html')


print("Enter comma seperated Cordinates:")
cc = input()
cor = (float(cc.split(",")[0]), float(cc.split(",")[1]))
print("Distance in km: ")
dis = float(input())

md = MapDrawer.MapDrawer(cor, dis)
md.draw()

#dataloading = DataLoading.DataLoading()
#preprocessing = Preprocessing.Preprocessing()
#textManagement = TextManagement.TextManagement()
#textMining = TextMining.TextMining()
#displayresults=DisplayResults.DisplayResults()

#lists = dataloading.LoadTSVFilesDataIntoString()
#data = preprocessing.PreprocessDataForTextManagement(lists)
#invertedIndex = textManagement.CreateInvertedIndexWithNewScore(data)
##save table maybe
#textManagement.SaveInvertedIndexJson(invertedIndex, "table-custom-scored.json")
##load table from file
#invertedIndex = textManagement.LoadInvertedIndexJson("table-custom-scored.json")
Beispiel #4
0
 def __init__(self):
     reader = CSVElectionInterpreter(PATH)
     formatted_info = reader.get_dict()
     tree = dict_to_tree(formatted_info)
     self.drawer = MapDrawer(tree, COLOR_ASSIGNMENTS)
Beispiel #5
0
class View:
    def __init__(self):
        reader = CSVElectionInterpreter(PATH)
        formatted_info = reader.get_dict()
        tree = dict_to_tree(formatted_info)
        self.drawer = MapDrawer(tree, COLOR_ASSIGNMENTS)

    def loop(self):
        running = True
        pygame.display.update()
        pos = None
        self.drawer.update_map()
        self.drawer.draw_rectangles()
        while running:
            self.drawer.update_screen()
            all_events = pygame.event.get()
            for event in all_events:
                # handle MOUSEBUTTONUP
                if event.type == pygame.MOUSEBUTTONUP:
                    pos = pygame.mouse.get_pos()
                    if pos[0] <= 500:
                        self.drawer.update_text(pos[0], pos[1])
            if keyboard.is_pressed('o'):
                # enlarge
                if pos is not None:
                    self.drawer.enlarge(pos[0], pos[1])
                    print('1')
                pos = None
            elif keyboard.is_pressed('q'):
                # close tree
                print('2')
                self.drawer.close_all()
                self.drawer.draw_rectangles()
                pos = None
            elif keyboard.is_pressed('e'):
                # expand
                if pos is not None:
                    self.drawer.expand(pos[0], pos[1])
                    self.drawer.update_map()
                    self.drawer.draw_rectangles()
                    pos = None
            elif keyboard.is_pressed('c'):
                if pos is not None:
                    self.drawer.close_parent(pos[0], pos[1])
                pos = None
            elif keyboard.is_pressed('z'):
                running = False