<commit_before>function MapboxglSpiderfier(map, userOptions){
  var util = {
      each: eachFn,
      map: mapFn,
      mapTimes: mapTimesFn,
      eachTimes: eachTimesFn
    },
    NULL_FUNCTION = function(){
    },
    options = {
      circleSpiralSwitchover: 9, // show spiral instead of circle from this marker count upwards
      // 0 -> always spiral; Infinity -> always circle
      circleFootSeparation: 50, //related to circumference of circle
      spiralFootSeparation: 50, // related to size of spiral (experiment!)
      spiralLengthStart: 50, // ditto
      spiralLengthFactor: 4, // ditto
      onClick: userOptions.onClick || NULL_FUNCTION,
      initializeMarker: userOptions.initializeMarker || NULL_FUNCTION
    },
    twoPi = Math.PI * 2,
    previousMarkers = [];

  // Public:
  this.spiderfy = spiderfy;
  this.unspiderfy = unspiderfy;

  // Private:
  function spiderfy(latLng, markers) {
    var spiderParams = generateSpiderParams(markers.length);

    unspiderfy();
    previousMarkers = util.map(markers, function(marker, index) {
      var spiderParam = spiderParams[index],
        elem = createMarkerContainerElement(spiderParam, marker);
      
      elem.onclick = function(e){
        options.onClick(e, marker, elem);
      };

      return new mapboxgl.Marker(elem, {
          offset: [spiderParam.x, spiderParam.y]
        })
        .setLngLat(latLng)
        .addTo(map);
    });
  };

  function unspiderfy(){
    util.each(previousMarkers, function(oldMarker){
      oldMarker.remove();
    });
    previousMarkers = [];
  }

  function generateSpiderParams(count) {
    if (count >= options.circleSpiralSwitchover) {
      return generateSpiralParams(count);
    } else {
      return generateCircleParams(count);
    }
  }

  function generateSpiralParams(count, centerPt) {
    var legLength = options.spiralLengthStart,
      angle = 0;<commit_msg>Reversing marker order on map, so that inner markers display above the lines of outer spiral markers.<commit_after>function MapboxglSpiderfier(map, userOptions){
  var util = {
      each: eachFn,
      map: mapFn,
      mapTimes: mapTimesFn,
      eachTimes: eachTimesFn
    },
    NULL_FUNCTION = function(){
    },
    options = {
      circleSpiralSwitchover: 9, // show spiral instead of circle from this marker count upwards
      // 0 -> always spiral; Infinity -> always circle
      circleFootSeparation: 50, //related to circumference of circle
      spiralFootSeparation: 50, // related to size of spiral (experiment!)
      spiralLengthStart: 50, // ditto
      spiralLengthFactor: 4, // ditto
      onClick: userOptions.onClick || NULL_FUNCTION,
      initializeMarker: userOptions.initializeMarker || NULL_FUNCTION
    },
    twoPi = Math.PI * 2,
    previousMapBoxGlMarkers = [];

  // Public:
  this.spiderfy = spiderfy;
  this.unspiderfy = unspiderfy;

  // Private:
  function spiderfy(latLng, markers) {
    var spiderParams = generateSpiderParams(markers.length),
      mapboxGlMarkers;

    unspiderfy();

    mapboxGlMarkers = util.map(markers, function(marker, index) {
      var spiderParam = spiderParams[index],
        elem = createMarkerContainerElement(spiderParam, marker);
      
      elem.onclick = function(e){
        options.onClick(e, marker, elem);
      };

      return new mapboxgl.Marker(elem, {
          offset: [spiderParam.x, spiderParam.y]
        })
        .setLngLat(latLng);
    });
    util.each(mapboxGlMarkers.reverse(), function(mapboxMarker){
      mapboxMarker.addTo(map);
    });

    previousMapBoxGlMarkers = mapboxGlMarkers;
  };

  function unspiderfy(){
    util.each(previousMapBoxGlMarkers, function(oldMarker){
      oldMarker.remove();
    });
    previousMapBoxGlMarkers = [];
  }

  function generateSpiderParams(count) {
    if (count >= options.circleSpiralSwitchover) {
      return generateSpiralParams(count);
    } else {
      return generateCircleParams(count);
    }
  }

  function generateSpiralParams(count, centerPt) {
    var legLength = options.spiralLengthStart,
      angle = 0;
{'fraction_non_alphanumeric': 0.10394088669950739, 'fraction_numerical': 0.00541871921182266, 'mean_word_length': 2.9542356377799415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4524463', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1202, 'n_words': 270}