<commit_before>import unitConverter from 'src/helpers/unitConverter';

const guard = {
  translateY(translateY, parentEle) {
    const bottomLimit = (() => {
      const numberOfElement = parentEle.childNodes.length;
      const pageHeight = unitConverter.get(parentEle.childNodes[0].style.height, 'px', false);
      const pageMargin = unitConverter.get(getComputedStyle(parentEle.childNodes[0]).marginTop, 'px', false);
      return -(numberOfElement) * (pageHeight + pageMargin);
    })();
    if (translateY < bottomLimit) translateY = bottomLimit;
    if (translateY > 0) translateY = 0;
    return translateY;
  },
  translateX(translateX, parentEle) {
    const sideLimit = (() => {
      const pageWidth = unitConverter.get(parentEle.childNodes[0].style.width, 'px', false);
      return (pageWidth / 2);
    })();
    if (translateX < -sideLimit) translateX = -sideLimit;
    if (translateX > sideLimit) translateX = sideLimit;
    return translateX;
  },
  scale(scale) {
    if (scale < 0.05) scale = 0.05;
    if (scale > 15) scale = 15;
    return scale;
  }
};

const core = {
  updateWindowSize(event) {
    // Retrieve the resized width
    const marginWidth = 60;
    // Resize the element's transformer
    this.transform.set({ scale: (this.width.parent - marginWidth) / this.width.element });
  },

  pointermove(event) {
    if (this.eventInstance.numPointers > 1) {
      return; // Panning is restricted with using 1 finger only<commit_msg>Add transition to page window resizing<commit_after>import unitConverter from 'src/helpers/unitConverter';

const guard = {
  translateY(translateY, parentEle) {
    const bottomLimit = (() => {
      const numberOfElement = parentEle.childNodes.length;
      const pageHeight = unitConverter.get(parentEle.childNodes[0].style.height, 'px', false);
      const pageMargin = unitConverter.get(getComputedStyle(parentEle.childNodes[0]).marginTop, 'px', false);
      return -(numberOfElement) * (pageHeight + pageMargin);
    })();
    if (translateY < bottomLimit) translateY = bottomLimit;
    if (translateY > 0) translateY = 0;
    return translateY;
  },
  translateX(translateX, parentEle) {
    const sideLimit = (() => {
      const pageWidth = unitConverter.get(parentEle.childNodes[0].style.width, 'px', false);
      return (pageWidth / 2);
    })();
    if (translateX < -sideLimit) translateX = -sideLimit;
    if (translateX > sideLimit) translateX = sideLimit;
    return translateX;
  },
  scale(scale) {
    if (scale < 0.05) scale = 0.05;
    if (scale > 15) scale = 15;
    return scale;
  }
};

const core = {
  updateWindowSize(event) {
    // Retrieve the resized width
    const marginWidth = 60;
    const transitionDuration = 500;
    // Resize the element's transformer
    this.el.container.style.transition = `transform ${transitionDuration}ms`;
    this.transform.set({ scale: (this.width.parent - marginWidth) / this.width.element });
    setTimeout(() => {
      this.el.container.style.transition = '';
    }, transitionDuration);
  },

  pointermove(event) {
    if (this.eventInstance.numPointers > 1) {
      return; // Panning is restricted with using 1 finger only
{'fraction_non_alphanumeric': 0.1300221448908573, 'fraction_numerical': 0.013603290098070231, 'mean_word_length': 3.4285714285714284, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, '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': '373915', 'n_tokens_mistral': 1000, 'n_tokens_neox': 951, 'n_words': 229}