Example #1
0
from streamsvg import Drawing

s = Drawing()

s.addNode("a", [(2, 5)])
s.addNode("b", [(1, 8)])
s.addNode("c", [(0, 0)])
s.addNode("d", [(6, 9)])

s.addLink("a", "b", 2, 4)
s.addLink("b", "d", 7, 8, height=0.4)

s.addTimeLine(ticks=2)
Example #2
0
from streamsvg import Drawing

sg = Drawing(omega=12)

sg.addNode("a", [(0, 4)])
sg.addNode("b", [(2, 8), (10, 12)])
sg.addNode("c", [(2, 11)])

sg.addTime(0, label="a")
sg.addTime(1, label="t")
sg.addTime(6, label="t2")
sg.addTime(9, label="t3")
sg.addTime(10, label="w")

sg.addPath([(3, "a", "b"), (6, "b", "c"), (9, "c", "b")],
           1,
           11,
           gamma=2,
           width=3,
           color='blue')

sg.addTimeLine(ticks=2)
sg.addParameter(0, 2, "g", 2)
Example #3
0
from streamsvg import Drawing

sg = Drawing(alpha=0, omega=3)
sg.addNode("a", [(0, 1)])
sg.addNode("b")
sg.addNode("c", [(0, 1), (2, 3)])

sg.addLink("a", "b", 0, 1)
sg.addLink("b", "c", 0, 1)
sg.addLink("b", "c", 2, 3)

sg.addTimeLine(ticks=1)
Example #4
0
from streamsvg import Drawing

sg = Drawing(alpha=0, omega=4)

sg.addNode("u")
sg.addNode("v")
sg.addNode("w")

sg.addLink("u", "v", 1, 2)
sg.addLink("v", "w", 2, 3)

sg.addPath(((2,"u","v"), (2,"v","w")), 2, 2, color='blue', width=2)

sg.addTimeLine()
Example #5
0
from streamsvg import Drawing

s = Drawing()

s.addNode("a")
s.addNode("b")
s.addNode("c")
s.addNode("d")

s.addLink("a", "b", 0, 4, color="#BBBBBB", width=2)
s.addLink("a", "b", 6, 9, color="#BBBBBB", width=2)
s.addLink("a", "c", 2, 5, height=0.4, width=3)
s.addLink("b", "c", 1, 8, width=3)
s.addLink("b", "d", 7, 10, height=0.4, color="#BBBBBB", width=2)
s.addLink("c", "d", 6, 9, width=3)

s.addNodeCluster("a", [(2, 5)], color="blue", width=3)
s.addNodeCluster("b", [(1, 8)], color="blue", width=3)
s.addNodeCluster("d", [(6, 9)], color="blue", width=3)

s.addTimeLine(ticks=2)
Example #6
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=17)

s.addNode("u")
s.addNode("x")
s.addNode("v")
s.addNode("y")
s.addNode("w")

s.addLink("u", "x", 1, 2)
s.addLink("u", "x", 9, 10)
s.addLink("x", "v", 3, 4)
s.addLink("x", "v", 11, 12)
s.addLink("v", "y", 5, 6)
s.addLink("v", "y", 13, 14)
s.addLink("y", "w", 7, 8)
s.addLink("y", "w", 15, 16)

s.addPath(((2, "u", "x"), (3.5, "x", "v"), (5.5, "v", "y"), (7, "y", "w")),
          2,
          7,
          color='blue',
          width=2)
s.addPath(((10, "u", "x"), (11.5, "x", "v"), (13.5, "v", "y"), (15, "y", "w")),
          10,
          15,
          color='green',
          width=2)

s.addTimeNodeMark(4.5, "v", color="#FF0000", width=1)
Example #7
0
from streamsvg import Drawing

s = Drawing()

s.addNode("a", [(0,10)])
s.addNode("b", [(0,4),(5,10)])
s.addNode("c", [(4,9)])
s.addNode("d", [(1,3)])

s.addLink("a","b",1,3)
s.addLink("a","b",7,8)
s.addLink("b","c",6,9)
s.addLink("b","d",2,3,height=0.4)
s.addLink("a","c",4.5,7.5,height=0.4)

s.addRectangle("a","c",2,4,color="blue")
s.addRectangle("b","d",7,8,color="#ff0000")

s.addTimeLine(ticks=2)

Example #8
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10)

s.addNode("a", [(4, 5)])
s.addNode("b", [(4, 5), (7, 9)])
s.addNode("c", [(4, 5), (7, 9)])
s.addNode("d", [(4, 5), (7, 9)])

s.addLink("a", "c", 4, 5, height=0.40, curving=0.5)
s.addLink("c", "d", 4, 5)
s.addLink("c", "d", 7, 9)
s.addLink("b", "d", 4, 5, height=0.40, curving=0.5)
s.addLink("b", "d", 7, 9, height=0.55, curving=0.4)
s.addLink("a", "b", 4, 5)
s.addLink("b", "c", 7, 9)

s.addTimeLine(ticks=2)
Example #9
0
from streamsvg import Drawing

sg = Drawing()

sg.addNode("ab", [(1, 6)])
sg.addNode("bc", [(3, 9)])
sg.addNode("ac", [(2, 5), (8, 10)])

sg.addLink("ab", "ac", 2, 5, height=0.40)
sg.addLink("ab", "bc", 3, 6)
sg.addLink("ac", "bc", 3, 5)
sg.addLink("ac", "bc", 8, 9)

sg.addTimeLine(ticks=2)
Example #10
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=4)

s.addNode("a", [(0, 0)])
s.addNode("b")
s.addNode("c")

s.addLink("b", "c", 0, 4)

s.addTimeLine(ticks=1)
Example #11
0
File: ex.py Project: ysig/streamsvg
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10, discrete=1.5)

s.addNode("u")
s.addNode("v")
s.addNode("x")
s.addNode("y", [(3,6)])

s.addNodeCluster("u", [(0.5,2)], color='blue', width=200)
s.addNodeCluster("v", color='blue')
s.addNodeCluster("u", [(6,7.5)], color="#ff0000")

s.addLink("u", "v", 1.5, 6)
s.addLink("u", "x", 1.5, 1.5, curving=0.2)
s.addLink("v", "y", 1.5, 1.5, curving=-0.2)
Example #12
0
from streamsvg import Drawing

sg = Drawing()

sg.addNode("a", [(0, 3), (7, 10)])
sg.addNode("b")
sg.addNode("c", [(0, 5)])

sg.addLink("a", "b", 0, 2)
sg.addLink("a", "b", 7, 10)
sg.addLink("b", "c", 2, 5)

# Cluster C
sg.addNodeCluster("b", [(1, 3), (6, 10)], color='blue')
sg.addNodeCluster("a", [(7, 9)], color='blue')

# Neighborhood of C, N(C)
sg.addNodeCluster("a", [(1, 2), (7, 10)], width=5, color='brown')
sg.addNodeCluster("c", [(2, 3)], width=5, color='brown')
sg.addNodeCluster("b", [(7, 9)], width=5, color='brown')

sg.addTimeLine(ticks=2)
Example #13
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10)

s.addNode("a", [(0, 4), (6, 10)])
s.addNode("b", [(0, 2), (3, 3), (4, 10)])
s.addNode("c", [(4, 8)])

s.addLink("a", "b", 0, 0)
s.addLink("a", "b", 2, 2)
s.addLink("a", "b", 3, 3)
s.addLink("a", "b", 6, 6)
s.addLink("a", "b", 7, 8)
s.addLink("b", "c", 4, 8)

s.addTimeLine(ticks=2)
s.addParameter(0, 2, "D", 2)
Example #14
0
from streamsvg import Drawing

s = Drawing()

s.addNode("a", [(5, 7)])
s.addNode("b", [(0, 3), (5, 7), (8, 10)])
s.addNode("c", [(0, 10)])
s.addNode("d", [(0, 2), (3, 7), (8, 10)])
s.addNode("e", [(0, 10)])
s.addNode("f", [(0, 4), (7, 10)])
s.addNode("g", [(0, 4), (5, 10)])

# wcc 1
s.addNodeCluster("a", [(5, 7)], color="#AEC7E8", width=3)
s.addNodeCluster("b", [(5, 7)], color="#AEC7E8", width=3)
# wcc 2
s.addNodeCluster("b", [(0, 3), (8, 10)], color="#FF9896", width=3)
s.addNodeCluster("c", [(0, 10)], color="#FF9896", width=3)
s.addNodeCluster("d", [(3, 7)], color="#FF9896", width=3)
# wcc 3
s.addNodeCluster("d", [(0, 2), (8, 10)], color="#98DF8A", width=3)
s.addNodeCluster("e", [(0, 10)], color="#98DF8A", width=3)
s.addNodeCluster("f", [(0, 4)], color="#98DF8A", width=3)
s.addNodeCluster("g", [(0, 4)], color="#98DF8A", width=3)
# wcc 4
s.addNodeCluster("f", [(7, 10)], color="#FFBB78", width=3)
s.addNodeCluster("g", [(5, 10)], color="#FFBB78", width=3)

s.addLink("a", "b", 5.5, 6.5)
s.addLink("b", "c", 1, 3)
s.addLink("b", "c", 9, 10)
Example #15
0
from streamsvg import Drawing

s = Drawing()

s.addNode("a")
s.addNode("b")
s.addNode("c", [(0,5)])

s.addLink("a","b", 5, 10)
s.addLink("b","c", 0, 5)

s.addTimeLine(ticks=2)
Example #16
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=13, discrete=1)

s.addNode("a")
s.addNode("b", [(1, 5), (7, 13)])
s.addNode("c", [(5, 12)])
s.addNode("d", [(1, 3)])

s.addLink("a", "b", 1, 4, direction='out')
s.addLink("a", "b", 9, 10)
s.addLink("a", "c", 6, 9, curving=0.4)
s.addLink("b", "d", 2, 3, curving=0.4)
s.addLink("b", "c", 8, 12)

s.addTimeLine(ticks=2)
Example #17
0
# Dark blue = 10
# Dark green = 12
# Purple = 21
# Pink = 27
from streamsvg import Drawing

s = Drawing()

s.addNode("A", color='green')
s.addNode("B", color='blue')
s.addNode("C", color='orange')
s.addNode("D", color='magenta')

s.addLink("A", "B", 2, 4)
s.addLink("A", "C", 3, 4, height=0.4)
s.addLink("B", "C", 3, 4)
s.addLink("A", "C", 6, 7)
s.addLink("C", "D", 9, 10)

s.addTimeLine(ticks=2)
Example #18
0
from streamsvg import Drawing

sg = Drawing(alpha=0, omega=10)
sg.addNode("a", [(1, 4), (5, 8)])
sg.addNode("b", [(5, 9)])
sg.addNode("c", [(3, 8)])
sg.addNode("d", [(0, 0)])

sg.addLink("a", "b", 6, 8)
sg.addLink("a", "c", 3, 4, height=0.4)
sg.addLink("b", "c", 5, 8)

sg.addTimeLine(ticks=2)
Example #19
0
from streamsvg import Drawing

sg = Drawing()

sg.addNode("a")
sg.addNode("b")
sg.addNode("c")
sg.addNode("d")

sg.addLink("a", "b", 1, 2)
sg.addLink("b", "c", 3, 4)
sg.addLink("c", "d", 5, 6)
sg.addLink("a", "d", 7, 8)
sg.addLink("b", "d", 9, 10)

sg.addNodeIntervalMark("a", "d")
sg.addTimeIntervalMark(3, 8)

sg.addNodeCluster("a", [(1.9, 2.1), (6.9, 7.1)], color='blue')
sg.addNodeCluster("b", [(2, 3), (8.9, 9.1)], color='blue')
sg.addNodeCluster("c", [(2.9, 3.1), (4.9, 5.1)], color='blue')
sg.addNodeCluster("d", [(5, 7), (8.9, 9.1)], color='blue')

sg.addTimeLine(ticks=2)
Example #20
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10)

s.addNode("a", color='green')
s.addNode("u", color="none", rectangle_color="none")
s.addNode("b", color='green')
s.addNode("v", color="none", rectangle_color="none")
s.addNode("c", color='green')

s.addLink("a", "c", 1, 2, height=0.33)
s.addLink("a", "c", 3, 5, height=0.33)
s.addLink("a", "b", 4, 5)
s.addLink("a", "b", 8, 9)
s.addLink("b", "c", 2, 7)

s.addTimeLine(ticks=2)
Example #21
0
from streamsvg import Drawing

sg = Drawing(alpha=0, omega=11)
sg.addNode("a", [(1, 4)])
sg.addNode("b", [(1, 5), (6, 8)])
sg.addNode("c", [(2, 5), (6, 9)])
sg.addNode("d", [(7, 9)])

sg.addLink("a", "b", 1, 4)
sg.addLink("b", "c", 2, 5)
sg.addLink("b", "c", 6, 8)
sg.addLink("c", "d", 7, 9)

sg.addTimeLine(ticks=2)
Example #22
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10)

s.addNode("a", color='green')
s.addNode("u", color='red')
s.addNode("b", color='green')
s.addNode("v", color='red')
s.addNode("c", color='green')

s.addLink("a", "u", 0, 2)
s.addLink("a", "u", 3, 9)
s.addLink("b", "u", 4, 5)
s.addLink("b", "u", 8, 10)
s.addLink("b", "v", 2, 7)
s.addLink("c", "u", 1, 5, height=0.55)
s.addLink("c", "v", 0, 8)

s.addTimeLine(ticks=2)
Example #23
0
from streamsvg import Drawing

sg = Drawing()

sg.addNode("A", [(0, 3), (7, 10)], color='pink')
sg.addNode("B", [(2, 6), (8, 10)], color='blue')
sg.addNode("C", [(0, 8)], color='green')

sg.addLink("A", "B", 2, 3)
sg.addLink("A", "B", 9, 10)
sg.addLink("A", "C", 7, 8, height=0.6)
sg.addLink("B", "C", 4, 6)

sg.addTimeLine(ticks=2)
Example #24
0
from streamsvg import Drawing

#s = Drawing(alpha=0, omega=5)
s = Drawing(alpha=1, omega=9)

s.addNode("a", [(1, 9)])
s.addNode("b", [(1, 9)])
s.addNode("c", [(3, 9)])

s.addLink("a", "b", 1, 4)
s.addLink("a", "b", 5, 9)
s.addLink("b", "c", 3, 9)

#s.addTimeLine(ticks=1)
#s.addTimeLine(ticks=5, marks=[(2,2)])
s.addTimeLine(ticks=2)
#s.addParameter("D", 1)
from streamsvg import Drawing

s = Drawing(alpha=0, omega=4)

s.addNode("a", [(0, 2)])
s.addNode("b")
s.addNode("c", [(2, 4)])

s.addLink("a", "b", 0, 2)
s.addLink("b", "c", 2, 4)

s.addTimeLine(ticks=1)
Example #26
0
from streamsvg import Drawing

s = Drawing(alpha=0, omega=10)

s.addNode("u")
s.addNode("v")
s.addNode("x")

s.addRectangle("u", "v", 4, 6, color='green')

s.addLink("u", "v", 1.5, 6, curving=0.2)
s.addLink("v", "x", 3, 5)

s.addPath([(2, "u", "v"), (4, "v", "x")], 1, 9, width=2, color='blue')

s.addTimeLine(ticks=2)