import * as scrawl from '../source/scrawl.js';
import { reportSpeed } from './utilities.js';import * as scrawl from '../source/scrawl.js';
import { reportSpeed } from './utilities.js';const canvas = scrawl.library.canvas.mycanvas;// Function to fetch and parse Wikipedia page view timeseries data
import buildChart from './modules/wikipedia-views-spiral-chart.js';Initiate the process on page load
let currentPage;
buildChart('Cat', canvas, {})
.then(res => currentPage = res)
.catch(e => {});Function to display frames-per-second data, and other information relevant to the demo
const entitys = scrawl.library.entitynames;
const report = reportSpeed('#reportmessage', function () {
return `Entity count: ${entitys.length}`;
});Create the Display cycle animation
scrawl.makeRender({
name: 'demo-animation',
target: canvas,
afterShow: report,
});scrawl.addNativeListener('click', () => {@ts-expect-error
let page = document.querySelector('#wikipedia-page').value;
if (page) {
buildChart(page, canvas, {})
.then(res => {
if (currentPage) currentPage.kill();
currentPage = res;
})
.catch(e => {
console.log('main invoker error', e);
});
};
}, '#page-request');console.log(scrawl.library);