{"size": 789, "ext": "js", "max_stars_repo_path": "sample/main.js", "max_stars_repo_name": "pablobertran/vanilla-grid", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "sample/main.js", "max_issues_repo_name": "pablobertran/vanilla-grid", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sample/main.js", "max_forks_repo_name": "pablobertran/vanilla-grid", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 39.45, "max_line_length": 71, "alphanum_fraction": 0.7313054499}
const sampleGuests = await fetch('./sample-guests.json');
const sampleRooms = await fetch('./sample-rooms.json');
const sampleStays = await fetch('./sample-stays.json');

// Parse data to let VanillaGrid know relationships between dataSources
const parsedStays = sampleStays.map( stay => {
    stay.linkedTo = [];
    stay.linkedTo.push( {source: 'rooms', field: 'room'} );
    stay.linkedTo.push( {source: 'guests', field: 'guest'} );
});

// Initiate, set up, define dataSources
const bookingsGrid = new VanillaGrid();
bookingsGrid.settings.gridSettings.axis.y = "rooms";
bookingsGrid.dataSources.add('guests', sampleGuests);
bookingsGrid.dataSources.add('rooms', sampleRooms);
bookingsGrid.dataSources.add('main', parsedStays);
// And finally, render.
bookingsGrid.create('#bookings');
