{"size": 1084, "ext": "js", "max_stars_repo_path": "charts/scatter-graph/bower_components/grid-lines/dist/grid-lines.js", "max_stars_repo_name": "factmint/Charts", "max_stars_repo_stars_event_min_datetime": "2016-08-16T21:07:04.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-25T06:57:01.000Z", "max_issues_repo_path": "charts/pictorial-bar-chart/bower_components/grid-lines/dist/grid-lines.js", "max_issues_repo_name": "factmint/Charts", "max_issues_repo_issues_event_min_datetime": "2017-09-06T18:22:17.000Z", "max_issues_repo_issues_event_max_datetime": "2017-09-07T10:33:52.000Z", "max_forks_repo_path": "charts/stacked-area-chart/bower_components/grid-lines/dist/grid-lines.js", "max_forks_repo_name": "factmint/Charts", "max_forks_repo_forks_event_min_datetime": "2017-07-22T05:04:39.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-14T17:36:30.000Z"}
{"max_stars_count": 7, "max_issues_count": 1, "max_forks_count": 5, "avg_line_length": 23.0638297872, "max_line_length": 90, "alphanum_fraction": 0.6328413284}
define(['snap'],
function(Snap) {
	return Snap.plugin(function(Snap, Element, Paper) {

		Paper.prototype.gridLines = function(startX, startY, startPoints, length, orientation) {
			var paper = this;
			var gridLines = this.g();

			function drawHorizontalGridLines() {
				startPoints.forEach(function(startPoint, startPointIndex) {
					var newGridLine = paper.line(
						startX,
						startPoint.y,
						startX + length,
						startPoint.y
					)
						.addClass('fm-grid-line');
					gridLines.append(newGridLine);
				});
			}

			function drawVerticalGridLines() {
				startPoints.forEach(function(startPoint, startPointIndex) {
					var newGridLine = paper.line(
						startPoint.x,
						startY,
						startPoint.x,
						startY + length
					)
						.addClass('fm-grid-line');
					gridLines.append(newGridLine);
				});
			}

			if (orientation === 'horizontal') {
				drawHorizontalGridLines();
			} else if (orientation === 'vertical') {
				drawVerticalGridLines();
			} else {
				console.err('Invalid orientation specified');
			}

			return gridLines;
		};

	});
});