<commit_before>(function() {
    'use strict';

    /**
     * @ngdoc service
     * @name data-prep.datagrid.service:DatagridColumnService
     * @description Datagrid private service that manage the grid columns and columns headers
     * LEXICON :
     * <ul>
     *     <li>Column : the slick grid column</li>
     *     <li>Header : the datagrid header directive. The header created by SlickGrid will be called by 'SlickGird Header'</li>
     * </ul>
     * @requires data-prep.datagrid.service:DatagridStyleService
     * @requires data-prep.services.playground.service:DatagridService
     * @requires data-prep.services.utils.service:ConverterService
     */
    function DatagridColumnService($rootScope, $compile, DatagridStyleService, DatagridService, ConverterService) {
        var grid;

        var gridHeaderPreviewTemplate =
            '<div class="grid-header <%= diffClass %>">' +
            '   <div class="grid-header-title dropdown-button ng-binding"><%= name %></div>' +
            '       <div class="grid-header-type ng-binding"><%= simpleType %></div>' +
            '   </div>' +
            '<div class="quality-bar"><div class="record-unknown"></div></div>';

        var gridHeaderTemplate = '<div id="datagrid-header-<%= index %>"></div>';

        var service = {
            colHeaderElements: [],
            init: init,
            updateColumns: updateColumns
        };
        return service;

        //------------------------------------------------------------------------------------------------------
        //-----------------------------------------------GRID COLUMNS-------------------------------------------
        //------------------------------------------------------------------------------------------------------

        /**
         * @ngdoc method
         * @name createColumnItem
         * @methodOf data-prep.datagrid.service:DatagridColumnService
         * @param {object} col The column metadata to adapt
         * @param {number} index The column index
         * @param {boolean} preview Flag that indicates if we are in the preview mode
         * @description Adapt column metadata to slick column.
         * <ul>
         *     <li>Non preview mode : The div id depending on index is important. It is used as insertion point for the header directive.</li>
         *     <li>Preview mode : we inject directly a fake header</li>
         * </ul>
         * @returns {object} The adapted column item
         */
        function createColumnItem(col, index, preview) {
            var template;
            if(preview) {
                template =  _.template(gridHeaderPreviewTemplate)({
                    name: col.name,
                    diffClass: DatagridStyleService.getColumnPreviewStyle(col),
                    simpleType: ConverterService.simplifyType(col.type)
                });
            }
            else {
                template =  _.template(gridHeaderTemplate)({index: index});
            }
<commit_msg>TDP-337 changing columns domains while preview<commit_after>(function() {
    'use strict';

    /**
     * @ngdoc service
     * @name data-prep.datagrid.service:DatagridColumnService
     * @description Datagrid private service that manage the grid columns and columns headers
     * LEXICON :
     * <ul>
     *     <li>Column : the slick grid column</li>
     *     <li>Header : the datagrid header directive. The header created by SlickGrid will be called by 'SlickGird Header'</li>
     * </ul>
     * @requires data-prep.datagrid.service:DatagridStyleService
     * @requires data-prep.services.playground.service:DatagridService
     * @requires data-prep.services.utils.service:ConverterService
     */
    function DatagridColumnService($rootScope, $compile, DatagridStyleService, DatagridService, ConverterService) {
        var grid;

        var gridHeaderPreviewTemplate =
            '<div class="grid-header <%= diffClass %>">' +
            '   <div class="grid-header-title dropdown-button ng-binding"><%= name %></div>' +
            '       <div class="grid-header-type ng-binding"><%= simpleType %></div>' +
            '   </div>' +
            '<div class="quality-bar"><div class="record-unknown"></div></div>';

        var gridHeaderTemplate = '<div id="datagrid-header-<%= index %>"></div>';

        var service = {
            colHeaderElements: [],
            init: init,
            updateColumns: updateColumns
        };
        return service;

        //------------------------------------------------------------------------------------------------------
        //-----------------------------------------------GRID COLUMNS-------------------------------------------
        //------------------------------------------------------------------------------------------------------

        /**
         * @ngdoc method
         * @name createColumnItem
         * @methodOf data-prep.datagrid.service:DatagridColumnService
         * @param {object} col The column metadata to adapt
         * @param {number} index The column index
         * @param {boolean} preview Flag that indicates if we are in the preview mode
         * @description Adapt column metadata to slick column.
         * <ul>
         *     <li>Non preview mode : The div id depending on index is important. It is used as insertion point for the header directive.</li>
         *     <li>Preview mode : we inject directly a fake header</li>
         * </ul>
         * @returns {object} The adapted column item
         */
        function createColumnItem(col, index, preview) {
            var template;
            if(preview) {
                template =  _.template(gridHeaderPreviewTemplate)({
                    name: col.name,
                    diffClass: DatagridStyleService.getColumnPreviewStyle(col),
                    simpleType: col.domain ? col.domain : ConverterService.simplifyType(col.type)
                });
            }
            else {
                template =  _.template(gridHeaderTemplate)({index: index});
            }

{'fraction_non_alphanumeric': 0.19637860082304526, 'fraction_numerical': 0.0004938271604938272, 'mean_word_length': 1.5626318009278786, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, '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': '4942437', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1428, 'n_words': 387}