Exemple #1
0
 def __init__(self,eid,label=None, size=1, x=0, y=0, z=0, red=0.5, green=0.5, blue=0.5):
     '''
     Constructor
     '''
     if not label:
         label = eid
     GraphEntity.__init__(self, eid,  {"label":label,"size":size,"x":x,"y":y,"z":z,"r":red,"g":green,"b":blue})    
Exemple #2
0
    def __init__(self, source, target, directed, eid=None, weight=1, label="", red=0.5, green=0.5, blue=0.5):
        """
        Constructor
        """
        if type(source) == Node:
            source = source.object.keys()[0]
        if type(target) == Node:
            target = target.object.keys()[0]

        if not eid:
            if directed:
                eid = "%s-->%s" % (source, target)
            else:
                eid = "%s--%s" % (source, target)

        GraphEntity.__init__(
            self,
            eid,
            {
                "source": source,
                "target": target,
                "weight": weight,
                "directed": directed,
                "label": label,
                "r": red,
                "g": green,
                "b": blue,
            },
        )