<commit_before>
    var sel_line = '';
    var sel_dir = '';
    var sel_boundary = '';
    var sep_dict = {};
    var zip_dict = {};
    var zipcode_geojson = {};
    var sepLayer = "sep_bounds.geojson";
    var tmLayer = "tm_fill.geojson";
    var zipLayer = "zipcode_tm.geojson";
    var boundary;
//dictionary for storing query params and values
    var sel_args = {
        rte : "",
        dir : "",
        day : "",
        tod : "",
        orig : "",
        dest : "",
        travel: "",
        satisfaction: "",
        boundary: ""
    }

    //creates a list to store origin and destination latlng objects
    var originList = [];
    var destinationList = [];

    var dir_lookup = {};
    // creates layers for orig and dest markers
    var origMarkersLayer = new L.LayerGroup();
    var destMarkersLayer = new L.LayerGroup();
    //create layer of orig dest points pair layer
    var odPairLayer = new L.FeatureGroup();
    //create layer to store all orig dest points and path
    var odPairLayerGroup = new L.FeatureGroup();
    //create layer of transit routes layer
    var routeLayer = new L.FeatureGroup();
    //create boundary geojson layergroup
    var boundaryLayer = new L.FeatureGroup();
    //create origin and destination points heat layergroups
    var originHeatGroup = new L.FeatureGroup();
    var destHeatGroup = new L.FeatureGroup();

    var hasLegend = false;
    var highLight = null;
    var selected;
    var style = {
                color: '#ff6600',
                weight: 2,
                opacity: 0.6,
                smoothFactor: 1,
                dashArray: '10,10',
                clickable: true
    };
    var dmarkerStyle = {
                clickable: true,
                fillColor: "#4BF01B",
                radius: 10,
                weight: 1,
                opacity: 0.2,
                fillOpacity: 0.6
    };
    var omarkerStyle = {
                clickable: true,
                fillColor: "#259CEF",
                radius: 10,
                weight: 1,
                opacity: 0.2,
                fillOpacity: 0.6
    };
    var newStyle = {
                color:'red',
                opacity: 0.9,
                weight:5
    }

    var heatmapOptions = {
                radius: 25,
                maxZoom:16
    }

//initialize map 
$(document).ready(function() {
    mymap = L.map('mapid', {scrollWheelZoom:true}).setView([45.48661, -122.65343], 10);
    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>', {
    attribution: '<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox &copy; OpenStreetMap</a>',
    id: 'mapbox.light',
    maxZoom: 18,
    minZoom: 10
    }).addTo(mymap);
    console.log(mymap);

    var geocoder = L.control.geocoder('mapzen-JfUFYiC', geocoderOptions);
    var geocoderOptions = {
        autocomplete: true,
        pointIcon: 'https://cdn2.iconfinder.com/data/icons/travel-map-and-location/64/geo_location-128.png',
        position: 'topleft',
        expanded: true,
        panToPoint: true,
        placeholder: 'Search nearby',
        markers: true,
        focus: [45.48661, -122.65343],
        title: 'Address Search'
    }
    var markeroptions = {
        icon: myIcon,
        clickable: true,
        riseOnHover: true
    }
    var myIcon = L.icon({
        iconUrl: 'https://cdn2.iconfinder.com/data/icons/travel-map-and-location/64/geo_location-128.png',
        iconSize: [38, 95],
        iconAnchor: [22, 94],
        popupAnchor: [-3, -76],
    });

    geocoder.setPosition('topright');

    //add geocoder to mymap
    geocoder.addTo(mymap);

    //add TriMet service district boundary to map on load
    addLayer("tm_fill.geojson");

    //set mapview checkbox for point map true
    $('input.checkview')[0].checked = true;
    //set mapview checkboxes for heatmap false
    $('input.checkview')[1].checked = false;
    $('input.checkview')[2].checked = false;

    $("input[type='checkbox']").change(
        function() {
            $('input[type="checkbox"]').not(this).prop('checked', false);
            if ($('input.checkview')[0].checked) {
                //clear layers
                resetLayers();
                removeLayers(mymap);

                addLayer(tmLayer);
                rebuild(sel_args);
                if (sel_args.rte && sel_args.dir) {
                    rebuildPath(sel_args);
                }
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[1].checked) {
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                buildHeatmap(sel_args, addOriginHeatMap, function(){});
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[2].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                buildHeatmap(sel_args, function(){}, addDestHeatMap);
                console.log("dest heatmap added!");
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[3].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                addLayer();
                console.log("zipcode checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args);

            } else if ($('input.checkview')[4].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                //addLayer("sep_bounds.geojson");
                console.log("sep checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args, sepLayer, addLayer);
            } else {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                console.log("taz checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args);
            }
        });

    toggle_tb();

    //load map with markers on initial page load with no filter params
    rebuild(sel_args);
    //function for when a bus/MAX/WES route is selected
    $('#filter_line a').on('click', function() {
        sel_line = $(this).attr('rte');
        console.log(sel_line);
        sel_args.rte = sel_line;
        sel_dir = '';
        console.log(sel_dir);
        sel_args.dir = sel_dir;
        console.log(sel_args);
        $("#line_btn").text(this.text+' ').append('<span class="caret"></span>');

        if (this.text == "All") {
            //resert direction
            //show directions even the select is all
            $(".direction_cls").show();
            sel_args.rte = '';
        }
        else {
            //update direction dropdown with correct names
            var dir = dir_lookup[sel_line];
            console.log(this.text);
            //console.log(dir_lookup);
            $("#outbound_link").text(dir[0].dir_desc).attr("dir", dir[0].dir).show();
            //console.log(dir);
            $("#inbound_link").text(dir[1].dir_desc).attr("dir", dir[1].dir).show();
            $(".direction_cls").show();
        }
        
        $("#dir_btn").text('All ').append('<span class="caret"></span>');
        
        if (sel_line == 'All') {
            sel_line = '';
            sel_dir = '';
            sel_args.rte = '';
            sel_args.dir = '';
        }
        resetLayers();
        //add mapview based on which checkbox is selected
        addMapview();
        if (sel_line && sel_dir !== null) {
            addRouteJson(sel_line,0);
            console.log("route geojson added!");
        }
    });
    //function for when direction for a route is selected
    $('#filter_dir a').on('click', function() {
        sel_dir = $(this).attr("dir");
        console.log("sel_dir: " + sel_dir);
        sel_args.dir = sel_dir;
        console.log(sel_args);
        $("#dir_btn").text(this.text+' ').append('<span class="caret"></span>');
        
        if (sel_dir == 'All') {<commit_msg>added dest_spe to sel_args, added request boundary data to sel_line<commit_after>
    var sel_line = '';
    var sel_dir = '';
    var sel_boundary = '';
    var dest_sep = '';
    var sep_dict = {};
    var zip_dict = {};
    var zipcode_geojson = {};
    var sepLayer = "sep_bounds.geojson";
    var tmLayer = "tm_fill.geojson";
    var zipLayer = "zipcode_tm.geojson";
    var boundary;
//dictionary for storing query params and values
    var sel_args = {
        rte : "",
        dir : "",
        day : "",
        tod : "",
        orig : "",
        dest : "",
        travel: "",
        satisfaction: "",
        boundary: "",
        dest_sep: ""
    }

    //creates a list to store origin and destination latlng objects
    var originList = [];
    var destinationList = [];

    var dir_lookup = {};
    // creates layers for orig and dest markers
    var origMarkersLayer = new L.LayerGroup();
    var destMarkersLayer = new L.LayerGroup();
    //create layer of orig dest points pair layer
    var odPairLayer = new L.FeatureGroup();
    //create layer to store all orig dest points and path
    var odPairLayerGroup = new L.FeatureGroup();
    //create layer of transit routes layer
    var routeLayer = new L.FeatureGroup();
    //create boundary geojson layergroup
    var boundaryLayer = new L.FeatureGroup();
    //create origin and destination points heat layergroups
    var originHeatGroup = new L.FeatureGroup();
    var destHeatGroup = new L.FeatureGroup();

    var hasLegend = false;
    var highLight = null;
    var selected;
    var style = {
                color: '#ff6600',
                weight: 2,
                opacity: 0.6,
                smoothFactor: 1,
                dashArray: '10,10',
                clickable: true
    };
    var dmarkerStyle = {
                clickable: true,
                fillColor: "#4BF01B",
                radius: 10,
                weight: 1,
                opacity: 0.2,
                fillOpacity: 0.6
    };
    var omarkerStyle = {
                clickable: true,
                fillColor: "#259CEF",
                radius: 10,
                weight: 1,
                opacity: 0.2,
                fillOpacity: 0.6
    };
    var newStyle = {
                color:'red',
                opacity: 0.9,
                weight:5
    }

    var heatmapOptions = {
                radius: 25,
                maxZoom:16
    }

//initialize map 
$(document).ready(function() {
    mymap = L.map('mapid', {scrollWheelZoom:true}).setView([45.48661, -122.65343], 10);
    L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=<KEY>tVmYOwMrVIuFw', {
    attribution: '<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox &copy; OpenStreetMap</a>',
    id: 'mapbox.light',
    maxZoom: 18,
    minZoom: 10
    }).addTo(mymap);
    console.log(mymap);

    var geocoder = L.control.geocoder('mapzen-JfUFYiC', geocoderOptions);
    var geocoderOptions = {
        autocomplete: true,
        pointIcon: 'https://cdn2.iconfinder.com/data/icons/travel-map-and-location/64/geo_location-128.png',
        position: 'topleft',
        expanded: true,
        panToPoint: true,
        placeholder: 'Search nearby',
        markers: true,
        focus: [45.48661, -122.65343],
        title: 'Address Search'
    }
    var markeroptions = {
        icon: myIcon,
        clickable: true,
        riseOnHover: true
    }
    var myIcon = L.icon({
        iconUrl: 'https://cdn2.iconfinder.com/data/icons/travel-map-and-location/64/geo_location-128.png',
        iconSize: [38, 95],
        iconAnchor: [22, 94],
        popupAnchor: [-3, -76],
    });

    geocoder.setPosition('topright');

    //add geocoder to mymap
    geocoder.addTo(mymap);

    //add TriMet service district boundary to map on load
    addLayer("tm_fill.geojson");

    //set mapview checkbox for point map true
    $('input.checkview')[0].checked = true;
    //set mapview checkboxes for heatmap false
    $('input.checkview')[1].checked = false;
    $('input.checkview')[2].checked = false;

    $("input[type='checkbox']").change(
        function() {
            $('input[type="checkbox"]').not(this).prop('checked', false);
            if ($('input.checkview')[0].checked) {
                //clear layers
                resetLayers();
                removeLayers(mymap);

                addLayer(tmLayer);
                rebuild(sel_args);
                if (sel_args.rte && sel_args.dir) {
                    rebuildPath(sel_args);
                }
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[1].checked) {
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                buildHeatmap(sel_args, addOriginHeatMap, function(){});
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[2].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                buildHeatmap(sel_args, function(){}, addDestHeatMap);
                console.log("dest heatmap added!");
                if (sel_line && sel_dir !== null) {
                    addRouteJson(sel_line,0);
                    console.log("route geojson added!");
                }
            } else if ($('input.checkview')[3].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                addLayer();
                console.log("zipcode checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args, zipLayer, addLayer);

            } else if ($('input.checkview')[4].checked) {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                //addLayer("sep_bounds.geojson");
                console.log("sep checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args, sepLayer, addLayer);
            } else {
                //clear and reset layers
                resetLayers();
                removeLayers(mymap);
                addLayer(tmLayer);
                console.log("taz checkbox checked!");
                console.log($(this).attr("value"));
                sel_boundary = $(this).attr("value");
                console.log("boundary selected: " + sel_boundary);
                sel_args.boundary = sel_boundary;
                requestBoundaryData(sel_args);
            }
        });

    toggle_tb();

    //load map with markers on initial page load with no filter params
    rebuild(sel_args);
    //function for when a bus/MAX/WES route is selected
    $('#filter_line a').on('click', function() {
        sel_line = $(this).attr('rte');
        console.log(sel_line);
        sel_args.rte = sel_line;
        sel_dir = '';
        console.log(sel_dir);
        sel_args.dir = sel_dir;
        console.log(sel_args);
        $("#line_btn").text(this.text+' ').append('<span class="caret"></span>');

        if (this.text == "All") {
            //resert direction
            //show directions even the select is all
            $(".direction_cls").show();
            sel_args.rte = '';
        }
        else {
            //update direction dropdown with correct names
            var dir = dir_lookup[sel_line];
            console.log(this.text);
            //console.log(dir_lookup);
            $("#outbound_link").text(dir[0].dir_desc).attr("dir", dir[0].dir).show();
            //console.log(dir);
            $("#inbound_link").text(dir[1].dir_desc).attr("dir", dir[1].dir).show();
            $(".direction_cls").show();
        }
        
        $("#dir_btn").text('All ').append('<span class="caret"></span>');
        
        if (sel_line == 'All') {
            sel_line = '';
            sel_dir = '';
            sel_args.rte = '';
            sel_args.dir = '';
        }
        resetLayers();
        //add mapview based on which checkbox is selected
        addMapview();
        requestBoundaryData(sel_args, sepLayer, addLayer);
        if (sel_line && sel_dir !== null) {
            addRouteJson(sel_line,0);
            console.log("route geojson added!");
        }
    });
    //function for when direction for a route is selected
    $('#filter_dir a').on('click', function() {
        sel_dir = $(this).attr("dir");
        console.log("sel_dir: " + sel_dir);
        sel_args.dir = sel_dir;
        console.log(sel_args);
        $("#dir_btn").text(this.text+' ').append('<span class="caret"></span>');
        
        if (sel_dir == 'All') {
{'fraction_non_alphanumeric': 0.13709201993675973, 'fraction_numerical': 0.012326491237472533, 'mean_word_length': 1.7086659892582379, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '2456977', 'n_tokens_mistral': 5645, 'n_tokens_neox': 5246, 'n_words': 1131}