<commit_before><commit_msg>Adding a little demo for quick tests<commit_after><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Simple painting app</title>
    <style>
      html,
      body {
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
      }

      canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        touch-action: none;
      }
    </style>
  </head>
  <body>
    <script type="module">
      import PointerTracker from '../dist/PointerTracker.mjs';

      const canvas = document.createElement('canvas');

      canvas.addEventListener('contextmenu', (e) => e.preventDefault());
      document.body.appendChild(canvas);
      let ctx;

      function setCanvasSize() {
        const rect = canvas.getBoundingClientRect();
        canvas.width = rect.width * devicePixelRatio;
        canvas.height = rect.height * devicePixelRatio;
        ctx = canvas.getContext('2d');
        ctx.scale(devicePixelRatio, devicePixelRatio);
        ctx.lineWidth = 5;
        ctx.lineCap = 'round';
      }

      setCanvasSize();
      window.addEventListener('resize', setCanvasSize);

      const colors = new Map();

      const tracker = new PointerTracker(canvas, {
        start(pointer, event) {
          event.preventDefault();
          const color = `hsl(${Math.random() * 360}, 80%, 50%)`;
          colors.set(pointer.id, color);
          return true;
        },
        end(pointer) {
          colors.delete(pointer.id);
        },
        move(previousPointers, changedPointers, event) {
          for (const pointer of changedPointers) {
            const previous = previousPointers.find((p) => p.id === pointer.id);
            ctx.strokeStyle = colors.get(previous.id);
            ctx.beginPath();
            ctx.moveTo(previous.clientX, previous.clientY);
            for (const point of pointer.getCoalesced()) {
              ctx.lineTo(point.clientX, point.clientY);
            }
            ctx.stroke();
          }
        },
      });
    </script>
  </body>
</html>
{'fraction_non_alphanumeric': 0.13256880733944953, 'fraction_numerical': 0.01055045871559633, 'mean_word_length': 2.0249653259361997, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, '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': '7008538', 'n_tokens_mistral': 642, 'n_tokens_neox': 607, 'n_words': 134}