<commit_before>export class Distance extends HTMLElement {
  
  constructor() {
    super()
    this.$shadow = this.attachShadow({mode: 'open'})
  }

  connectedCallback() {}
  disconnectedCallback() {}

  set position({line_model, node_label_id}) {
    this.$shadow.innerHTML  = this.render(line_model, node_label_id)
  }

  render(measurements, node_label_id) {
    this.$shadow.host.setAttribute('data-label-id', node_label_id)
    return `
      ${this.styles(measurements)}
      <figure quadrant="measurements.q">
        <div></div>
        <figcaption><b>${measurements.d}</b>px</figcaption>
        <div></div>
      </figure>
    `
  }

  styles({y,x,d,q,v = false}) {
    return `
      <style>
        :host {
          --line-color: hsl(267, 100%, 58%);
          --line-width: 1px;
          font-size: 16px;
        }

        :host > figure {
          margin: 0;
          position: absolute;
          ${v
            ? `height: ${d}px; width: 5px;`
            : `width: ${d - 1}px; height: 5px;`}
          top: ${y + window.scrollY}px;
          left: ${x}px;
          transform: ${v
            ? 'translateX(-50%)'<commit_msg>fixes not being drawn to edge<commit_after>export class Distance extends HTMLElement {
  
  constructor() {
    super()
    this.$shadow = this.attachShadow({mode: 'open'})
  }

  connectedCallback() {}
  disconnectedCallback() {}

  set position({line_model, node_label_id}) {
    this.$shadow.innerHTML  = this.render(line_model, node_label_id)
  }

  render(measurements, node_label_id) {
    this.$shadow.host.setAttribute('data-label-id', node_label_id)
    return `
      ${this.styles(measurements)}
      <figure quadrant="measurements.q">
        <div></div>
        <figcaption><b>${measurements.d}</b>px</figcaption>
        <div></div>
      </figure>
    `
  }

  styles({y,x,d,q,v = false}) {
    return `
      <style>
        :host {
          --line-color: hsl(267, 100%, 58%);
          --line-width: 1px;
          font-size: 16px;
        }

        :host > figure {
          margin: 0;
          position: absolute;
          ${v
            ? `height: ${d}px; width: 5px;`
            : `width: ${d}px; height: 5px;`}
          top: ${y + window.scrollY}px;
          left: ${x}px;
          transform: ${v
            ? 'translateX(-50%)'
{'fraction_non_alphanumeric': 0.16306228373702422, 'fraction_numerical': 0.014273356401384083, 'mean_word_length': 2.0963855421686746, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '123364', 'n_tokens_mistral': 804, 'n_tokens_neox': 762, 'n_words': 137}