{"size": 2179, "ext": "js", "max_stars_repo_path": "kendo/index.js", "max_stars_repo_name": "bryntum/scheduler-performance", "max_stars_repo_stars_event_min_datetime": "2020-04-19T18:34:01.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-29T07:59:58.000Z", "max_issues_repo_path": "kendo/index.js", "max_issues_repo_name": "bryntum/scheduler-performance", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "kendo/index.js", "max_forks_repo_name": "bryntum/scheduler-performance", "max_forks_repo_forks_event_min_datetime": "2021-01-02T09:49:22.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-22T07:58:36.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 31.1285714286, "max_line_length": 96, "alphanum_fraction": 0.4098210188}
import { RenderTimer, FPS, Scroller, count } from '../util/util.js';

async function init() {
    const resourceResponse = await fetch('../util/2500-resources.json');
    let resources = await resourceResponse.json();
    const eventResponse = await fetch('../util/50000-events.json');
    let events = await eventResponse.json();

    resources = resources.filter(r => r.id < count);
    events = events.filter(r => r.resourceId < count);

    resources.forEach(r => {
        r.value = r.id;
        r.text = r.firstName + ' ' + r.surname;
    });

    events.forEach(e => {
        e.start = e.startDate;
        e.end = e.endDate;
        e.title = e.name;
        delete e.duration;
    });

    await RenderTimer.start({
        callback() {
            $("#container").kendoScheduler({
                date           : new Date(2019, 8, 22),
                startTime      : new Date(2019, 8, 22),
                eventHeight    : 20,
                majorTick      : 60,
                minorTickCount : 1,
                views          : [
                    {
                        type                    : "timelineWeek",
                        columnWidth             : 20,
                        majorTimeHeaderTemplate : kendo.template("#=kendo.toString(date, 'H')#")
                    }
                ],
                timezone       : "Etc/UTC",
                dataSource     : events,
                group          : {
                    resources   : [ "People" ],
                    orientation : "vertical"
                },
                resources      : [
                    {
                        field      : "resourceId",
                        name       : "People",
                        dataSource : resources,
                        title      : "Name"
                    }
                ]
            });
        }
    });

    setTimeout(() => {
        FPS.start();
        Scroller.scroll({
            element : document.querySelector('.k-scheduler-content'),
            distance : Math.min(count * 50, 75000),
            callback() {
                FPS.stop();
            }
        });
    }, 500);
}

init();
