<commit_before>(function(angular) {
    var ngDashboard = angular.module('ngDashboard');

    ngDashboard.config(['widgetFactoryProvider',
        function(widgetFactoryProvider) {
            widgetFactoryProvider.registerChartMixin('coordinateGridMixin', new CoordinateGridMixin());
        }
    ]);

    function CoordinateGridMixin() {}

    CoordinateGridMixin.prototype.initialize = ['scaleParser', 'invokeIfDefined',
        function(scaleParser, invokeIfDefined) {
            this.scaleParser = scaleParser;
            this.invokeIfDefined = invokeIfDefined;
        }
    ];

    CoordinateGridMixin.prototype.configureChart = function(chart, widgetData) {
        chart.x(this.scaleParser.parse(widgetData.rawData.x));

        this.invokeIfDefined(widgetData.rawData, chart, 'yAxisPadding');
        this.invokeIfDefined(widgetData.rawData, chart, 'yAxisLabel');
        this.invokeIfDefined(widgetData.rawData, chart, 'brushOn');
    };
})(angular);<commit_msg>checked if rawdata.x is defined before creating scale<commit_after>(function(angular) {
    var ngDashboard = angular.module('ngDashboard');

    ngDashboard.config(['widgetFactoryProvider',
        function(widgetFactoryProvider) {
            widgetFactoryProvider.registerChartMixin('coordinateGridMixin', new CoordinateGridMixin());
        }
    ]);

    function CoordinateGridMixin() {}

    CoordinateGridMixin.prototype.initialize = ['scaleParser', 'invokeIfDefined',
        function(scaleParser, invokeIfDefined) {
            this.scaleParser = scaleParser;
            this.invokeIfDefined = invokeIfDefined;
        }
    ];

    CoordinateGridMixin.prototype.configureChart = function(chart, widgetData) {
        var invoke = this.invokeIfDefined
        var raw = widgetData.rawData;

        if (raw.x) {
            chart.x(this.scaleParser.parse(raw.x));
        }

        invoke(raw, chart, 'yAxisPadding');
        invoke(raw, chart, 'yAxisLabel');
        invoke(raw, chart, 'brushOn');
        invoke(raw, chart, 'elasticX');
        invoke(raw, chart, 'elasticY');
    };
})(angular);
{'fraction_non_alphanumeric': 0.11792905081495686, 'fraction_numerical': 0.0, 'mean_word_length': 3.294238683127572, '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': '6421860', 'n_tokens_mistral': 591, 'n_tokens_neox': 577, 'n_words': 88}