<commit_before>import Scrollbar from '../../src/';

const DPR = window.devicePixelRatio;
const TIME_RANGE_MAX = 20 * 1e3;

const content = document.getElementById('content');
const thumb = document.getElementById('thumb');
const track = document.getElementById('track');
const canvas = document.getElementById('chart');
const ctx = canvas.getContext('2d');

let div = document.createElement('div');
div.innerHTML = Array(101).join('<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita eaque debitis, dolorem doloribus, voluptatibus minima illo est, atque aliquid ipsum necessitatibus cumque veritatis beatae, ratione repudiandae quos! Omnis hic, animi.</p>');

content.appendChild(div);

Scrollbar.initAll();

const scrollbar = Scrollbar.get(content);

let chartType = 'offset';

let thumbWidth = 0;
let endOffset = 0;

let timeRange = 5 * 1e3;

let records = [];
let size = {
    width: 300,
    height: 200
};

let shouldUpdate = true;

let tangentPoint = null;
let tangentPointPre = null;

let hoverLocked = false;
let hoverPointerX = undefined;
let pointerDownOnTrack = undefined;
let hoverPrecision = 'ontouchstart' in document ? 5 : 1;

canvas.width = size.width * DPR;
canvas.height = size.height * DPR;
ctx.scale(DPR, DPR);

function notation(num = 0) {
    if (Math.abs(num) > 10**-2) return num.toFixed(2);

    let exp = -1;

    while (!(num / 10**exp)) {<commit_msg>fix(demo): fix notation<commit_after>import Scrollbar from '../../src/';

const DPR = window.devicePixelRatio;
const TIME_RANGE_MAX = 20 * 1e3;

const content = document.getElementById('content');
const thumb = document.getElementById('thumb');
const track = document.getElementById('track');
const canvas = document.getElementById('chart');
const ctx = canvas.getContext('2d');

let div = document.createElement('div');
div.innerHTML = Array(101).join('<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita eaque debitis, dolorem doloribus, voluptatibus minima illo est, atque aliquid ipsum necessitatibus cumque veritatis beatae, ratione repudiandae quos! Omnis hic, animi.</p>');

content.appendChild(div);

Scrollbar.initAll();

const scrollbar = Scrollbar.get(content);

let chartType = 'offset';

let thumbWidth = 0;
let endOffset = 0;

let timeRange = 5 * 1e3;

let records = [];
let size = {
    width: 300,
    height: 200
};

let shouldUpdate = true;

let tangentPoint = null;
let tangentPointPre = null;

let hoverLocked = false;
let hoverPointerX = undefined;
let pointerDownOnTrack = undefined;
let hoverPrecision = 'ontouchstart' in document ? 5 : 1;

canvas.width = size.width * DPR;
canvas.height = size.height * DPR;
ctx.scale(DPR, DPR);

function notation(num = 0) {
    if (!num || Math.abs(num) > 10**-2) return num.toFixed(2);

    let exp = -3;

    while (!(num / 10**exp)) {
        if (exp < -10) {
            return num > 0 ? 'Infinity' : '-Infinity';
        }

{'fraction_non_alphanumeric': 0.13271285763529816, 'fraction_numerical': 0.02102723198896932, 'mean_word_length': 4.454887218045113, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7426060', 'n_tokens_mistral': 1002, 'n_tokens_neox': 933, 'n_words': 277}