function EpisodeCluster(episodes) {
  this.episodes_ = episodes;
  this.centroid_ = viewfinder.k_nearest_means.ComputeCentroid_(episodes);
  var episode = viewfinder.k_nearest_means.FindNearest(this.centroid_, episodes);
  if (episode) {
    this.location_ = episode.location_;
    this.placemark_ = episode.placemark_;
  } else {
    this.location_ = null;
    this.placemark_ = null;
  }
}
/**
 * A cluster of episodes. Contains an array of episodes and a cluster
 * location & placemark. The location of the cluster is simply the
 * location of the episode which is closest to the cluster's geographic
 * centroid.
 *
 * If no episode in the cluster has a location, location_ and placemark_
 * will be null.
 */
A cluster of episodes. Contains an array of episodes and a cluster
location & placemark. The location of the cluster is simply the
location of the episode which is closest to the cluster's geographic
centroid.

If no episode in the cluster has a location, location_ and placemark_
will be null.
A cluster of episodes . Contains an array of episodes and a cluster location & placemark . The location of the cluster is simply the location of the episode which is closest to the cluster ' s geographic centroid . If no episode in the cluster has a location location_ and placemark_ will be null .
function EpisodeCluster(episodes) {
  this.episodes_ = episodes;
  this.centroid_ = viewfinder.k_nearest_means.ComputeCentroid_(episodes);
  var episode = viewfinder.k_nearest_means.FindNearest(this.centroid_, episodes);
  if (episode) {
    this.location_ = episode.location_;
    this.placemark_ = episode.placemark_;
  } else {
    this.location_ = null;
    this.placemark_ = null;
  }
}
function EpisodeCluster ( episodes ) { this . episodes_ = episodes ; this . centroid_ = viewfinder . k_nearest_means . ComputeCentroid_ ( episodes ) ; var episode = viewfinder . k_nearest_means . FindNearest ( this . centroid_ , episodes ) ; if ( episode ) { this . location_ = episode . location_ ; this . placemark_ = episode . placemark_ ; } else { this . location_ = null ; this . placemark_ = null ; } }
A cluster of episodes.
A cluster of episodes .