<commit_before><template lang="html">
    <div class="" style="position: relative; width: 100%; height: 100%">
        <div id="map"></div>
    </div>
</template>

<script>
//import mapboxgl from 'mapbox-gl';
import mapboxgl from 'mapbox-gl';
import axios from 'axios';
import geojsonDataMerge from '../modules/geojsondatamerge';
import {prettyNumber} from '../modules/number_format';
import getURLParameter from '../modules/geturlparams';
import {replaceState} from '../modules/tracking';

export default {
    name: 'sc-map',
    watch: {
        'sharedState.selected': 'selectNeighborhoods',
        'sharedState.breaks': 'updateBreaks',
        'sharedState.year': 'updateYear',
        'sharedState.marker': 'createMarker',
        'sharedState.zoomNeighborhoods': 'zoomNeighborhoods'
    },
    methods: {
        initMap: function() {
            let _this = this;
            _this.privateState.map = new mapboxgl.Map(_this.privateState.mapOptions);

            let map = _this.privateState.map;

            this.privateState.locationPopup = new mapboxgl.Popup({
                closeButton: true,
                closeOnClick: false
            });

            // add nav control
            var nav = new mapboxgl.NavigationControl();
            map.addControl(nav, 'top-right');

            // disable map rotation until 3D support added
            // map.dragRotate.disable();
            // map.touchZoomRotate.disableRotation();

            map.on('rotate', function(e) {
                if (map.getPitch() > 25) {
                    map.setLayoutProperty('neighborhoods-fill-extrude', 'visibility', 'visible');
                    map.setLayoutProperty('neighborhoods-fill-selected', 'visibility', 'visible');
                } else {
                    map.setLayoutProperty('neighborhoods-fill-extrude', 'visibility', 'none');
                    map.setLayoutProperty('neighborhoods-fill-selected', 'visibility', 'none');
                }
            });

            // after map initiated, grab geography and intiate/style neighborhoods
            map.on('style.load', function () {
                axios.get('data/geography.geojson.json')<commit_msg>Enable map mouse pitch and rotation<commit_after><template lang="html">
    <div class="" style="position: relative; width: 100%; height: 100%">
        <div id="map"></div>
    </div>
</template>

<script>
//import mapboxgl from 'mapbox-gl';
import mapboxgl from 'mapbox-gl';
import axios from 'axios';
import geojsonDataMerge from '../modules/geojsondatamerge';
import {prettyNumber} from '../modules/number_format';
import getURLParameter from '../modules/geturlparams';
import {replaceState} from '../modules/tracking';

export default {
    name: 'sc-map',
    watch: {
        'sharedState.selected': 'selectNeighborhoods',
        'sharedState.breaks': 'updateBreaks',
        'sharedState.year': 'updateYear',
        'sharedState.marker': 'createMarker',
        'sharedState.zoomNeighborhoods': 'zoomNeighborhoods'
    },
    methods: {
        initMap: function() {
            let _this = this;
            _this.privateState.map = new mapboxgl.Map(_this.privateState.mapOptions);

            let map = _this.privateState.map;

            this.privateState.locationPopup = new mapboxgl.Popup({
                closeButton: true,
                closeOnClick: false
            });

            // add nav control
            var nav = new mapboxgl.NavigationControl();
            map.addControl(nav, 'top-right');

            // disable map rotation until 3D support added
            // map.dragRotate.disable();
            map.touchZoomRotate.disableRotation();

            map.on('rotate', function(e) {
                if (map.getPitch() > 25) {
                    map.setLayoutProperty('neighborhoods-fill-extrude', 'visibility', 'visible');
                    map.setLayoutProperty('neighborhoods-fill-selected', 'visibility', 'visible');
                } else {
                    map.setLayoutProperty('neighborhoods-fill-extrude', 'visibility', 'none');
                    map.setLayoutProperty('neighborhoods-fill-selected', 'visibility', 'none');
                }
            });

            // after map initiated, grab geography and intiate/style neighborhoods
            map.on('style.load', function () {
                axios.get('data/geography.geojson.json')
{'fraction_non_alphanumeric': 0.13181299885974915, 'fraction_numerical': 0.004104903078677309, 'mean_word_length': 2.2706935123042506, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '3068254', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1168, 'n_words': 252}