Week 2: Cracking LineUp

Last week, I took a bit of a break from my previous task. Instead, I joined forces with the rest of my team to figure out the LineUp codebase. We met on Friday and Saturday in a hackathon-style event and worked together to read through all the files.

What we learned

LineUp was written in TypeScript, which is a version of JavaScript with type-checking. There are 6 typescript files in the src folder which are briefly described below. The codebase we downloaded came with a node_modules folder that has 655 different packages.

app.ts

This is the largest typescript file in this folder. Includes methods for fixing missing data values and initializing LineUp with a header bar and dataset (calls array of datasets from datasets.ts).

datasets.ts 

Specifies an array of datasets that are included in the demo folder. This array is loaded by app.ts.

export.ts

Includes methods for exporting to CSV and exporting to JSON.

gist.ts

Includes methods for loading and saving to GitHub Gists.

importer.ts

Includes methods for importing a file, parsing the JSON, and converting to columns. Called from app.ts.

index.ts

Import statements for all the icons and pretty html formatting.

node_modules

From what I can tell, only 4 of these are being used. If possible, we will try to remove some of these packages to make the project smaller.

Testing with my own data

I tried creating a dummy dataset as a csv file and uploading it to LineUp. The following is a snapshot of my dataset in the app.

However, when I export this dataset as a JSON file and the re-upload it, I get the following:
This issue is semi-reproducible, meaning that sometimes it works and sometimes it doesn't.

Next steps with LineUp

There are a couple issues we need to address before we can use this application on our website:
  • I think some of the typescript files should be reorganized. For example, missing values should not be fixed in app.ts where the project is loaded. It makes more sense for that to be in import.ts.
  • We need to remove the bug listed in "Testing with my own data"
  • We need to start LineUp with our own JSON file from a central data repository.
  • We need to remove the download and upload functionality and instead have a "save" button that returns a JSON file to a central data repository.

Plan of attack

In the next week, I am acting as architect and task manager. I created the following business logic diagram to start the conversation with my teammates about what we need to work on.
I tasked myself with understanding the LineUp codebase and determining what changes will need to be made to make it functional for our project. 

Two of my teammates have asked to be more involved in the research side as well. Frankly, I think it is a great idea to have multiple heads working on the problem of building and explaining a rank. I look forward to working with them on this. I created a library of references on Zotero for them to peruse, and we will start talking about the research tomorrow.

Comments

Popular posts from this blog

Week 31: Datasets for fairness

Week 32-33: Wrapping up

Week 30: Returning to Fairness