<commit_before>Elm.Native.D3.Event = {};
Elm.Native.D3.Event.make = function(elm) {
  'use strict';

  elm.Native = elm.Native || {};
  elm.Native.D3 = elm.Native.D3 || {};
  elm.Native.D3.Event = elm.Native.D3.Event || {};

  if (elm.Native.D3.Selection.values) return elm.Native.D3.Selection.values;

  var JS = Elm.Native.JavaScript.make(elm);

  function mouse_event() {
    return JS.toRecord({
      altKey : d3.event.altKey,
      button : d3.event.button,
      ctrlKey : d3.event.ctrlKey,
      metaKey : d3.event.metaKey,
      shiftKey : d3.event.shiftKey
    });
  }

  function elm_handle_mouse(_event, signal, fn) {
    return function(k, selection) {
      return k(selection.on(_event, function(d, i) {
        return elm.notify(signal.id, A3(fn, mouse_event(), d, i));
      }));
    };
  }

  return elm.Native.D3.Event.values = {
    handleMouse : F3(elm_handle_mouse)
  };
};
<commit_msg>event: update mouse event handler to work with static<commit_after>import "../cast";

Elm.Native.D3.Event = {};
Elm.Native.D3.Event.make = function(elm) {
  'use strict';

  elm.Native = elm.Native || {};
  elm.Native.D3 = elm.Native.D3 || {};
  elm.Native.D3.Event = elm.Native.D3.Event || {};

  if (elm.Native.D3.Selection.values) return elm.Native.D3.Selection.values;

  var JS = Elm.Native.JavaScript.make(elm);

  function mouse_event() {
    return JS.toRecord({
      altKey : d3.event.altKey,
      button : d3.event.button,
      ctrlKey : d3.event.ctrlKey,
      metaKey : d3.event.metaKey,
      shiftKey : d3.event.shiftKey
    });
  }


  function elm_handle_mouse(_event, signal, fn) {
    return function(k, selection, i) {
      return k(selection.on(_event, safeIndexed(i, function(d, i) {
        return elm.notify(signal.id, A3(fn, mouse_event(), d, JS.toInt(i)));
      })), i);
    };
  }

  return elm.Native.D3.Event.values = {
    handleMouse : F3(elm_handle_mouse)
  };
};

{'fraction_non_alphanumeric': 0.1629979035639413, 'fraction_numerical': 0.016771488469601678, 'mean_word_length': 2.9118852459016393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6777893', 'n_tokens_mistral': 729, 'n_tokens_neox': 708, 'n_words': 119}