<commit_before>function PieChart(width, height) {
	this.width = width;
	this.height = height;
}

PieChart.prototype = {
    constructor: PieChart,

    drawChart: function(idSVG, data) {
        var self = this;
        this.id = idSVG;

        nv.addGraph(function() {
            self.chart = nv.models.pieChart()
                .width(self.width)
                .height(self.height)
                .x(function(d) { return d.label })
                .y(function(d) { return d.value })
                .showLabels(false)
				.showLegend(false);

			self.updateChart(data)
 			nv.utils.windowResize(function() { self.chart.update() });


            return self.chart;
        });

    },

    updateChart: function(data) {
        d3.select(this.id)
            .datum(data)
            .transition().duration(1200)
			.attr('width', this.width)
			.attr('height', this.height)
            .call(this.chart);

		if (this.callback) this.onSliceClick(this.callback);

    },

	onSliceClick: function(callback) {
		this.callback = callback;

        /* SLICE CLICK */
        d3.selectAll('.nv-slice')
            .on('click', function(d) {
				callback(d.data.label);
            });

        /* LEGEND CLICK */
        d3.selectAll('.nv-series')
            .on('click', function(d) {
				callback(d.label);
            })
            .on('dblclick', function() {});
	}

};
<commit_msg>I hate static things. Please update so I can test.<commit_after>function PieChart(width, height) {
	this.width = width;
	this.height = height;
}

PieChart.prototype = {
    constructor: PieChart,

    drawChart: function(idSVG, data) {
        var self = this;
        this.id = idSVG;

        nv.addGraph(function() {
            self.chart = nv.models.pieChart()
                .width(self.width)
                .height(self.height-300)
                .x(function(d) { return d.label })
                .y(function(d) { return d.value })
                .showLabels(false)
				.showLegend(false);

			self.updateChart(data)
 			nv.utils.windowResize(function() { self.chart.update() });


            return self.chart;
        });

    },

    updateChart: function(data) {
        d3.select(this.id)
            .datum(data)
            .transition().duration(1200)
			.attr('width', this.width)
			.attr('height', this.height)
            .call(this.chart);

		if (this.callback) this.onSliceClick(this.callback);

    },

	onSliceClick: function(callback) {
		this.callback = callback;

        /* SLICE CLICK */
        d3.selectAll('.nv-slice')
            .on('click', function(d) {
				callback(d.data.label);
            });

        /* LEGEND CLICK */
        d3.selectAll('.nv-series')
            .on('click', function(d) {
				callback(d.label);
            })
            .on('dblclick', function() {});
	}

};

{'fraction_non_alphanumeric': 0.15207373271889402, 'fraction_numerical': 0.006026231832683446, 'mean_word_length': 1.8135593220338984, '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': '1842552', 'n_tokens_mistral': 957, 'n_tokens_neox': 874, 'n_words': 143}