<commit_before>/**
 * Hash-table<br>
 * Connects widget types from DeepSee to mobile realization.<br>
 * E.g. DeepSee has "barChart", which we interpret as Widget with type "highcharts" and subtype "bar" (which gets into HighcharstWidget with type "bar")
 * @module WidgetMap
 */
define(['MessageCenter'], function (mc) {
    return {
        "barChart": {

            type: "highcharts",
            callback: function (d) {

                //console.log("HERE:", d);
                var data = d.data;
                //this.config.xAxis.type="category";
                //this.config.xAxis.showEmpty = false;
                this.config.xAxis.title = {
                    text: data.axes[1].caption
                };
                this.config.yAxis.title = {
                    text: data.defaultCaption || data.axes[0].caption
                };
                var _pos = 0;
                this.config.xAxis.categories = [];
                this.config.series = [];
                for (var i = 0; i < data.axes[1].tuples.length; i++) {
                    this.config.xAxis.categories.push(data.axes[1].tuples[i].caption.toString());
                }

                for(var j = 0; j< data.axes[0].tuples.length; j++){
                var tempData = [];
                for(var i = 0; i< data.axes[1].tuples.length; i++){
                        tempData[i] = {
                        y: data.cells[i* data.axes[0].tuples.length + j],
                        drilldown: true,
                        cube: data.cubeName,
                        path: data.axes[1].tuples[i].path
                        };
                        
                    };
                
                this.config.series.push({
                        colorByPoint:  (data.axes[0].tuples.length>1) ? false : true,
                        data: tempData,
                        name: data.axes[0].tuples[j].caption
                        });
                }

            },
            config: {
                chart: {
                    type: 'bar',
                    events: {
                        drilldown: function (e) {
                            if(this._isDrilldown) return;
                            this._isDrilldown = true;
                            var chart = this;
                            //var catName = chart.options.xAxis[0].title.text;
                            
                            // Show the loading label
                            chart.showLoading('Doing drilldown ...');
                            var mc = require("MessageCenter");
                            mc.subscribe("data_acquired:drilldown", {<commit_msg>Added support for "Stacked Bar Chart" widget<commit_after>/**
 * Hash-table<br>
 * Connects widget types from DeepSee to mobile realization.<br>
 * E.g. DeepSee has "barChart", which we interpret as Widget with type "highcharts" and subtype "bar" (which gets into HighcharstWidget with type "bar")
 * @module WidgetMap
 */
define(['MessageCenter'], function (mc) {
    return {
        // Added by Gnibeda 25.11.2014
        "barChartStacked": {
            type: "highcharts",
            callback: function (d) {
                var data = d.data;
                console.log(d);
                var t = this;
                t.config.xAxis.title = {
                    text: data.axes[1].caption
                };
                this.config.yAxis.title = {
                    text: data.defaultCaption || data.axes[0].caption
                };
                var _pos = 0;
                this.config.xAxis.categories = [];
                this.config.series = [];
                for (var i = 0; i < data.axes[1].tuples.length; i++) {
                    this.config.xAxis.categories.push(data.axes[1].tuples[i].caption.toString());
                }

                for(var j = 0; j< data.axes[0].tuples.length; j++) {
                    var tempData = [];
                    for (var i = 0; i < data.axes[1].tuples.length; i++) {
                        tempData[i] = {
                            y: data.cells[i * data.axes[0].tuples.length + j],
                            drilldown: true,
                            cube: data.cubeName,
                            path: data.axes[1].tuples[i].path
                        };
                    };
                    this.config.series.push({
                        colorByPoint:  (data.axes[0].tuples.length>1) ? false : true,
                        data: tempData,
                        name: data.axes[0].tuples[j].caption
                    });
                };
            },
            config: {
                title: "",
                chart: {
                    type: 'bar'
                },
                xAxis: {
                    categories: []
                },
                yAxis: {},
                legend:{enabled:true},
                plotOptions: {
                    series: {
                        stacking: 'normal'
                    }
                },
                series: []
            }
        },

        "barChart": {

            type: "highcharts",
            callback: function (d) {

                //console.log("HERE:", d);
                var data = d.data;
                //this.config.xAxis.type="category";
                //this.config.xAxis.showEmpty = false;
                this.config.xAxis.title = {
                    text: data.axes[1].caption
                };
                this.config.yAxis.title = {
                    text: data.defaultCaption || data.axes[0].caption
                };
                var _pos = 0;
                this.config.xAxis.categories = [];
                this.config.series = [];
                for (var i = 0; i < data.axes[1].tuples.length; i++) {
                    this.config.xAxis.categories.push(data.axes[1].tuples[i].caption.toString());
                }

                for(var j = 0; j< data.axes[0].tuples.length; j++){
                var tempData = [];
                for(var i = 0; i< data.axes[1].tuples.length; i++){
                        tempData[i] = {
                        y: data.cells[i* data.axes[0].tuples.length + j],
                        drilldown: true,
                        cube: data.cubeName,
                        path: data.axes[1].tuples[i].path
                        };
                        
                    };
                
                this.config.series.push({
                        colorByPoint:  (data.axes[0].tuples.length>1) ? false : true,
                        data: tempData,
                        name: data.axes[0].tuples[j].caption
                        });
                }

            },
            config: {
                chart: {
                        type: 'bar',
                    events: {
                        drilldown: function (e) {
                            if(this._isDrilldown) return;
                            this._isDrilldown = true;
                            var chart = this;
                            //var catName = chart.options.xAxis[0].title.text;
                            
                            // Show the loading label
                            chart.showLoading('Doing drilldown ...');
                            var mc = require("MessageCenter");
                            mc.subscribe("data_acquired:drilldown", {
{'fraction_non_alphanumeric': 0.11692680301399354, 'fraction_numerical': 0.007400430570505921, 'mean_word_length': 0.9458115183246073, 'pattern_counts': {'":': 3, '<': 16, '<?xml version=': 0, '>': 10, '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': '4291382', 'n_tokens_mistral': 2022, 'n_tokens_neox': 1837, 'n_words': 360}