示例#1
0
def start():
	
	# ----- Initialization -----

	og.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
	og.create_entity("graph")
	og.create_visualizer("network")
	og.create_visualizer("logo")
	og.create_visualizer("shell")

	# ----- Console Callback ------

	og.register_script("#console", 'network.shell.execute')

	# ----- Load JSON dataset if defined -----

	if len(sys.argv) == 3:
	    if sys.argv[2].endswith(".json"):
	        og.register_script('#started', 'load ' + sys.argv[2]) 
	    else:
	        print("Unrecognized format <'" + sys.argv[2] + "'> !")	

	# ----- Start -----

	og.start()
示例#2
0
def start():

    # ----- Initialization -----

    og.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    og.create_entity("graph")
    og.create_visualizer("network")
    og.create_visualizer("logo")
    og.create_visualizer("shell")

    # ----- Console Callback ------

    og.register_script("#console", 'network.shell.execute')

    # ----- Load JSON dataset if defined -----

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            og.register_script('#started', 'load ' + sys.argv[2])
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    # ----- Start -----

    og.start()
示例#3
0
def start():

    # ----- Initialization -----

    og.create_window("OpenGraphiti : Data Visualization Engine", 1024, 728)
    og.create_entity("graph")
    og.create_visualizer("space")
    #og.create_visualizer("network")
    og.create_visualizer("globe")
    og.create_visualizer("world")
    # TODO: og.create_visualizer("timeline") 
    og.create_visualizer("timeseries")
    og.create_visualizer("heightmap")
    og.create_visualizer("shell")
    og.create_visualizer("logo")

    # ----- Console Callbacks ------

    og.register_script('#idle', 'dashboard.on_idle()')
    global job_id
    job_id = og.add_job("#idle", 1.0)

    og.register_script('#tick', 'dashboard.on_tick()')
    og.add_job("#tick", 0.5)

    t = threading.Thread(target=thread_zmq, args=())
    t.daemon = True
    t.start()

    og.register_script('#started', 'dashboard.on_started()') 

    # -----

    og.start()
示例#4
0
def start():

    # ----- Initialization -----

    og.create_window("OpenGraphiti : Data Visualization Engine", 1024, 728)
    og.create_entity("graph")
    #og.create_visualizer("space")
    og.create_visualizer("network")
    og.create_visualizer("globe")
    og.create_visualizer("world")
    # TODO: og.create_visualizer("timeline") 
    og.create_visualizer("timeseries")
    og.create_visualizer("shell")
    og.create_visualizer("logo")

    # ----- Console Callback ------

    og.register_script("#console", 'dashboard.shell.execute')

    # ----- Start -----

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            og.register_script('#started', 'load ' + sys.argv[2]) 
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    og.start()
示例#5
0
def start():

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script('#started', 'std.load_json("' + sys.argv[2] + '")') 
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    # graphiti.register_script("#started", "world.on_started()")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("world")
    graphiti.start()
示例#6
0
def start():

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script('#started',
                                     'std.load_json("' + sys.argv[2] + '")')
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    # graphiti.register_script("#started", "world.on_started()")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("world")
    graphiti.start()
示例#7
0
def start():

    leap_context["state"] = "start"
    listener = LeapListener()
    controller = Leap.Controller()
    controller.add_listener(listener)

    graphiti.register_script("#started", "leap.on_started()")
    graphiti.register_script('#idle', 'leap.on_idle()')
    graphiti.add_job("#idle", delta)

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("space")
    graphiti.start()

    controller.remove_listener(listener)
示例#8
0
def start():

    leap_context["state"] = "start"
    listener = LeapListener()
    controller = Leap.Controller()
    controller.add_listener(listener)

    graphiti.register_script("#started", "leap.on_started()")
    graphiti.register_script('#idle', 'leap.on_idle()')
    graphiti.add_job("#idle", delta);

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("space")
    graphiti.start()
    
    controller.remove_listener(listener)
示例#9
0
def start():

    global ctx

    og.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)

    ctx['g1'] = og.create_entity("graph")
    views["space"] = og.create_visualizer("space")

    ctx['g2'] = og.create_entity("graph")
    views["world"] = og.create_visualizer("world")

    #ts = og.create_entity("time_series", { "size" : 1000 })
    #views['line_chart'] = og.create_visualizer("stream")

    og.register_script('#started', 'dashboard.on_started()')
    og.register_script("test", "print('yes')")

    og.start()
示例#10
0
def start():

	global ctx

	og.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)

	ctx['g1'] = og.create_entity("graph")
	views["space"] = og.create_visualizer("space")

	ctx['g2'] = og.create_entity("graph")
	views["world"] = og.create_visualizer("world")

	#ts = og.create_entity("time_series", { "size" : 1000 })
	#views['line_chart'] = og.create_visualizer("stream")

	og.register_script('#started', 'dashboard.on_started()')
	og.register_script("test", "print('yes')")

	og.start()
示例#11
0
def start():

    Scripts = [
        [
            "Edition",
            [
                ["Info", "std.info()"],
                ["Save", "std.save_json(raw_input('Output filename : '))"],
                ["-", "pass"],
            ]
        ],
    ]

    unreg_command = ""
    for script in Scripts:
        for s in script[1]:
            unreg_command += 'graphiti.unregister_script("' + s[0] + '")\n'

    for script in Scripts:
        reg_command = ""
        for s in script[1]:
            reg_command += 'graphiti.register_script("' + s[0] + '", "' + s[
                1] + '")\n'

        graphiti.register_script(script[0], unreg_command + "\n" + reg_command)

    graphiti.register_script("==========", "pass")

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script('#started',
                                     'std.load_json("' + sys.argv[2] + '")')
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    # graphiti.register_script("#started", "world.on_started()")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("world")
    graphiti.start()
示例#12
0
def start():

    Scripts = [
        ["Edition", [
            ["Info", "std.info()"],
            ["Save", "std.save_json(raw_input('Output filename : '))"],

            ["-", "pass"],

            ["Clear Graph", "demo.clear_graph()"],
            ["Clear Colors", "demo.clear_colors()"],
            ["Clear Icons", "demo.clear_icons()"],
            ["Clear LOD", "demo.set_lod(1.0)"],
            ["Zero LOD", "demo.set_lod(0.0)"],
            ["Node Type", "demo.color_nodes_by_type()"],
            ["Edge Type", "demo.color_edges_by_type()"],   
            ["Country Icons", "demo.countries_to_icons()"],
            ["Color Attribute", "demo.color_nodes_by_nominal_attribute(raw_input('Attribute : '))"],
            ["Depth to LOD", "demo.attribute_to_lod('depth', lambda a: a)"],
            ["Search by Node Attribute", "demo.search_by_attribute(True, False)"],
            ["Search by Link Attribute", "demo.search_by_attribute(False, True)"],
        ]],
        ["Colors", [
            ["Dim Nodes", "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], True, False)"],
            ["Dim Edges", "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], False, True)"],
            ["Brighten Nodes", "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], True, False)"],
            ["Brighten Edges", "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], False, True)"],
            ["Dim Nodes Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], True, False)"],
            ["Dim Edges Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], False, True)"],
            ["Brighten Nodes Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], True, False)"],
            ["Brighten Edges Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], False, True)"],
        ]],
        ["Arrangement", [
            ["Lock / Unlock", "demo.lock_unlock()"],
            ["Point Layout", "demo.sphere_layout(0)"],
            ["Sphere Layout", "demo.sphere_layout(20)"],
            ["Cube Layout", "demo.cube_layout()"],
            ["Conic Layout", "demo.conic_layout()"],
            ["Seed Circle Layout", "demo.seed_circle_layout()"],
            ["Globe Layout", "demo.globe_layout()"],
        ]],
        ["Topology", [
            ["Neighbors", "demo.color_neighbors()"],
            ["Connected Components", "demo.show_connected_components()"],
            ["Edge Directions", "demo.show_edge_direction()"],
            ["High Degrees", "demo.show_high_degrees()"],
            ["Low Degrees", "demo.show_low_degrees()"],
            ["Node Connections", "demo.color_by_node_degree()"],
            ["Detect SPN", "demo.detect_spn()"]
        ]],
        ["Animation", [
            ["Start", "graphiti.set_attribute('graphiti:space:animation', 'bool', 'True')"],
            ["Stop", "graphiti.set_attribute('graphiti:space:animation', 'bool', 'False')"]
        ]],
        ["Security", [
            ["Umbrella Score", "demo.color_nodes_by_score()"],
            ["Infected Score", "demo.color_nodes_by_infected()"],
            ["DGA Score", "demo.color_nodes_by_dga_score()"],
        ]],
        ["Test / Debug", [
            ["Add Random Graph", "demo.add_random_graph()"],
            ["Add Neighbor", "demo.add_neighbor()"],
            ["Randomize Node Activity", "demo.randomize_node_activity()"],
            ["Randomize Node Icons", "demo.randomize_node_icons()"],
            ["Randomize Node Size", "demo.randomize_node_size()"],
            ["Randomize Edge Activity", "demo.randomize_edge_activity()"],
            ["Randomize Edge Icons", "demo.randomize_edge_icons()"],
            ["Randomize Edge Width", "demo.randomize_edge_width()"],
            ["Randomize Timeline", "demo.randomize_timeline()"],
            ["Randomize LOD", "demo.randomize_lod()"],
            ["Debug On/Off", "demo.show_debug()"]
        ]]
    ]

    unreg_command = ""
    for script in Scripts:
        for s in script[1]:
            unreg_command += 'graphiti.unregister_script("' + s[0] + '")\n'

    for script in Scripts:
        reg_command = ""
        for s in script[1]:
            reg_command += 'graphiti.register_script("' + s[0] + '", "' + s[1] + '")\n'
        graphiti.register_script(script[0], unreg_command + "\n" + reg_command) 

    graphiti.register_script("==========", "pass")

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script('#started', 'std.load_json("' + sys.argv[2] + '")') 
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("space")
    graphiti.start()
示例#13
0
def start():
    Scripts = [
        [
            "Edition",
            [
                ["Info", "std.info()"],
                ["Color Diff", 'diff.color_diff()'],
                ["-", "pass"],
                ["Clear Graph", "demo.clear_graph()"],
                ["Clear Colors", "demo.clear_colors()"],
                ["Clear Icons", "demo.clear_icons()"],
                ["Clear LOD", "demo.clear_lod()"],
                ["Node Type", "demo.color_nodes_by_type()"],
                ["Edge Type", "demo.color_edges_by_type()"],
                ["Country Icons", "demo.countries_to_icons()"],
                [
                    "Depth to LOD",
                    "demo.attribute_to_lod('depth', lambda a: a)"
                ],
                [
                    "Search by Node Attribute",
                    "diff.search_by_attribute(True, False)"
                ],
                [
                    "Search by Edge Attribute",
                    "diff.search_by_attribute(False, True)"
                ],
            ]
        ],
        [
            "Colors",
            [
                [
                    "Dim Nodes",
                    "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], True, False)"
                ],
                [
                    "Dim Edges",
                    "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], False, True)"
                ],
                [
                    "Brighten Nodes",
                    "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], True, False)"
                ],
                [
                    "Brighten Edges",
                    "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], False, True)"
                ],
                [
                    "Dim Nodes Alpha",
                    "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], True, False)"
                ],
                [
                    "Dim Edges Alpha",
                    "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], False, True)"
                ],
                [
                    "Brighten Nodes Alpha",
                    "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], True, False)"
                ],
                [
                    "Brighten Edges Alpha",
                    "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], False, True)"
                ],
            ]
        ],
        [
            "Arrangement",
            [
                ["Lock / Unlock", "demo.lock_unlock()"],
                ["Point Layout", "demo.sphere_layout(0)"],
                ["Sphere Layout", "demo.sphere_layout(20)"],
                ["Cube Layout", "demo.cube_layout()"],
                ["Conic Layout", "demo.conic_layout()"],
                ["Depth Circle Layout", "demo.depth_circle_layout()"],
                ["Globe Layout", "demo.globe_layout()"],
            ]
        ],
        [
            "Topology",
            [["Neighbors", "demo.color_neighbors()"],
             ["Connected Components", "demo.show_connected_components()"],
             ["High Degrees", "demo.show_high_degrees()"],
             ["Low Degrees", "demo.show_low_degrees()"],
             ["Node Connections", "demo.color_by_node_degree()"],
             ["Detect SPN", "demo.detect_spn()"]]
        ],
        [
            "Animation",
            [[
                "Start",
                "graphiti.set_attribute('graphiti:space:animation', 'bool', 'True')"
            ],
             [
                 "Stop",
                 "graphiti.set_attribute('graphiti:space:animation', 'bool', 'False')"
             ]]
        ]
    ]

    unreg_command = ""
    for script in Scripts:
        for s in script[1]:
            unreg_command += 'graphiti.unregister_script("' + s[0] + '")\n'

    for script in Scripts:
        reg_command = ""
        for s in script[1]:
            reg_command += 'graphiti.register_script("' + s[0] + '", "' + s[
                1] + '")\n'

        graphiti.register_script(script[0], unreg_command + "\n" + reg_command)

    graphiti.register_script("==========", "pass")

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script(
                '#started',
                'std.load_json("' + sys.argv[2] + '"); diff.color_diff()')
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("space")
    graphiti.start()
示例#14
0
def start():
    Scripts = [
        ["Edition", [
            ["Info", "std.info()"],
            ["Color Diff", 'diff.color_diff()'],

            ["-", "pass"],

            ["Clear Graph", "demo.clear_graph()"],
            ["Clear Colors", "demo.clear_colors()"],
            ["Clear Icons", "demo.clear_icons()"],
            ["Clear LOD", "demo.clear_lod()"],
            ["Node Type", "demo.color_nodes_by_type()"],
            ["Edge Type", "demo.color_edges_by_type()"],
            ["Country Icons", "demo.countries_to_icons()"],
            ["Depth to LOD", "demo.attribute_to_lod('depth', lambda a: a)"],
            ["Search by Node Attribute", "diff.search_by_attribute(True, False)"],
            ["Search by Edge Attribute", "diff.search_by_attribute(False, True)"],
        ]],
        ["Colors", [
            ["Dim Nodes", "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], True, False)"],
            ["Dim Edges", "demo.multiply_colors([0.7, 0.7, 0.7, 1.0], False, True)"],
            ["Brighten Nodes", "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], True, False)"],
            ["Brighten Edges", "demo.multiply_colors([1.3, 1.3, 1.3, 1.0], False, True)"],
            ["Dim Nodes Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], True, False)"],
            ["Dim Edges Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 0.7], False, True)"],
            ["Brighten Nodes Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], True, False)"],
            ["Brighten Edges Alpha", "demo.multiply_colors([1.0, 1.0, 1.0, 1.3], False, True)"],
        ]],
        ["Arrangement", [
            ["Lock / Unlock", "demo.lock_unlock()"],
            ["Point Layout", "demo.sphere_layout(0)"],
            ["Sphere Layout", "demo.sphere_layout(20)"],
            ["Cube Layout", "demo.cube_layout()"],
            ["Conic Layout", "demo.conic_layout()"],
            ["Depth Circle Layout", "demo.depth_circle_layout()"],
            ["Globe Layout", "demo.globe_layout()"],
        ]],
        ["Topology", [
            ["Neighbors", "demo.color_neighbors()"],
            ["Connected Components", "demo.show_connected_components()"],
            ["High Degrees", "demo.show_high_degrees()"],
            ["Low Degrees", "demo.show_low_degrees()"],
            ["Node Connections", "demo.color_by_node_degree()"],
            ["Detect SPN", "demo.detect_spn()"]
        ]],
        ["Animation", [
            ["Start", "graphiti.set_attribute('graphiti:space:animation', 'bool', 'True')"],
            ["Stop", "graphiti.set_attribute('graphiti:space:animation', 'bool', 'False')"]
        ]]
    ]

    unreg_command = ""
    for script in Scripts:
        for s in script[1]:
            unreg_command += 'graphiti.unregister_script("' + s[0] + '")\n'

    for script in Scripts:
        reg_command = ""
        for s in script[1]:
            reg_command += 'graphiti.register_script("' + s[0] + '", "' + s[1] + '")\n'

        graphiti.register_script(script[0], unreg_command + "\n" + reg_command) 

    graphiti.register_script("==========", "pass")

    if len(sys.argv) == 3:
        if sys.argv[2].endswith(".json"):
            graphiti.register_script('#started', 'std.load_json("' + sys.argv[2] + '"); diff.color_diff()') 
        else:
            print("Unrecognized format <'" + sys.argv[2] + "'> !")

    graphiti.create_window("OpenGraphiti : Data Visualization Engine", 0, 0)
    graphiti.create_entity("graph")
    graphiti.create_visualizer("space")
    graphiti.start()