1 '''
2 Home of the code which knows how to actually *draw* a graph which
3 has been layed out.
4 '''
5
7 '''
8 Only a "renderer" knows how big each node will end up based on metadata
9 in the graph which is specific to the renderer.
10
11 All renderers should be able to set the (x,y) "size" tuple
12 '''
14 self._vg_graph = graph
15 self._vg_layout = None
16
17 self._vg_rendering = False
18 self._vg_canvas_width = 0
19 self._vg_canvas_height = 0
20
22 self._vg_rendering = True
23 self._vg_canvas_width = width
24 self._vg_canvas_height = height
25
27 self._vg_rendering = False
28
30 '''
31 Calculate the sizes for each node based on graph metadata (or defaults)
32 '''
33 raise Exception('%s must implement setNodeSizes!' % self.__class__.__name__)
34
36 '''
37 Render the given node at the specified position.
38 '''
39 raise Exception('%s must implement renderNode!' % self.__class__.__name__)
40
42 '''
43 Render an edge in the graph by drawing lines between all the listed
44 points (as (x,y) tuples...)
45 '''
46 raise Exception('%s must implement renderNode!' % self.__class__.__name__)
47