<commit_before>define(["leaflet"],
  function (L) {
    return L.TileLayer.Canvas.extend({
      setData: function (d) {
        this.data = d
        this.redraw()
      },
      drawTile: function (canvas, tilePoint) {
        if (!this.data)
          return

        var tileSize = this.options.tileSize
        var s = tilePoint.multiplyBy(tileSize)
        var map = this._map

        function project(coords) {
          var p = map.project(new L.LatLng(coords[0], coords[1]))
          return {x: p.x - s.x, y: p.y - s.y}
        }

        var nodes = this.data
        var ctx = canvas.getContext("2d")
        var margin = 50

        ctx.beginPath()
        nodes.forEach(function (d) {
            var p = project([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude])
            if (p.x + margin < 0 || p.y + margin < 0 || p.x - tileSize - margin > 0 || p.y - tileSize - margin > 0)
              return

            var clients = d.statistics.clients
            if (d.clients === 0)
              return

            var distance = 12
            var radius = 3
            var a = 1.2
            var startAngle = Math.PI
            var angle = startAngle

            for (var i = 0; i < clients; i++) {
              if ((angle - startAngle) > 2 * Math.PI) {
                angle = startAngle
                distance += 2 * radius * a
              }

              var x = p.x + distance * Math.cos(angle)
              var y = p.y + distance * Math.sin(angle)

              ctx.moveTo(x, y)
              ctx.arc(x, y, radius, 0, 2 * Math.PI)

              var n = Math.floor((Math.PI * distance) / (a * radius))
              var angleDelta = 2 * Math.PI / n
              angle += angleDelta
            }
          })

          ctx.fillStyle = "#294D66"
          ctx.fill()
        }
    })<commit_msg>map: less obstrusive client color<commit_after>define(["leaflet"],
  function (L) {
    return L.TileLayer.Canvas.extend({
      setData: function (d) {
        this.data = d
        this.redraw()
      },
      drawTile: function (canvas, tilePoint) {
        if (!this.data)
          return

        var tileSize = this.options.tileSize
        var s = tilePoint.multiplyBy(tileSize)
        var map = this._map

        function project(coords) {
          var p = map.project(new L.LatLng(coords[0], coords[1]))
          return {x: p.x - s.x, y: p.y - s.y}
        }

        var nodes = this.data
        var ctx = canvas.getContext("2d")
        var margin = 50

        ctx.beginPath()
        nodes.forEach(function (d) {
            var p = project([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude])
            if (p.x + margin < 0 || p.y + margin < 0 || p.x - tileSize - margin > 0 || p.y - tileSize - margin > 0)
              return

            var clients = d.statistics.clients
            if (d.clients === 0)
              return

            var distance = 12
            var radius = 3
            var a = 1.2
            var startAngle = Math.PI
            var angle = startAngle

            for (var i = 0; i < clients; i++) {
              if ((angle - startAngle) > 2 * Math.PI) {
                angle = startAngle
                distance += 2 * radius * a
              }

              var x = p.x + distance * Math.cos(angle)
              var y = p.y + distance * Math.sin(angle)

              ctx.moveTo(x, y)
              ctx.arc(x, y, radius, 0, 2 * Math.PI)

              var n = Math.floor((Math.PI * distance) / (a * radius))
              var angleDelta = 2 * Math.PI / n
              angle += angleDelta
            }
          })

          ctx.fillStyle = "rgba(153, 118, 16, 0.5)"
          ctx.fill()
        }
    })
{'fraction_non_alphanumeric': 0.12144008597528211, 'fraction_numerical': 0.015314347125201504, 'mean_word_length': 1.3081215127092374, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6849989', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1108, 'n_words': 301}