From ef84e02371a75fa09d3037a33b3421f8cad2dab0 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 1 Dec 2015 13:00:43 +0100 Subject: * cleanup --- _img/photo1.jpg | Bin 42961 -> 0 bytes _img/photo2.jpg | Bin 39625 -> 0 bytes _img/photo3.jpg | Bin 46071 -> 0 bytes _img/photo4.jpg | Bin 41621 -> 0 bytes _img/photo5.jpg | Bin 41836 -> 0 bytes generate_graph.py | 97 ------------------------------------------------------ 6 files changed, 97 deletions(-) delete mode 100644 _img/photo1.jpg delete mode 100644 _img/photo2.jpg delete mode 100644 _img/photo3.jpg delete mode 100644 _img/photo4.jpg delete mode 100644 _img/photo5.jpg delete mode 100644 generate_graph.py diff --git a/_img/photo1.jpg b/_img/photo1.jpg deleted file mode 100644 index f01641b..0000000 Binary files a/_img/photo1.jpg and /dev/null differ diff --git a/_img/photo2.jpg b/_img/photo2.jpg deleted file mode 100644 index f230d41..0000000 Binary files a/_img/photo2.jpg and /dev/null differ diff --git a/_img/photo3.jpg b/_img/photo3.jpg deleted file mode 100644 index 6143b9b..0000000 Binary files a/_img/photo3.jpg and /dev/null differ diff --git a/_img/photo4.jpg b/_img/photo4.jpg deleted file mode 100644 index 7035b6b..0000000 Binary files a/_img/photo4.jpg and /dev/null differ diff --git a/_img/photo5.jpg b/_img/photo5.jpg deleted file mode 100644 index 9845eda..0000000 Binary files a/_img/photo5.jpg and /dev/null differ diff --git a/generate_graph.py b/generate_graph.py deleted file mode 100644 index 181c6fe..0000000 --- a/generate_graph.py +++ /dev/null @@ -1,97 +0,0 @@ -import sys, json, random -from math import ceil, pi, sin, cos - -sizes = [1.0, 0.9, 0.8, 0.7, 0.3, 0.2, 0.1] -counts = sys.argv[1:8] - -base_size = 200 -mass_quotient = float(sys.argv[8]) -size_quotient = float(sys.argv[9]) -subnode_threshold = float(sys.argv[10]) - -nodes = {} - -nodes['n0'] = { - 'width': base_size, - 'height': base_size, - 'color': 'rgba(255,255,255,0.01)', - 'mass': base_size, - 'fixed': True, - 'x': 0, - 'y': 0, - 'image': 'photo' + str(random.randint(1, 5)) + '.jpg', - 'main': True -} -node_count = 1 - -node_sizes = [] -for i in counts: - node_sizes = node_sizes + [sizes.pop(0)] * int(i) - -node_colors = { - 1.0: 'rgba(52,149,255,0.33)', - 0.9: 'rgba(52,149,255,0.33)', - 0.8: 'rgba(52,149,255,0.33)', - 0.7: 'rgba(52,149,255,0.33)', - 0.3: 'rgba(255,0,0,0.33)', - 0.2: 'rgba(255,255,0,0.33)', - 0.1: 'rgba(255,255,255,0.33)' -} - -angular_positions = [2 * pi / len(node_sizes) * (n - 1) for n in range(1, len(node_sizes)+1)] -random.shuffle(angular_positions) - -edges = {} -edges['n0'] = {} -for node_size in node_sizes: - node_id = 'n' + str(node_count) - node_dimension = max(10, int(ceil(base_size * node_size * size_quotient))) - node_mass = int(ceil(base_size * mass_quotient)) - node_angular_position = angular_positions[node_count-1] - node_position = { 'x': 0.8 * cos(node_angular_position), - 'y': 0.8 * sin(node_angular_position) } - nodes[node_id] = { - 'width': node_dimension, - 'height': node_dimension, - 'mass': node_mass, - 'color': node_colors[node_size], - 'fixed': True, - 'x': node_position['x'], - 'y': node_position['y'], - 'image': 'photo' + str(random.randint(1, 5)) + '.jpg' - } - edges['n0'][node_id] = {} - edges[node_id] = {} - node_count += 1 - subnode_count = 1 - subnode_sizes = [n for n in node_sizes if (node_size > 0.2) and (random.random() > subnode_threshold)] - for subnode_size in subnode_sizes: - subnode_id = node_id + '_' + str(subnode_count) - subnode_dimension = max(5, int(ceil(base_size * node_size * subnode_size * size_quotient * size_quotient))) - subnode_mass = int(ceil(base_size * mass_quotient)) - nodes[subnode_id] = { - 'width': subnode_dimension, - 'height': subnode_dimension, - 'mass': subnode_mass, - 'color': node_colors[subnode_size], - 'fixed': True, - 'x': node_position['x'] * (0.995 + random.random() / 100), - 'y': node_position['y'] * (0.995 + random.random() / 100), - 'image': 'photo' + str(random.randint(1, 5)) + '.jpg' - } - edges[node_id][subnode_id] = {} - subnode_count += 1 - -print json.dumps( - { - 'repulsion': 2200, - 'stiffness': 900, - 'friction': 0, - 'precision': 0.5, - 'fps': 100, - 'dt': 0.01, - 'gravity': True, - 'nodes': nodes, - 'edges': edges - } -) -- cgit v1.2.3