<commit_before>package visceljs.render

import org.scalajs.dom
import org.scalajs.dom.MouseEvent
import org.scalajs.dom.html.Body
import rescala.default._
import scalatags.JsDom
import scalatags.JsDom.all.{HtmlTag, Modifier, SeqFrag, Tag, a, bindJsAnyLike, body, href, id, onclick, p, rel, stringAttr, stringFrag, title}
import scalatags.JsDom.attrs.disabled
import scalatags.JsDom.tags2.{article, main}
import viscel.shared.Log
import visceljs.Definitions.lcButton
import visceljs.Navigation._
import visceljs.{Actions, Data, Definitions, Icons}


class View(act: Actions) {

  def onLeftClickPrevNext(handler: Navigate => Unit): Modifier = onclick := { (e: MouseEvent) =>
    val node = e.currentTarget.asInstanceOf[dom.html.Element]
    if (e.button == 0 && dom.document.getSelection().isCollapsed && dom.window.getSelection().isCollapsed) {
      e.preventDefault()
      val relx   = e.clientX - node.offsetLeft
      val border = math.max(node.offsetWidth / 10, 100)
      if (relx < border) handler(Prev)
      else handler(Next)
    }
  }

  def gen(dataSignal: Signal[Data], fitType: Signal[FitType], navigate: Evt[Navigate]): Signal[JsDom.TypedTag[Body]] = Signal {<commit_msg>remove unused import<commit_after>package visceljs.render

import org.scalajs.dom
import org.scalajs.dom.MouseEvent
import org.scalajs.dom.html.Body
import rescala.default._
import scalatags.JsDom
import scalatags.JsDom.all.{HtmlTag, Modifier, SeqFrag, Tag, a, bindJsAnyLike, body, href, id, onclick, p, rel, stringAttr, stringFrag, title}
import scalatags.JsDom.attrs.disabled
import scalatags.JsDom.tags2.{article, main}
import visceljs.Definitions.lcButton
import visceljs.Navigation._
import visceljs.{Actions, Data, Definitions, Icons}


class View(act: Actions) {

  def onLeftClickPrevNext(handler: Navigate => Unit): Modifier = onclick := { (e: MouseEvent) =>
    val node = e.currentTarget.asInstanceOf[dom.html.Element]
    if (e.button == 0 && dom.document.getSelection().isCollapsed && dom.window.getSelection().isCollapsed) {
      e.preventDefault()
      val relx   = e.clientX - node.offsetLeft
      val border = math.max(node.offsetWidth / 10, 100)
      if (relx < border) handler(Prev)
      else handler(Next)
    }
  }

  def gen(dataSignal: Signal[Data], fitType: Signal[FitType], navigate: Evt[Navigate]): Signal[JsDom.TypedTag[Body]] = Signal {
{'fraction_non_alphanumeric': 0.1230899830220713, 'fraction_numerical': 0.005942275042444821, 'mean_word_length': 4.6252983293556085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '665484', 'n_tokens_mistral': 807, 'n_tokens_neox': 774, 'n_words': 176}