<commit_before>

gaps.controller('geneticstatisticscontroller', ['$rootScope', '$scope', 'Notification', 'GraphStatistics', 'GeneticStatistics', 'Graph',
    function ($rootScope, $scope, Notification, GraphStatistics, GeneticStatistics, Graph) {

        $scope.statisticsLoaded = false;
        $scope.statisticsDisplayed = true;

        $scope.costChartElementId = 'morris-bar-cost-chart';

        $scope.dataToggleId = '#genetic-statistics-viewer-toggle';
        $scope.sliderContainerId = '#div.slider.slider-horizontal';
        $scope.sliderId = '#generation-slider';
        $scope.timeline = null;
        
        $scope.getStatistics = function () {
            return GeneticStatistics.getStatistics();
        };

        $scope.getGraphStatistics = function () {
            return GraphStatistics;
        };

        $rootScope.$on('resetViews', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('graphDataLoaded', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('pathDataLoaded', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('geneticDataUpdated', function (event, $data) {
            GeneticStatistics.add($data);
        });

        $rootScope.$on('geneticDataLoaded', function (event, $data) {
            $scope.statisticsLoaded = true;
            $scope.statisticsDisplayed = true;
            $scope.initView();
        });

        $scope.resetData = function () {
            GeneticStatistics.reset();
        };

        $scope.resetView = function () {
            $scope.evolutionChart.clear($scope.costChartElementId);
            var $slider = $($scope.sliderContainerId);

            if ($slider && $slider.parentElement) {
                var parent = $slider.parentElement;
                while (parent.firstChild) {
                    parent.removeChild(parent.firstChild);
                }
            }
            $($scope.sliderContainerId).css('width', 'auto');
            
            if($scope.timeline && $scope.timeline !== null) {
                $scope.timeline.destroy();
            }

            $scope.statisticsLoaded = false;
            $scope.statisticsDisplayed = false;
        };

        $scope.initView = function () {
            GeneticStatistics.markEvolutionEnd();

            var interval = window.setInterval(function () {
                var geneticStatistics = GeneticStatistics.getStatistics();
                $scope.$apply();

                var $slider = $($scope.sliderId).slider();
                $slider.on('slideStop', function (ev) {
                    $scope.sliderEvent(ev);
                });
                $slider.slider('setValue', 0);

                $scope.evolutionChart.initialize($scope.costChartElementId,
                        geneticStatistics.generationChart);
                        
                var options = {
                    height: '400px',
                    editable: false,
                    clickToUse: true,
                    showCurrentTime: false,
                    showCustomTime: false,
                    min: -500,
                    max: (geneticStatistics.evolutionStage * 10),
                    zoomMin: 150,
                    zoomMax: (geneticStatistics.evolutionStage * 5)
                };
                $scope.timeline = new vis.Timeline(document.getElementById('evolution-timeline'), GeneticStatistics.getDataSet(), options);

                window.clearInterval(interval);

                Notification.success({message: 'Evolved', delay: 2000});
            }, 1000);

            var $geneticStatisticsToggle = $($scope.dataToggleId).bootstrapToggle({
                on: 'Visible',
                off: 'Hidden'
            });
            $geneticStatisticsToggle.change(function () {
                $scope.hideView();
            });
        };

        $scope.hideView = function () {
            $scope.statisticsDisplayed = $($scope.dataToggleId).prop('checked');
            $scope.$apply();
        };<commit_msg>Hide major labels from timeline axis<commit_after>

gaps.controller('geneticstatisticscontroller', ['$rootScope', '$scope', 'Notification', 'GraphStatistics', 'GeneticStatistics', 'Graph',
    function ($rootScope, $scope, Notification, GraphStatistics, GeneticStatistics, Graph) {

        $scope.statisticsLoaded = false;
        $scope.statisticsDisplayed = true;

        $scope.costChartElementId = 'morris-bar-cost-chart';

        $scope.dataToggleId = '#genetic-statistics-viewer-toggle';
        $scope.sliderContainerId = '#div.slider.slider-horizontal';
        $scope.sliderId = '#generation-slider';
        $scope.timeline = null;
        
        $scope.getStatistics = function () {
            return GeneticStatistics.getStatistics();
        };

        $scope.getGraphStatistics = function () {
            return GraphStatistics;
        };

        $rootScope.$on('resetViews', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('graphDataLoaded', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('pathDataLoaded', function (event, $data) {
            $scope.resetData();
            $scope.resetView();
        });

        $rootScope.$on('geneticDataUpdated', function (event, $data) {
            GeneticStatistics.add($data);
        });

        $rootScope.$on('geneticDataLoaded', function (event, $data) {
            $scope.statisticsLoaded = true;
            $scope.statisticsDisplayed = true;
            $scope.initView();
        });

        $scope.resetData = function () {
            GeneticStatistics.reset();
        };

        $scope.resetView = function () {
            $scope.evolutionChart.clear($scope.costChartElementId);
            var $slider = $($scope.sliderContainerId);

            if ($slider && $slider.parentElement) {
                var parent = $slider.parentElement;
                while (parent.firstChild) {
                    parent.removeChild(parent.firstChild);
                }
            }
            $($scope.sliderContainerId).css('width', 'auto');
            
            if($scope.timeline && $scope.timeline !== null) {
                $scope.timeline.destroy();
            }

            $scope.statisticsLoaded = false;
            $scope.statisticsDisplayed = false;
        };

        $scope.initView = function () {
            GeneticStatistics.markEvolutionEnd();

            var interval = window.setInterval(function () {
                var geneticStatistics = GeneticStatistics.getStatistics();
                $scope.$apply();

                var $slider = $($scope.sliderId).slider();
                $slider.on('slideStop', function (ev) {
                    $scope.sliderEvent(ev);
                });
                $slider.slider('setValue', 0);

                $scope.evolutionChart.initialize($scope.costChartElementId,
                        geneticStatistics.generationChart);
                        
                var options = {
                    height: '400px',
                    editable: false,
                    clickToUse: true,
                    showCurrentTime: false,
                    showCustomTime: false,
                    showMajorLabels: false,
                    min: -500,
                    max: (geneticStatistics.evolutionStage * 10),
                    zoomMin: 150,
                    zoomMax: (geneticStatistics.evolutionStage * 5)
                };
                $scope.timeline = new vis.Timeline(document.getElementById('evolution-timeline'), GeneticStatistics.getDataSet(), options);

                window.clearInterval(interval);

                Notification.success({message: 'Evolved', delay: 2000});
            }, 1000);

            var $geneticStatisticsToggle = $($scope.dataToggleId).bootstrapToggle({
                on: 'Visible',
                off: 'Hidden'
            });
            $geneticStatisticsToggle.change(function () {
                $scope.hideView();
            });
        };

        $scope.hideView = function () {
            $scope.statisticsDisplayed = $($scope.dataToggleId).prop('checked');
            $scope.$apply();
        };
{'fraction_non_alphanumeric': 0.12668938770713362, 'fraction_numerical': 0.004935950170407804, 'mean_word_length': 1.7119184193753982, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3023458', 'n_tokens_mistral': 2203, 'n_tokens_neox': 2033, 'n_words': 337}