def _DrawTrips(self,triplist,colpar=""):
    """Generates svg polylines for each transit trip.

    Args:
      # Class Trip is defined in transitfeed.py
      [Trip, Trip, ...]

    Returns:
      # A string containing a polyline tag for each trip
      ' <polyline class="T" stroke="#336633" points="433,0 ...'
    """

    stations = []
    if not self._stations and triplist:
      self._stations = self._CalculateYLines(self._TravelTimes(triplist))
      if not self._stations:
        self._AddWarning("Failed to use traveltimes for graph")
        self._stations = self._CalculateYLines(self._Uniform(triplist))
        if not self._stations:
          self._AddWarning("Failed to calculate station distances")
          return

    stations = self._stations
    tmpstrs = []
    servlist = []
    for t in triplist:
      if not colpar:
        if t.service_id not in servlist:
          servlist.append(t.service_id)
        shade = int(servlist.index(t.service_id) * (200/len(servlist))+55)
        color = "#00%s00" %  hex(shade)[2:4]
      else:
        color=colpar

      start_offsets = [0]
      first_stop = t.GetTimeStops()[0]

      for j,freq_offset in enumerate(start_offsets):
        if j>0 and not colpar:
          color="purple"
        scriptcall = 'onmouseover="LineClick(\'%s\',\'Trip %s starting %s\')"' % (t.trip_id,
            t.trip_id, transitfeed.FormatSecondsSinceMidnight(t.GetStartTime()))
        tmpstrhead = '<polyline class="T" id="%s" stroke="%s" %s points="' % \
          (str(t.trip_id),color, scriptcall)
        tmpstrs.append(tmpstrhead)

        for i, s in enumerate(t.GetTimeStops()):
          arr_t = s[0]
          dep_t = s[1]
          if arr_t is None or dep_t is None:
            continue
          arr_x = int(arr_t/3600.0 * self._hour_grid) - self._hour_grid * self._offset
          dep_x = int(dep_t/3600.0 * self._hour_grid) - self._hour_grid * self._offset
          tmpstrs.append("%s,%s " % (int(arr_x+20), int(stations[i]+20)))
          tmpstrs.append("%s,%s " % (int(dep_x+20), int(stations[i]+20)))
        tmpstrs.append('" />')
    return "".join(tmpstrs)
dataset/ETHPy150Open google/transitfeed/gtfsscheduleviewer/marey_graph.py/MareyGraph._DrawTrips/original