<commit_before>import React, { Component } from 'react'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'

const MAP = {
  lat: 47,
  lon: 1,
  zoom: 4,
  osmUrl: 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
  osmAttribution: '&copy; Contributeurs <a href="http://osm.org/copyright">OpenStreetMap</a>',
}

class CenteredMap extends Component {

  componentDidMount() {
    const { vectors, map } = this.refs

    if (vectors && map) {
      const bounds = vectors.leafletElement.getBounds()
      map.leafletElement.fitBounds(bounds)
    }
  }

  render() {
    const zoom = this.props.zoom || MAP.zoom
    const lat = this.props.lat || MAP.lat
    const lon = this.props.lon || MAP.lon

    const { vectors, className, frozen } = this.props

    return (
      <Map ref="map" className={className} center={[lat, lon]} zoom={zoom} dragging={!frozen} scrollWheelZoom={false} zoomControl={!frozen}>
        <TileLayer attribution={MAP.osmAttribution} url={MAP.osmUrl} />
        <GeoJSON color='blue' fillOpacity={0.1} weight={2} ref="vectors" data={vectors} />
      </Map>
    )
  }
}

export default CenteredMap<commit_msg>Disable spatial extent map double click zoom<commit_after>import React, { Component } from 'react'
import { Map, TileLayer, GeoJSON } from 'react-leaflet'

const MAP = {
  lat: 47,
  lon: 1,
  zoom: 4,
  osmUrl: 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
  osmAttribution: '&copy; Contributeurs <a href="http://osm.org/copyright">OpenStreetMap</a>',
}

class CenteredMap extends Component {

  componentDidMount() {
    const { vectors, map } = this.refs

    if (vectors && map) {
      const bounds = vectors.leafletElement.getBounds()
      map.leafletElement.fitBounds(bounds)
    }
  }

  render() {
    const zoom = this.props.zoom || MAP.zoom
    const lat = this.props.lat || MAP.lat
    const lon = this.props.lon || MAP.lon

    const { vectors, className, frozen } = this.props

    return (
      <Map
        ref="map"
        className={className}
        center={[lat, lon]}
        zoom={zoom}
        dragging={!frozen}
        scrollWheelZoom={false}
        doubleClickZoom={false}
        zoomControl={!frozen}
      >
        <TileLayer attribution={MAP.osmAttribution} url={MAP.osmUrl} />
        <GeoJSON color='blue' fillOpacity={0.1} weight={2} ref="vectors" data={vectors} />
      </Map>
    )
  }
}

export default CenteredMap
{'fraction_non_alphanumeric': 0.15285832642916322, 'fraction_numerical': 0.00579950289975145, 'mean_word_length': 3.114139693356048, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '1183489', 'n_tokens_mistral': 850, 'n_tokens_neox': 800, 'n_words': 172}