parameters: (self)
docstring: get layout coordinate of node in graph board
docstring_summary: get layout coordinate of node in graph board
docstring_tokens: get layout coordinate of node in graph board
function: def get_layout_coordinate(self):
          """
          get layout coordinate of node in graph board
          """
          # map node_name to its coordinate list(x, y)
          self.map_node_to_coordinate = dict()
          start_cord_x = 0
          horizon_step = 500
          vertical_step = 200
          # assign start nodes
          start_nodes = self.graph_proto.ins
          for node in start_nodes:
              self.map_node_to_coordinate[node] = [start_cord_x, 0]
              start_cord_x = start_cord_x + horizon_step
          # assign middle nodes
          nodes = self.graph_proto.nodes
          while len(self.map_node_to_coordinate.keys()) < len(nodes):
              for node_proto in nodes:
                  if node_proto.name in self.map_node_to_coordinate.keys():
                      x = self.map_node_to_coordinate[node_proto.name][0]
                      y = self.map_node_to_coordinate[node_proto.name][1]
                      inc_step = 0
                      for next_node_name in self.get_edge_nexts(node_proto.name):
                          self.map_node_to_coordinate[next_node_name] = [0, 0]
                          self.map_node_to_coordinate[next_node_name][0] = x + inc_step
                          inc_step = inc_step + horizon_step
                          self.map_node_to_coordinate[next_node_name][1] = y + vertical_step
                  else: 
                      break
function_tokens: def get_layout_coordinate ( self ) : # map node_name to its coordinate list(x, y) self . map_node_to_coordinate = dict ( ) start_cord_x = 0 horizon_step = 500 vertical_step = 200 # assign start nodes start_nodes = self . graph_proto . ins for node in start_nodes : self . map_node_to_coordinate [ node ] = [ start_cord_x , 0 ] start_cord_x = start_cord_x + horizon_step # assign middle nodes nodes = self . graph_proto . nodes while len ( self . map_node_to_coordinate . keys ( ) ) < len ( nodes ) : for node_proto in nodes : if node_proto . name in self . map_node_to_coordinate . keys ( ) : x = self . map_node_to_coordinate [ node_proto . name ] [ 0 ] y = self . map_node_to_coordinate [ node_proto . name ] [ 1 ] inc_step = 0 for next_node_name in self . get_edge_nexts ( node_proto . name ) : self . map_node_to_coordinate [ next_node_name ] = [ 0 , 0 ] self . map_node_to_coordinate [ next_node_name ] [ 0 ] = x + inc_step inc_step = inc_step + horizon_step self . map_node_to_coordinate [ next_node_name ] [ 1 ] = y + vertical_step else : break