<commit_before>import SVGTrack from './SVGTrack.js';
import slugid from 'slugid';
import { brush } from 'd3-brush';
import { event } from 'd3-selection';

export class ViewportTrackerHorizontal extends SVGTrack {
  constructor(svgElement, registerViewportChanged, removeViewportChanged, setDomainsCallback, options) {
    // create a clipped SVG Path
    super(svgElement, true);

    const uid = slugid.nice();
    this.uid = uid;
    this.options = options;

    this.removeViewportChanged = removeViewportChanged;
    this.setDomainsCallback = setDomainsCallback;

    this.viewportXDomain = null;
    this.viewportYDomain = null;

    this.brush = brush(true)
      .extent([[-Number.MAX_VALUE, -Number.MAX_VALUE],
        [Number.MAX_VALUE, Number.MAX_VALUE]])
      .on('brush', this.brushed.bind(this))
    ;

    this.gBrush = this.gMain<commit_msg>Fix `Error: <rect> attribute width: Expected length, "Infinity".`<commit_after>import { brush } from 'd3-brush';
import { event } from 'd3-selection';
import slugid from 'slugid';

import SVGTrack from './SVGTrack';

export class ViewportTrackerHorizontal extends SVGTrack {
  constructor(
    svgElement,
    registerViewportChanged,
    removeViewportChanged,
    setDomainsCallback,
    options
  ) {
    // create a clipped SVG Path
    super(svgElement, true);

    const uid = slugid.nice();
    this.uid = uid;
    this.options = options;

    this.removeViewportChanged = removeViewportChanged;
    this.setDomainsCallback = setDomainsCallback;

    this.viewportXDomain = null;
    this.viewportYDomain = null;

    this.brush = brush(true)
      .extent([[-Number.MAX_SAFE_INTEGER, -Number.MAX_SAFE_INTEGER],
        [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]])
      .on('brush', this.brushed.bind(this))
    ;

    this.gBrush = this.gMain
{'fraction_non_alphanumeric': 0.11178414096916299, 'fraction_numerical': 0.0022026431718061676, 'mean_word_length': 3.695090439276486, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2125686', 'n_tokens_mistral': 591, 'n_tokens_neox': 571, 'n_words': 123}