<commit_before>import Icon from '@conveyal/woonerf/components/icon'
import React, {PropTypes} from 'react'
import { GeoJSON, Popup } from 'react-leaflet'
// import { Button } from 'react-bootstrap'

import { getRouteName } from '../../editor/util/gtfs'
import { getFeed } from '../../common/util/modules'

const COLORS = ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a']

export default class PatternGeoJson extends GeoJSON {
  static propTypes = {
    pattern: PropTypes.object,
    index: PropTypes.number,
    feeds: PropTypes.array,
    onRouteClick: PropTypes.func,
    popupAction: PropTypes.string,
    newEntityId: PropTypes.number
  }

  _onClickAction = () => {
    const {feeds, onRouteClick, newEntityId, pattern} = this.props
    const route = pattern.route
    const feedId = route ? route.feed_id || route.feed.feed_id : null
    const feed = getFeed(feeds, feedId)
    onRouteClick(route, feed, newEntityId)
  }

  _onEachFeature = (feature, layer) => {
    const {pattern} = this.props
    layer.feature.properties.patternId = pattern.pattern_id
  }

  render () {
    const {feeds,
      index = 0,
      // onRouteClick,
      pattern
      // ,
      // popupAction<commit_msg>refactor(qc-view): change order of pattern colors so single pattern is more easily seen<commit_after>import Icon from '@conveyal/woonerf/components/icon'
import React, {PropTypes} from 'react'
import { GeoJSON, Popup } from 'react-leaflet'
// import { Button } from 'react-bootstrap'

import { getRouteName } from '../../editor/util/gtfs'
import { getFeed } from '../../common/util/modules'

const COLORS = ['#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99']

export default class PatternGeoJson extends GeoJSON {
  static propTypes = {
    pattern: PropTypes.object,
    index: PropTypes.number,
    feeds: PropTypes.array,
    onRouteClick: PropTypes.func,
    popupAction: PropTypes.string,
    newEntityId: PropTypes.number
  }

  _onClickAction = () => {
    const {feeds, onRouteClick, newEntityId, pattern} = this.props
    const route = pattern.route
    const feedId = route ? route.feed_id || route.feed.feed_id : null
    const feed = getFeed(feeds, feedId)
    onRouteClick(route, feed, newEntityId)
  }

  _onEachFeature = (feature, layer) => {
    const {pattern} = this.props
    layer.feature.properties.patternId = pattern.pattern_id
  }

  render () {
    const {
      feeds,
      index = 0,
      // onRouteClick,
      pattern
      // ,
      // popupAction
{'fraction_non_alphanumeric': 0.1386214863303812, 'fraction_numerical': 0.0215633423180593, 'mean_word_length': 3.381112984822934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5092075', 'n_tokens_mistral': 888, 'n_tokens_neox': 872, 'n_words': 205}