#NEWLINE# def avg_area( self ) : #NEWLINE# #INDENT# 'Return the combined average graph area per shape.' #NEWLINE# components_data = self . components ( ) . values ( ) #NEWLINE# shape_count = len ( components_data ) #NEWLINE# total_area = 0.0 #NEWLINE# for component in components_data : #NEWLINE# #INDENT# vertex_by_name = { data [ 'name' ] : data [ 'counter_vertex' ] for data in component [ 'edges' ] . values ( ) } #NEWLINE# cntr_edge_names = component [ 'clockwise_edge_names' ] #NEWLINE# cntr_vertexes = [ vertex_by_name [ name ] for name in y1 ] #NEWLINE# for i in range ( ( - 1 ) , ( len ( cntr_vertexes ) - 1 ) ) : #NEWLINE# #INDENT# ( ( y0 , x0 ) , ( y1 , x1 ) ) = ( cntr_vertexes [ i ] , cntr_vertexes [ ( i + 1 ) ] ) #NEWLINE# total_area += ( 0.5 * ( ( x1 * y0 ) - ( y1 * x0 ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return abs ( ( float ( total_area ) / shape_count ) )