Permalink
Browse files

updates for zoomag

  • Loading branch information...
1 parent 6ddc3e5 commit 5d2f2f43903efcc9a4c5c60c221540ed1bc67712 @sk2 committed Mar 28, 2012
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -37,7 +37,7 @@ def main():
pairs = [(a, b) for (a, b) in zip(files, files[1:])]
for fileA, fileB in pairs:
compare(fileA, fileB)
-
+ print "---------------"
# See if A is a wildcard -> glob
@@ -94,18 +94,22 @@ def compare(fileA, fileB):
for label in labels_common:
nodeA = label_mappingA[label]
nodeB = label_mappingB[label]
- dataA = graphA[nodeA]
- dataB = graphB[nodeB]
+ dataA = graphA.node[nodeA]
+ dataB = graphB.node[nodeB]
keysA = set(dataA.keys())
keysB = set(dataB.keys())
#print dataA, dataB
added = keysB - keysA
removed = keysA - keysB
same = keysA & keysB
- modified = [key for key in same if dataA[key] != dataB[key]]
+ modified = [key for key in same if dataA[key] != dataB[key] and key != 'id']
if len(added) or len(removed) or len(modified):
#TODO: check handling for multi-edge
+ print "modified", label
+ pprint.pprint(dataA)
+ pprint.pprint(dataB)
labels_modified.add(label)
+ print "Nodes modified:", ", ".join(sorted(labels_modified))
# need common nodes for edge comparisons
@@ -237,7 +241,7 @@ def compare(fileA, fileB):
line_width = 3,
node_size = 150,
edge_font_size=8,
- basemap_resolution_level = 3,
+ basemap_resolution_level = 1,
pdf=True,
country_color="#cccccc",
user_default_edge_color = "k",
View
@@ -784,14 +784,17 @@ def plot_graph(G, output_path, title=False, use_bluemarble=False,
if data.get('inferred'):
linestyle = 'dotted'
- if 'delta' in data:
- edge_color = delta_colors[data['delta']]
- linestyle = delta_styles[data['delta']]
+
if 'zorder' in data:
zorder = data['zorder']
else:
zorder = 1
+
+ if 'delta' in data:
+ edge_color = delta_colors[data['delta']]
+ linestyle = delta_styles[data['delta']]
+ zorder = zorder + 0.1 #ensure diffs go on top of solid lines
if 'edge_width' in data:
# Multiplier not absolute width
View
@@ -416,7 +416,7 @@ def main():
# extract edge data
for src, dst, key, data in graph.edges(data=True, keys=True):
- if 'label' in data:
+ if data.get("label"):
label = data['label']
extracted_data = extract_edge_data(label)
# Replace the edge data with extracted

0 comments on commit 5d2f2f4

Please sign in to comment.