{"size": 1829, "ext": "js", "max_stars_repo_path": "flask_monitoringdashboard/static/js/controllers/multiVersion.js", "max_stars_repo_name": "bokal2/Flask-MonitoringDashboard", "max_stars_repo_stars_event_min_datetime": "2020-07-17T05:37:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-06T19:46:15.000Z", "max_issues_repo_path": "flask_monitoringdashboard/static/js/controllers/multiVersion.js", "max_issues_repo_name": "bokal2/Flask-MonitoringDashboard", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "flask_monitoringdashboard/static/js/controllers/multiVersion.js", "max_forks_repo_name": "bokal2/Flask-MonitoringDashboard", "max_forks_repo_forks_event_min_datetime": "2020-11-21T01:25:51.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-21T01:25:51.000Z"}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 43.5476190476, "max_line_length": 108, "alphanum_fraction": 0.5811919081}
function MultiVersionController($scope, $http, menuService, formService, infoService,
                                plotlyService, endpointService) {
    endpointService.reset();
    menuService.reset('multi_version');
    $scope.title = 'Multi version API Utilization';

    // Set the information box
    infoService.axesText = 'The X-axis presents the versions that are used. The Y-axis presents the' +
        'endpoints that are found in the Flask application.';
    infoService.contentText = 'The color of the cell presents the distribution of the amount of requests ' +
        'that the application received in a single version for a single endpoint. The darker the cell, ' +
        'the more requests a certain endpoint has processed in that version. Since it displays the ' +
        'distribution of the load, each column sums up to 100%. This information can be used to discover ' +
        'which endpoints process the most requests.';

    // Set the form handler
    formService.clear();
    formService.addVersions();
    formService.addEndpoints();

    formService.setReload(function () {
        let versions = formService.getMultiSelection('versions');
        let endpoints = formService.getMultiSelection('endpoints');
        $http.post('api/multi_version', {
            data: {
                versions: versions,
                endpoints: endpoints
            }
        }).then(function (response) {
            plotlyService.heatmap(versions, endpoints,
                response.data.map(l => l.map(i => i == 0 ? 'NaN' : i)), {
                    xaxis: {
                        type: 'category',
                        title: 'Versions'
                    },
                    yaxis: {
                        type: 'category'
                    }
                });
        });
    });
}