Visualization API purpose is to fetch datasets and prepare them for visualization using frontend React + D3.js app.
It is a koa app that is meant to be run as lambda fetching from S3 in production environment using serverless and serverless-http, however other than testing purposes it is not live due to financial reasons and should be used locally together with a simple JSON serving server like visualization-data-bucket.
It is also hosted in Heroku for convenience sake Heroku preview.
git clone https://github.com/kuzmialke-and-friends/visualization-api
cd visualization-api
nvm use
npm i
PORT=3000 DATA_BACKEND=https://knf-visualization-data-bucket.herokuapp.com/assets/biraffe npm run start:dev
npm run build
PORT=3000 DATA_BACKEND=https://knf-visualization-data-bucket.herokuapp.com/assets/biraffe npm start
npm test
TODO: implement API specs
/datasets/:id
Query parameters:
- limit - default 2, limits number of subjects we sent data to
Note: does not work on Heroku due to memory constraints, TODO: fix memory limitation on limit function
Examples:
https://knf-visualization-api.herokuapp.com/datasets/ghost?limit=15
https://knf-visualization-api.herokuapp.com/datasets/jump
/static-map/:id
Examples:
https://knf-visualization-api.herokuapp.com/static-map/ghost
Visualization API will output data from dataset in format:
{
subjects: Subjects;
supportedVisualizations: VisualizationType[];
}
/health
Returns 200 with Ok
body response.
https://knf-visualization-api.herokuapp.com/health
Code is written and meant to be run as Lambda, however it is currently deployed to Heroku using their Free Dynos.
This app uses Travis for testing each change done to codebase automatically and as early as possible. Continuous Deployment follows the testing that happens during CI and pushes changes to production system.
Stages:
- run tests
- run linting
- builts app
- currently disabled
- automatically deploys lambda to AWS
The "BIRAFFE2: The 2nd Study in Bio-Reactions and Faces for Emotion-based Personalization for AI Systems" dataset is part of the work carried out by the AfCAI Research Group in Kraków, Poland.
Source: BIRAFFE2