-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttributeFilter.py
More file actions
123 lines (115 loc) · 4.3 KB
/
AttributeFilter.py
File metadata and controls
123 lines (115 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class AttFilter:
def __init__(self, att_list: list, is_vertex: bool):
self.att_list = att_list
self.is_vertex = is_vertex
def filter(self):
if self.is_vertex:
self.vertex_filter()
else:
self.edge_filter()
return self.att_list
def vertex_filter(self):
print("-----AttributeFilter----")
print(self.att_list)
if "geocode_country" in self.att_list:
self.att_list.remove("geocode_country")
if "hyperedge" in self.att_list:
self.att_list.remove("hyperedge")
if "GeoLocation" in self.att_list:
self.att_list.remove("GeoLocation")
if "geocode_id" in self.att_list:
self.att_list.remove("geocode_id")
if "y" in self.att_list:
self.att_list.remove("y")
if "Longitude" in self.att_list:
self.att_list.remove("Longitude")
if "Latitude" in self.att_list:
self.att_list.remove("Latitude")
if "x" in self.att_list:
self.att_list.remove("x")
if "id" in self.att_list:
self.att_list.remove("id")
if "color" in self.att_list:
self.att_list.remove("color")
if "vertex_size" in self.att_list:
self.att_list.remove("vertex_size")
print(self.att_list)
print("//-----AttributeFilter----")
def edge_filter(self):
if "edge_color" in self.att_list:
self.att_list.remove("edge_color")
if "edge_width" in self.att_list:
self.att_list.remove("edge_width")
if "key" in self.att_list:
self.att_list.remove("key")
if "zorder" in self.att_list:
self.att_list.remove("zorder")
if "color" in self.att_list:
self.att_list.remove("color")
if "width" in self.att_list:
self.att_list.remove("width")
def filter_search(self):
if self.is_vertex:
self.vertex_filter()
self.att_list.append("id")
else:
self.edge_filter()
if "weight" in self.att_list:
self.att_list.remove("weight")
return self.att_list
def filter_textbox(self):
if self.is_vertex:
if "color" in self.att_list:
self.att_list.remove("color")
if "vertex_size" in self.att_list:
self.att_list.remove("vertex_size")
else:
pass
return self.att_list
def filter_width(self):
if self.is_vertex:
pass
else:
self.filter()
if "LinkType" in self.att_list:
self.att_list.remove("LinkType")
if "LinkNote" in self.att_list:
self.att_list.remove("LinkNote")
if "LinkSpeedUnits" in self.att_list:
self.att_list.remove("LinkSpeedUnits")
if "label" in self.att_list:
self.att_list.remove("label")
if "LinkLabel" in self.att_list:
self.att_list.remove("LinkLabel")
return self.att_list
def filter_statistic(self):
if self.is_vertex:
pass
else:
self.stat_filter()
return self.att_list
def stat_filter(self):
if "weight" in self.att_list:
self.att_list.remove("weight")
if "LinkSpeedRaw" in self.att_list:
self.att_list.remove("LinkSpeedRaw")
if "bufferDelay" in self.att_list:
self.att_list.remove("bufferDelay")
if "tranmissionDelay" in self.att_list:
self.att_list.remove("tranmissionDelay")
if "propagationDelay" in self.att_list:
self.att_list.remove("propagationDelay")
if "source" in self.att_list:
self.att_list.remove("source")
if "target" in self.att_list:
self.att_list.remove("target")
if "edge_color" in self.att_list:
self.att_list.remove("edge_color")
if "edge_width" in self.att_list:
self.att_list.remove("edge_width")
if "key" in self.att_list:
self.att_list.remove("key")
if "zorder" in self.att_list:
self.att_list.remove("zorder")
if "color" in self.att_list:
self.att_list.remove("color")