<commit_before>'use strict';

var d3   = require('d3');
var Vue  = require('vue');

var util = require('../../util/data');

module.exports = Vue.extend({
	paramAttributes: [
		'data-lines',
		'data-areas',
		'data-width',
		'data-height'
	],

	mixins: [
		require('./yGrid'),
		require('./xAxis')
	],

	data: function () {
		return {
			lines : [],
			areas : [],
			width : 100,
			height: 100,
			x     : d3.scale.linear(),
			y     : d3.scale.linear()
		};
	},

	created: function () {
		if (!this.$options.hasOwnProperty('x')) {
			this.$options.x = d3.time.scale();
		}

		if (!this.$options.hasOwnProperty('y')) {
			this.$options.y = d3.scale.linear();
		}
	},

	methods: {
		draw: function () {
			function getX(d) { return d.x; }

			function getY(d) { return d.y; }

			function getScaledX(d) { return x(getX(d)); }

			function getScaledY(d) { return y(getY(d)); }

			function defined(d) { return util.defined(getY(d)); }

			function getPoints(d) { return d.points; }

			var self    = this;
			var svg     = d3.select(this.$el);

			var dataset = [this.lines.map(getPoints), this.areas.map(getPoints)];
			var start   = this.domain ? this.domain[0] : util.min(dataset, getX);
			var end     = this.domain ? this.domain[1] : util.max(dataset, getX);
			var lower   = Math.min(0, util.min(dataset, getY));
			var upper   = util.max(dataset, getY);

			var x       = this.x;
			var y       = this.y;

			x.domain([start, end])
				.range([0, this.width]);
			y.domain([lower, upper])
				.range([this.height, 0]);

			var area = d3.svg.area()
				.defined(defined)
				.x(getScaledX)<commit_msg>Add 10% padding to the upper bound on the line chart.<commit_after>'use strict';

var d3   = require('d3');
var Vue  = require('vue');

var util = require('../../util/data');

module.exports = Vue.extend({
	paramAttributes: [
		'data-lines',
		'data-areas',
		'data-width',
		'data-height'
	],

	mixins: [
		require('./yGrid'),
		require('./xAxis')
	],

	data: function () {
		return {
			lines : [],
			areas : [],
			width : 100,
			height: 100,
			x     : d3.scale.linear(),
			y     : d3.scale.linear()
		};
	},

	created: function () {
		if (!this.$options.hasOwnProperty('x')) {
			this.$options.x = d3.time.scale();
		}

		if (!this.$options.hasOwnProperty('y')) {
			this.$options.y = d3.scale.linear();
		}
	},

	methods: {
		draw: function () {
			function getX(d) { return d.x; }

			function getY(d) { return d.y; }

			function getScaledX(d) { return x(getX(d)); }

			function getScaledY(d) { return y(getY(d)); }

			function defined(d) { return util.defined(getY(d)); }

			function getPoints(d) { return d.points; }

			var self    = this;
			var svg     = d3.select(this.$el);

			var dataset = [this.lines.map(getPoints), this.areas.map(getPoints)];
			var start   = this.domain ? this.domain[0] : util.min(dataset, getX);
			var end     = this.domain ? this.domain[1] : util.max(dataset, getX);
			var lower   = Math.min(0, util.min(dataset, getY));
			var upper   = util.max(dataset, getY) * 1.1;

			var x       = this.x;
			var y       = this.y;

			x.domain([start, end])
				.range([0, this.width]);
			y.domain([lower, upper])
				.range([this.height, 0]);

			var area = d3.svg.area()
				.defined(defined)
				.x(getScaledX)
{'fraction_non_alphanumeric': 0.1921424186617557, 'fraction_numerical': 0.01289134438305709, 'mean_word_length': 2.7331042382588775, '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': '2860396', 'n_tokens_mistral': 1418, 'n_tokens_neox': 1217, 'n_words': 252}