-
Notifications
You must be signed in to change notification settings - Fork 0
app.js
app.js is the main script for LaserGraph.
Base class for controlling the app. Interacts between the HTML view, and the model, binding controls as needed. This class is unique to the Laser Games data and LaserGraph website.
JSON data loaded directly from a file.
A LaserTagDataProcessor (see dataProcessor.js) containing processed data and functions to read data.
The currently viewed file
Visualization classes are stored in class variables- see the source file lines 14-19.
Initializes elements prior to data upload
Sets up the file upload element which is shown upon initially loading the page.
Called on a file upload event, expects a file from event.target.files[0], stores the file within this.currentFile. Additional functions clearFile(), displayFileInfo(file), and formatFileSize(bytes) are provided to work with files as well, see the source code for info.
After a file is uploaded, this function is called to create this.data and this.processor by reading this.currentFile. If successful, calls this.processAndVisualize().
Calls functions to process data, update text and filtered elements, create visualizations, and update metrics. Sets the time range viewed from 0 to data end.
Converts this.data into this.processor (new LaserTagDataProcessor).
Updates filter dropdowns with players and teams as appropriate.
Shows an error pop up and logs the message in the log.
Calls await this.init()
todo
todo
Shows/hides the file upload element. If shown, sets the document scroll to the top of the page.
Resets the app's viewed range to the entire match.