<commit_before>/**
 * @author <NAME> <<EMAIL>>
 *
 * The prc-spectrum-viewer directive allows us to reuse a spectra visualisations using SpeckTackle.
 *
 */
var spectrumSummaryWsUrl = "http://127.0.0.1:9091/spectrumSummary";
var spectrumViewerDirective = angular.module('prideClusterApp.spectrumViewerDirective', [])

spectrumViewerDirective.directive('prcSpectrumViewer', function() {
    function link(scope, element, attrs) {

    }
    return {
        restrict: 'E',
        scope: {
            viewerId : "=viewerid",
            sourceId : '=sourceid',
            isConsensus : '=isconsensus'
        },
        controller: 'SpectrumViewerDirectiveCtrl',
        link: link,
        templateUrl: 'components/spectrumViewer-directive/spectrumViewer-directive.html'
    };
});

/**
 * Controllers are injected with routing parameters and a singleton to access the backend Web-Service.
 * In this case the cluster detail controller accesses the ClusterDetail end point to get details of
 * individual Clusters. These details are assigned to model objects in order to be accessed later on
 * within the html template part of the view.
 */
spectrumViewerDirective.controller('SpectrumViewerDirectiveCtrl', ['$scope',
    function($scope) {

        if ($scope.isConsensus) {
            $scope.title = "Consensus Spectrum";
            // inject spectrum to SpeckTackle component
            var chart = st.chart          // new chart
                .ms()                 // of type MS<commit_msg>title removed from spectrum viewer directive scope<commit_after>/**
 * @author <NAME> <<EMAIL>>
 *
 * The prc-spectrum-viewer directive allows us to reuse a spectra visualisations using SpeckTackle.
 *
 */
var spectrumSummaryWsUrl = "http://127.0.0.1:9091/spectrumSummary";
var spectrumViewerDirective = angular.module('prideClusterApp.spectrumViewerDirective', [])

spectrumViewerDirective.directive('prcSpectrumViewer', function() {
    function link(scope, element, attrs) {

    }
    return {
        restrict: 'E',
        scope: {
            viewerId : "=viewerid",
            sourceId : '=sourceid',
            isConsensus : '=isconsensus'
        },
        controller: 'SpectrumViewerDirectiveCtrl',
        link: link,
        templateUrl: 'components/spectrumViewer-directive/spectrumViewer-directive.html'
    };
});

/**
 * Controllers are injected with routing parameters and a singleton to access the backend Web-Service.
 * In this case the cluster detail controller accesses the ClusterDetail end point to get details of
 * individual Clusters. These details are assigned to model objects in order to be accessed later on
 * within the html template part of the view.
 */
spectrumViewerDirective.controller('SpectrumViewerDirectiveCtrl', ['$scope',
    function($scope) {

        if ($scope.isConsensus) {
            // inject spectrum to SpeckTackle component
            var chart = st.chart          // new chart
                .ms()                 // of type MS
{'fraction_non_alphanumeric': 0.09759358288770054, 'fraction_numerical': 0.0066844919786096255, 'mean_word_length': 2.887012987012987, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4048582', 'n_tokens_mistral': 846, 'n_tokens_neox': 798, 'n_words': 242}