<commit_before>angular.module('yds').directive('ydsWorkbenchNew', ['$ocLazyLoad', '$compile', '$templateRequest', 'Data', 'Basket', 'Workbench', 'Personalization',
    function ($ocLazyLoad, $compile, $templateRequest, Data, Basket, Workbench, Personalization) {
        return {
            restrict: 'E',
            scope: {
                lang: '@',
                userId: '@'
            },
            templateUrl: Data.templatePath + 'templates/workbench/workbench-new.html',
            link: function (scope, element) {
                scope.ydsAlert = "";
                var editorContainer = angular.element(element[0].querySelector('.highcharts-editor-container'));

                //if userId is undefined or empty, stop the execution of the directive
                if (_.isUndefined(scope.userId) || scope.userId.trim().length === 0) {
                    scope.ydsAlert = "The YDS component is not properly configured." +
                        "Please check the corresponding documentation section";
                    return false;
                }

                // Variable to keep the selected item in
                scope.selectedItems = [];
                scope.viewsLoaded = false;
                scope.plotOptionsLoading = false;
                scope.selection = {};
                scope.chartConfig = {};

                // Object to keep suggested templates in
                var suggestedTemplates = {
                    templates: []
                };

                var editor = null;
                var allViews = null;

                // Variable to keep last template. Default template is basic line chart.
                var lastTemplate = {
                    title: "Line chart",
                    config: {
                        "chart--type": "line"
                    }
                };

                // Check if the language attr is defined, else assign default value
                if (_.isUndefined(scope.lang) || scope.lang.trim() === "")
                    scope.lang = "en";

                // Load the required CSS & JS files for the Editor
                $ocLazyLoad.load({
                    files: [
                        Data.templatePath + "css/highcharts-editor.min.css",
                        Data.templatePath + "lib/highcharts-editor.js",
                        Data.templatePath + "lib/yds-chart-template-selector.js",
                        Data.templatePath + "lib/yds-chart-editor.js"
                    ],<commit_msg>Fix workbench paths in demo<commit_after>angular.module('yds').directive('ydsWorkbenchNew', ['$ocLazyLoad', '$compile', '$templateRequest', 'Data', 'Basket', 'Workbench', 'Personalization',
    function ($ocLazyLoad, $compile, $templateRequest, Data, Basket, Workbench, Personalization) {
        return {
            restrict: 'E',
            scope: {
                lang: '@',
                userId: '@'
            },
            templateUrl: Data.templatePath + 'templates/workbench/workbench-new.html',
            link: function (scope, element) {
                scope.ydsAlert = "";
                var editorContainer = angular.element(element[0].querySelector('.highcharts-editor-container'));

                //if userId is undefined or empty, stop the execution of the directive
                if (_.isUndefined(scope.userId) || scope.userId.trim().length === 0) {
                    scope.ydsAlert = "The YDS component is not properly configured." +
                        "Please check the corresponding documentation section";
                    return false;
                }

                // Variable to keep the selected item in
                scope.selectedItems = [];
                scope.viewsLoaded = false;
                scope.plotOptionsLoading = false;
                scope.selection = {};
                scope.chartConfig = {};

                // Object to keep suggested templates in
                var suggestedTemplates = {
                    templates: []
                };

                var editor = null;
                var allViews = null;

                // Variable to keep last template. Default template is basic line chart.
                var lastTemplate = {
                    title: "Line chart",
                    config: {
                        "chart--type": "line"
                    }
                };

                // Check if the language attr is defined, else assign default value
                if (_.isUndefined(scope.lang) || scope.lang.trim() === "")
                    scope.lang = "en";

                // Load the required CSS & JS files for the Editor
                $ocLazyLoad.load({
                    files: [
                        Data.templatePath + "css/highcharts-editor.min.css",
                        Data.templatePath + "lib/highcharts-editor.js",
                        Data.templatePath + "lib/plugins/yds-chart-template-selector.js",
                        Data.templatePath + "lib/plugins/yds-chart-editor.js"
                    ],
{'fraction_non_alphanumeric': 0.10397794407246948, 'fraction_numerical': 0.0007877116975187081, 'mean_word_length': 1.3678321678321679, 'pattern_counts': {'":': 2, '<': 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': '7477918', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1127, 'n_words': 300}