text:
(function (global, factory) {
	if (typeof define === "function" && define.amd) {
		define(["exports", "react", "react-dom", "interact.js"], factory);
	} else if (typeof exports !== "undefined") {
		factory(exports, require("react"), require("react-dom"), require("interact.js"));
	} else {
		var mod = {
			exports: {}
		};
		factory(mod.exports, global.react, global.reactDom, global.interact);
		global.XYDiagram = mod.exports;
	}
})(this, function (exports, _react, _reactDom, _interact) {
	"use strict";

	Object.defineProperty(exports, "__esModule", {
		value: true
	});

	var _react2 = _interopRequireDefault(_react);

	var _reactDom2 = _interopRequireDefault(_reactDom);

	var _interact2 = _interopRequireDefault(_interact);

	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : {
			default: obj
		};
	}

	function _classCallCheck(instance, Constructor) {
		if (!(instance instanceof Constructor)) {
			throw new TypeError("Cannot call a class as a function");
		}
	}

	function _possibleConstructorReturn(self, call) {
		if (!self) {
			throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
		}

		return call && (typeof call === "object" || typeof call === "function") ? call : self;
	}

	var _createClass = function () {
		function defineProperties(target, props) {
			for (var i = 0; i < props.length; i++) {
				var descriptor = props[i];
				descriptor.enumerable = descriptor.enumerable || false;
				descriptor.configurable = true;
				if ("value" in descriptor) descriptor.writable = true;
				Object.defineProperty(target, descriptor.key, descriptor);
			}
		}

		return function (Constructor, protoProps, staticProps) {
			if (protoProps) defineProperties(Constructor.prototype, protoProps);
			if (staticProps) defineProperties(Constructor, staticProps);
			return Constructor;
		};
	}();

	function _inherits(subClass, superClass) {
		if (typeof superClass !== "function" && superClass !== null) {
			throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
		}

		subClass.prototype = Object.create(superClass && superClass.prototype, {
			constructor: {
				value: subClass,
				enumerable: false,
				writable: true,
				configurable: true
			}
		});
		if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
	}

	function defaultLabelFunc(value) {
		return "" + value;
	}

	var XYDiagram = function (_React$PureComponent) {
		_inherits(XYDiagram, _React$PureComponent);

		_createClass(XYDiagram, null, [{
			key: "shiftArray",
			value: function shiftArray(a, val) {
				a.copyWithin(0, 1);
				a[a.length - 1] = val;
			}
		}, {
			key: "rotateArray",
			value: function rotateArray(a) {
				XYDiagram.shiftArray(a, a[0]);
			}
		}, {
			key: "calcTextWidth",
			value: function calcTextWidth(text, labelSize) {
				return text.length * labelSize * 0.6;
			}
		}, {
			key: "calcLeftAxisXOffset",
			value: function calcLeftAxisXOffset(yMin, yMax) {
				var yAxisTitle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
				var yLabelFunc = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : defaultLabelFunc;
				var labelSize = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : XYDiagram.defaultProps.labelSize;

				var textHeight = labelSize * 1.2;
				var minLabel = yLabelFunc(yMin, yMin, yMax);
				var maxLabel = yLabelFunc(yMax, yMin, yMax);
				var textWidth = Math.max(XYDiagram.calcTextWidth(minLabel, labelSize), XYDiagram.calcTextWidth(maxLabel, labelSize));
				if (yAxisTitle) {
					textWidth = Math.max(textWidth, XYDiagram.calcTextWidth(yAxisTitle, labelSize) * 0.5);
				}
				return textHeight * 0.2 + textWidth;
			}
		}, {
			key: "calcRightAxisXOffset",
			value: function calcRightAxisXOffset(y2Min, y2Max) {
				var y2AxisTitle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
				var y2LabelFunc = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : defaultLabelFunc;
				var labelSize = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : XYDiagram.defaultProps.labelSize;

				var textHeight = labelSize * 1.2;
				var minLabel = y2LabelFunc(y2Min, y2Min, y2Max);
				var maxLabel = y2LabelFunc(y2Max, y2Min, y2Max);
				var textWidth = Math.max(XYDiagram.calcTextWidth(minLabel, labelSize), XYDiagram.calcTextWidth(maxLabel, labelSize));
				if (y2AxisTitle) {
					textWidth = Math.max(textWidth, XYDiagram.calcTextWidth(y2AxisTitle, labelSize) * 0.5);
				}
				return textHeight * 0.2 + textWidth;
			}
		}]);

		function XYDiagram() {
			var _ref;

			_classCallCheck(this, XYDiagram);

			for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
				args[_key] = arguments[_key];
			}

			var _this = _possibleConstructorReturn(this, (_ref = XYDiagram.__proto__ || Object.getPrototypeOf(XYDiagram)).call.apply(_ref, [this].concat(args)));

			_this.onClickMarker = _this.onClickMarker.bind(_this);
			return _this;
		}

		_createClass(XYDiagram, [{
			key: "axisXOffset",
			value: function axisXOffset() {
				if (this.props.leftAxisXOffset) {
					return this.props.leftAxisXOffset;
				}
				if (!this.hasLeftYLabels()) {
					return 0;
				}
				var _props = this.props,
				    yMin = _props.yMin,
				    yMax = _props.yMax,
				    yAxisTitle = _props.yAxisTitle,
				    yLabelFunc = _props.yLabelFunc,
				    labelSize = _props.labelSize;

				return XYDiagram.calcLeftAxisXOffset(yMin, yMax, yAxisTitle, yLabelFunc, labelSize);
			}
		}, {
			key: "rightAxisXOffset",
			value: function rightAxisXOffset() {
				if (this.props.rightAxisXOffset) {
					return this.props.rightAxisXOffset;
				}
				if (!this.hasRightYLabels()) {
					return 0;
				}
				var _props2 = this.props,
				    y2Min = _props2.y2Min,
				    y2Max = _props2.y2Max,
				    y2AxisTitle = _props2.y2AxisTitle,
				    y2LabelFunc = _props2.y2LabelFunc,
				    labelSize = _props2.labelSize;

				return XYDiagram.calcRightAxisXOffset(y2Min, y2Max, y2AxisTitle, y2LabelFunc, labelSize);
			}
		}, {
			key: "onClickMarker",
			value: function onClickMarker(event) {
				if (this.props.onClickMarker) {
					var index = parseInt(event.target.getAttribute("data-index"));
					var x = parseFloat(event.target.getAttribute("data-x"));
					var y = parseFloat(event.target.getAttribute("data-y"));
					var selected = event.target.hasAttribute("data-selected");
					this.props.onClickMarker(index, x, y, selected);
				}
			}
		}, {
			key: "makeDraggable",
			value: function makeDraggable(group, marker, onDragged) {
				var _this2 = this;

				var parent = _reactDom2.default.findDOMNode(this.refs.parent);
				group = _reactDom2.default.findDOMNode(group);
				marker = _reactDom2.default.findDOMNode(marker);
				(0, _interact2.default)(marker).draggable({
					startAxis: "x",
					lockAxis: "x",
					preventDefault: "always",
					restrict: {
						restriction: parent,
						elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
					}
				}).on("dragstart", function (event) {
					event.preventDefault();
					// Only way to change the class of an SVG element:
					marker.setAttribute("class", "dragging");
				}).on("dragmove", function (event) {
					var dx = event.clientX - event.clientX0;
					group.setAttribute("transform", "translate(" + dx + ")");
				}).on("dragend", function (event) {
					// Only way to change the class of an SVG element:
					marker.removeAttribute("class");
					group.removeAttribute("transform");
					if (onDragged) {
						var clientX = event.clientX - parent.getBoundingClientRect().left;

						var xFactor = _this2.props.xFactor;

						var xMin = _this2.xMin();
						var xMax = _this2.xMax();
						var leftMarkerVisible = _this2.isLeftMarkerVisible();
						var xOffset = leftMarkerVisible ? _this2.props.leftRightMarkerWidth : 0;
						var axisXOffset = _this2.axisXOffset();
						var rangeWidth = _this2.rangeWidth();
						var xRange = xMax - xMin;
						var xScale = rangeWidth / xRange;
						// axisXOffset + xOffset + (x*xFactor - xMin) * xScale = clientX
						// (x*xFactor - xMin) * xScale = clientX - axisXOffset - xOffset
						// x*xFactor - xMin = (clientX - axisXOffset - xOffset) / xScale
						// x*xFactor = (clientX - axisXOffset - xOffset) / xScale + xMin
						var x = ((clientX - axisXOffset - xOffset) / xScale + xMin) / xFactor;
						onDragged(x, clientX);
					}
				});
			}
		}, {
			key: "componentDidMount",
			value: function componentDidMount() {
				this.makeDraggable(this.refs.leftMarkerGroup, this.refs.leftMarker, this.props.leftMarkerDragged);
				this.makeDraggable(this.refs.rightMarkerGroup, this.refs.rightMarker, this.props.rightMarkerDragged);
			}
		}, {
			key: "isLeftMarkerVisible",
			value: function isLeftMarkerVisible() {
				return !isNaN(this.props.leftMarkerX) && this.props.leftMarkerX !== this.props.rightMarkerX;
			}
		}, {
			key: "isRightMarkerVisible",
			value: function isRightMarkerVisible() {
				return !isNaN(this.props.rightMarkerX) && this.props.leftMarkerX !== this.props.rightMarkerX;
			}
		}, {
			key: "hasXLabels",
			value: function hasXLabels() {
				return !!this.props.xLabelSpacing || this.props.xLabelAtPoint;
			}
		}, {
			key: "hasLeftYLabels",
			value: function hasLeftYLabels() {
				return !!this.props.yLabelSpacing && !this.props.y2OnRightAxis;
			}
		}, {
			key: "hasRightYLabels",
			value: function hasRightYLabels() {
				return !!this.props.y2LabelSpacing || !!this.props.yLabelSpacing && this.props.y2OnRightAxis;
			}
		}, {
			key: "rangeWidth",
			value: function rangeWidth() {
				var rangeWidth = this.props.width - this.axisXOffset() - this.rightAxisXOffset();
				rangeWidth -= this.isLeftMarkerVisible() ? this.props.leftRightMarkerWidth : 0;
				rangeWidth -= this.isRightMarkerVisible() ? this.props.leftRightMarkerWidth : 0;
				return rangeWidth;
			}
		}, {
			key: "xMin",
			value: function xMin() {
				var xMin = this.props.xMin;

				return typeof xMin === "function" ? xMin(this.axisXOffset()) : xMin;
			}
		}, {
			key: "xMax",
			value: function xMax() {
				var xMax = this.props.xMax;

				return typeof xMax === "function" ? xMax(this.rightAxisXOffset()) : xMax;
			}
		}, {
			key: "textWidth",
			value: function textWidth(text) {
				return text.length * this.props.labelSize * 0.6;
			}
		}, {
			key: "render",
			value: function render() {
				var _this3 = this;

				////////////////////////////////////////////////////////////////////////////////
				// Set constants to work with:

				var leftMarkerVisible = this.isLeftMarkerVisible();
				var rightMarkerVisible = this.isRightMarkerVisible();

				var _props3 = this.props,
				    labelFont = _props3.labelFont,
				    labelSize = _props3.labelSize,
				    labelColor = _props3.labelColor,
				    xLabelOrigin = _props3.xLabelOrigin,
				    xLabelSpacing = _props3.xLabelSpacing,
				    xLabelAtPoint = _props3.xLabelAtPoint,
				    yLabelAtPoint = _props3.yLabelAtPoint,
				    xLabelFunc = _props3.xLabelFunc,
				    xLabelNoOverlapCheck = _props3.xLabelNoOverlapCheck,
				    xStep = _props3.xStep;
				var _props4 = this.props,
				    yLabelOrigin = _props4.yLabelOrigin,
				    yLabelSpacing = _props4.yLabelSpacing,
				    yLabelFunc = _props4.yLabelFunc,
				    yColor = _props4.yColor,
				    yOpacity = _props4.yOpacity,
				    markerSize = _props4.markerSize,
				    yAxisTitle = _props4.yAxisTitle;
				var _props5 = this.props,
				    y2LabelOrigin = _props5.y2LabelOrigin,
				    y2LabelSpacing = _props5.y2LabelSpacing,
				    y2LabelFunc = _props5.y2LabelFunc,
				    y2LabelAtPoint = _props5.y2LabelAtPoint,
				    y2Color = _props5.y2Color,
				    y2Opacity = _props5.y2Opacity,
				    markerSize2 = _props5.markerSize2,
				    y2AxisTitle = _props5.y2AxisTitle;
				var _props6 = this.props,
				    y3Color = _props6.y3Color,
				    y3Opacity = _props6.y3Opacity,
				    markerSize3 = _props6.markerSize3;
				var _props7 = this.props,
				    y4Color = _props7.y4Color,
				    y4Opacity = _props7.y4Opacity,
				    markerSize4 = _props7.markerSize4;

				var yLabelColor = this.props.yLabelColor || yColor;
				var y2LabelColor = this.props.y2LabelColor || y2Color;

				var textHeight = labelSize * 1.2;
				var hasXLabels = this.hasXLabels();
				var hasLeftYLabels = this.hasLeftYLabels();
				var hasRightYLabels = this.hasRightYLabels();
				var hasYLabels = hasLeftYLabels || hasRightYLabels;

				var _props8 = this.props,
				    xFactor = _props8.xFactor,
				    width = _props8.width,
				    height = _props8.height,
				    selectedIndex = _props8.selectedIndex;
				var _props9 = this.props,
				    yMin = _props9.yMin,
				    yMax = _props9.yMax,
				    yFactor = _props9.yFactor,
				    yBars = _props9.yBars;
				var _props10 = this.props,
				    y2Min = _props10.y2Min,
				    y2Max = _props10.y2Max,
				    y2Factor = _props10.y2Factor,
				    y2Bars = _props10.y2Bars;
				var _props11 = this.props,
				    y3Min = _props11.y3Min,
				    y3Max = _props11.y3Max,
				    y3Factor = _props11.y3Factor,
				    y3Bars = _props11.y3Bars;
				var _props12 = this.props,
				    y4Min = _props12.y4Min,
				    y4Max = _props12.y4Max,
				    y4Factor = _props12.y4Factor;
				var _props13 = this.props,
				    xGridOrigin = _props13.xGridOrigin,
				    xGridSpacing = _props13.xGridSpacing,
				    xGridAtPoint = _props13.xGridAtPoint,
				    xGridColor = _props13.xGridColor,
				    yGridOrigin = _props13.yGridOrigin,
				    yGridSpacing = _props13.yGridSpacing,
				    yGridColor = _props13.yGridColor,
				    backgroundColor = _props13.backgroundColor;
				var _props14 = this.props,
				    yValuesPerX = _props14.yValuesPerX,
				    y2ValuesPerX = _props14.y2ValuesPerX,
				    y3ValuesPerX = _props14.y3ValuesPerX;

				var xOffset = leftMarkerVisible ? this.props.leftRightMarkerWidth : 0;
				var axisXOffset = this.axisXOffset();
				var axisXOffsetFixed = axisXOffset.toFixed();
				var rightAxisXOffset = this.rightAxisXOffset();
				var rightAxisX = width - rightAxisXOffset;
				var rightAxisXFixed = rightAxisX.toFixed(1);
				var axisYOffset = hasXLabels ? textHeight : hasYLabels ? textHeight * 0.5 : 0;
				var axisYOffsetFixed = axisYOffset.toFixed(1);

				var rangeWidth = this.rangeWidth();
				var rangeTop = height - textHeight * 0.5;
				var rangeHeight = height - axisYOffset - textHeight * 0.5;
				if (yAxisTitle || y2AxisTitle) {
					rangeTop -= textHeight;
					rangeHeight -= textHeight;
				}

				var xMin = this.xMin();
				var xMax = this.xMax();

				var xRange = xMax - xMin;
				var yRange = yMax - yMin;
				var y2Range = y2Max - y2Min;
				var y3Range = y3Max - y3Min;
				var y4Range = y4Max - y4Min;

				var xScale = rangeWidth / xRange;
				var yScale = rangeHeight / yRange;
				var y2Scale = rangeHeight / y2Range;
				var y3Scale = rangeHeight / y3Range;
				var y4Scale = rangeHeight / y4Range;

				////////////////////////////////////////////////////////////////////////////////
				// Transform x/y values to graphics coordinates:

				function transformX(x) {
					return axisXOffset + xOffset + (x * xFactor - xMin) * xScale;
				}

				function transformY(y) {
					return axisYOffset + (y * yFactor - yMin) * yScale;
				}

				function transformY2(y2) {
					return axisYOffset + (y2 * y2Factor - y2Min) * y2Scale;
				}

				function transformY3(y3) {
					return axisYOffset + (y3 * y3Factor - y3Min) * y3Scale;
				}

				function transformY4(y4) {
					return axisYOffset + (y4 * y4Factor - y4Min) * y4Scale;
				}

				////////////////////////////////////////////////////////////////////////////////
				// Axis lines:

				var axisPoints = axisXOffsetFixed + "," + rangeTop + " " + axisXOffsetFixed + "," + axisYOffsetFixed + " " + rightAxisX + "," + axisYOffsetFixed;
				if (hasRightYLabels) {
					axisPoints += " " + rightAxisXFixed + "," + rangeTop;
				}

				////////////////////////////////////////////////////////////////////////////////
				// Grid lines:

				var xGridLinesD = "";
				var yGridLinesD = "";
				if (xGridAtPoint) {
					var _iteratorNormalCompletion = true;
					var _didIteratorError = false;
					var _iteratorError = undefined;

					try {
						for (var _iterator = this.props.x[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
							var x = _step.value;

							if (x >= xMin && x <= xMax) {
								var tx = transformX(x).toFixed(1);
								xGridLinesD += "M" + tx + " " + axisYOffsetFixed + "V" + rangeTop;
							}
						}
					} catch (err) {
						_didIteratorError = true;
						_iteratorError = err;
					} finally {
						try {
							if (!_iteratorNormalCompletion && _iterator.return) {
								_iterator.return();
							}
						} finally {
							if (_didIteratorError) {
								throw _iteratorError;
							}
						}
					}
				} else if (xGridSpacing) {
					var start = xGridOrigin !== 0 ? xGridOrigin : Math.ceil(xMin / xGridSpacing) * xGridSpacing;
					for (var _x7 = start; _x7 <= xMax; _x7 += xGridSpacing) {
						if (_x7 >= xMin) {
							var _tx = transformX(_x7).toFixed(1);
							xGridLinesD += "M" + _tx + " " + axisYOffsetFixed + "V" + rangeTop;
						}
					}
				}
				if (yGridSpacing) {
					var _start = yGridOrigin !== 0 ? yGridOrigin : Math.ceil(yMin / yGridSpacing) * yGridSpacing;
					for (var y = _start; y <= yMax; y += yGridSpacing) {
						if (y >= yMin) {
							var ty = transformY(y).toFixed(1);
							yGridLinesD += "M" + axisXOffsetFixed + " " + ty + "H" + rightAxisXFixed;
						}
					}
				}
				var gridLines = null;
				if (xGridLinesD.length > 0 || yGridLinesD.length > 0) {
					if (xGridColor === yGridColor) {
						gridLines = _react2.default.createElement("path", { d: xGridLinesD + yGridLinesD, stroke: xGridColor, strokeWidth: "1" });
					} else {
						gridLines = [_react2.default.createElement("path", { key: "xGrid", d: xGridLinesD, stroke: xGridColor, strokeWidth: "1" }), _react2.default.createElement("path", { key: "yGrid", d: yGridLinesD, stroke: yGridColor, strokeWidth: "1" })];
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// Labels:

				var numYPoints = Math.min(this.props.x.length, this.props.y.length / yValuesPerX);

				var labels = [];
				if (hasXLabels) {
					var ticksD = "";
					var lastTextRightX = -Number.MAX_VALUE;

					var addXLabel = function addXLabel(x) {
						if (x < xMin || x > xMax) {
							return;
						}

						var tx = transformX(x);
						var txFixed = tx.toFixed(1);
						ticksD += "M" + txFixed + " " + (axisYOffset - textHeight * 0.2).toFixed(1) + "V" + axisYOffset;
						var text = xLabelFunc(x, xMin, xMax);
						var halfWidth = _this3.textWidth(text) * 0.5;
						if (xLabelNoOverlapCheck || tx - halfWidth > lastTextRightX) {
							lastTextRightX = tx + halfWidth;
							labels.push(_react2.default.createElement(
								"text",
								{
									key: "xlt" + x,
									x: txFixed,
									y: (-textHeight * 0.1).toFixed(1),
									transform: "scale(1,-1)",
									textAnchor: "middle",
									fill: labelColor
								},
								text
							));
						}
					};

					if (xLabelAtPoint) {
						var _iteratorNormalCompletion2 = true;
						var _didIteratorError2 = false;
						var _iteratorError2 = undefined;

						try {
							for (var _iterator2 = this.props.x[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
								var _x8 = _step2.value;

								addXLabel(_x8);
							}
						} catch (err) {
							_didIteratorError2 = true;
							_iteratorError2 = err;
						} finally {
							try {
								if (!_iteratorNormalCompletion2 && _iterator2.return) {
									_iterator2.return();
								}
							} finally {
								if (_didIteratorError2) {
									throw _iteratorError2;
								}
							}
						}
					} else {
						for (var _x9 = xLabelOrigin !== 0 ? xLabelOrigin : Math.ceil(xMin / xLabelSpacing) * xLabelSpacing; _x9 <= xMax; _x9 += xLabelSpacing) {
							addXLabel(_x9);
						}
					}

					labels.push(_react2.default.createElement("path", { key: "xll", d: ticksD, stroke: labelColor, strokeWidth: "1" }));
				}

				if (yLabelAtPoint) {
					var labelYOffset = labelSize * -0.5;

					for (var i = 0; i < numYPoints; i += xStep) {
						var _x10 = this.props.x[i];
						var _y = this.props.y[i * yValuesPerX];
						if (!Number.isFinite(_x10) || !Number.isFinite(_y) || _x10 < xMin || _x10 > xMax) {
							continue;
						}

						var _tx2 = transformX(_x10);
						var txFixed = _tx2.toFixed(1);
						var _ty = transformY(_y);

						var text = yLabelFunc(_y, yMin, yMax);
						labels.push(_react2.default.createElement(
							"text",
							{
								key: "ylap" + i,
								x: txFixed,
								y: (labelYOffset - _ty).toFixed(1),
								transform: "scale(1,-1)",
								textAnchor: "middle",
								fill: yColor
							},
							text
						));
					}
				}

				if (y2LabelAtPoint) {
					var _labelYOffset = labelSize * -0.5;

					for (var _i = 0; _i < numYPoints; _i += xStep) {
						var _x11 = this.props.x[_i];
						var y2 = this.props.y2[_i * y2ValuesPerX];
						if (!Number.isFinite(_x11) || !Number.isFinite(y2) || _x11 < xMin || _x11 > xMax) {
							continue;
						}

						var _tx3 = transformX(_x11);
						var _txFixed = _tx3.toFixed(1);
						var ty2 = transformY2(y2);

						var _text = y2LabelFunc(y2, y2Min, y2Max);
						labels.push(_react2.default.createElement(
							"text",
							{
								key: "y2lap" + _i,
								x: _txFixed,
								y: (_labelYOffset - ty2).toFixed(1),
								transform: "scale(1,-1)",
								textAnchor: "middle",
								fill: y2Color
							},
							_text
						));
					}
				}

				if (hasLeftYLabels) {
					var _ticksD = "";
					var tickX = (axisXOffset - textHeight * 0.2).toFixed(1);
					var _labelYOffset2 = labelSize * 0.3;
					var _start2 = yLabelOrigin !== 0 ? yLabelOrigin : Math.ceil(yMin / yLabelSpacing) * yLabelSpacing;
					for (var _y2 = _start2; _y2 <= yMax; _y2 += yLabelSpacing) {
						if (_y2 >= yMin) {
							var _ty2 = transformY(_y2);
							_ticksD += "M" + tickX + " " + _ty2.toFixed(1) + "H" + axisXOffsetFixed;
							labels.push(_react2.default.createElement(
								"text",
								{
									key: "ylt" + _y2,
									x: tickX,
									y: (_labelYOffset2 - _ty2).toFixed(1),
									transform: "scale(1,-1)",
									textAnchor: "end",
									fill: yLabelColor
								},
								yLabelFunc(_y2, yMin, yMax)
							));
						}
					}

					labels.push(_react2.default.createElement("path", { key: "yll", d: _ticksD, stroke: yLabelColor, strokeWidth: "1" }));
				}
				if (hasRightYLabels) {
					var _ticksD2 = "";
					var _tickX = (rightAxisX + textHeight * 0.2).toFixed(1);
					var _labelYOffset3 = labelSize * 0.3;
					var _start3 = y2LabelOrigin !== 0 ? y2LabelOrigin : Math.ceil(y2Min / y2LabelSpacing) * y2LabelSpacing;
					for (var _y3 = _start3; _y3 <= y2Max; _y3 += y2LabelSpacing) {
						if (_y3 >= y2Min) {
							var _ty3 = transformY2(_y3);
							_ticksD2 += "M" + rightAxisXFixed + " " + _ty3.toFixed(1) + "H" + _tickX;
							labels.push(_react2.default.createElement(
								"text",
								{
									key: "y2lt" + _y3,
									x: _tickX,
									y: (_labelYOffset3 - _ty3).toFixed(1),
									transform: "scale(1,-1)",
									fill: y2LabelColor
								},
								y2LabelFunc(_y3, y2Min, y2Max)
							));
						}
					}

					labels.push(_react2.default.createElement("path", { key: "y2ll", d: _ticksD2, stroke: y2LabelColor, strokeWidth: "1" }));
				}

				if (yAxisTitle) {
					labels.push(_react2.default.createElement(
						"text",
						{
							key: "yAxisTitle",
							x: axisXOffset.toFixed(1),
							y: (-rangeTop - labelSize).toFixed(1),
							textAnchor: "middle",
							transform: "scale(1,-1)",
							fill: yColor
						},
						yAxisTitle
					));
				}

				if (y2AxisTitle) {
					labels.push(_react2.default.createElement(
						"text",
						{
							key: "y2AxisTitle",
							x: rightAxisX.toFixed(1),
							y: (-rangeTop - labelSize).toFixed(1),
							textAnchor: "middle",
							transform: "scale(1,-1)",
							fill: y2LabelColor
						},
						y2AxisTitle
					));
				}

				////////////////////////////////////////////////////////////////////////////////
				// y data series graphics:

				var bars = [];

				var yPoints = "";
				if (yBars) {
					// draw y values as bars
					var barWidth = yBars / yValuesPerX;
					var yZero = transformY(0);
					var moveLeft = void 0;
					if (!y2Bars && !y3Bars) {
						moveLeft = yBars * 0.5;
					} else if (y2Bars && y3Bars) {
						moveLeft = yBars + y2Bars * 0.5;
					} else {
						moveLeft = yBars;
					}
					for (var _i2 = 0; _i2 < numYPoints; _i2 += xStep) {
						for (var j = 0; j < yValuesPerX; j++) {
							var _x12 = this.props.x[_i2];
							var _y4 = this.props.y[_i2 * yValuesPerX + j];
							if (Number.isFinite(_x12) && Number.isFinite(_y4)) {
								_x12 = transformX(_x12) - moveLeft + j * barWidth;
								_y4 = transformY(_y4);
								var h = _y4 - yZero;
								if (h < 0) {
									h = -h;
								} else {
									_y4 = yZero;
								}
								var key = "yBar" + _i2;
								if (j > 0) {
									key += "_" + j;
								}
								bars.push(_react2.default.createElement("rect", { key: key, x: _x12.toFixed(1), y: _y4.toFixed(1), width: barWidth, height: h.toFixed(1), stroke: "none", fill: yColor, fillOpacity: yOpacity }));
							}
						}
					}
				} else {
					// draw y values as line-strip
					for (var _i3 = 0; _i3 < numYPoints; _i3 += xStep) {
						var _x13 = this.props.x[_i3];
						var _y5 = this.props.y[_i3 * yValuesPerX];
						if (Number.isFinite(_x13) && Number.isFinite(_y5)) {
							yPoints += transformX(_x13).toFixed(1) + "," + transformY(_y5).toFixed(1) + " ";
						}
					}
					if (xStep > 1) {
						// if we are stepping over values, make sure to add the last one
						var _i4 = numYPoints - 1;
						var _x14 = this.props.x[_i4];
						var _y6 = this.props.y[_i4 * yValuesPerX];
						if (Number.isFinite(_x14) && Number.isFinite(_y6)) {
							yPoints += transformX(_x14).toFixed(1) + "," + transformY(_y6).toFixed(1) + " ";
						}
					}
				}

				var selectedMarker = null;
				var hasSelectedMarker = !!this.props.selectedMarkerSize && selectedIndex >= 0 && selectedIndex < numYPoints;
				if (hasSelectedMarker) {
					var _i5 = selectedIndex;
					var _x15 = this.props.x[_i5];
					var _y7 = this.props.y[_i5 * yValuesPerX];
					if (Number.isFinite(_x15) && Number.isFinite(_y7)) {
						selectedMarker = _react2.default.createElement("circle", {
							cx: transformX(_x15).toFixed(1),
							cy: transformY(_y7).toFixed(1),
							r: this.props.selectedMarkerSize * 0.5,
							stroke: "none",
							fill: this.props.selectedMarkerColor,
							onClick: this.props.onClickMarker ? this.onClickMarker : null,
							"data-index": _i5,
							"data-x": _x15,
							"data-y": _y7,
							"data-selected": true
						});
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// y2 data series graphics:

				var numY2Points = 0;
				var y2Points = "";
				if (this.props.y2) {
					numY2Points = Math.min(this.props.x.length, this.props.y2.length / y2ValuesPerX);
					if (y2Bars) {
						var _barWidth = y2Bars / y2ValuesPerX;
						var y2Zero = transformY2(0);
						var _moveLeft = void 0;
						if (yBars && !y3Bars) {
							_moveLeft = 0;
						} else if (!yBars && y3Bars) {
							_moveLeft = y2Bars;
						} else {
							_moveLeft = y2Bars * 0.5;
						}
						for (var _i6 = 0; _i6 < numY2Points; _i6 += xStep) {
							for (var _j = 0; _j < y2ValuesPerX; _j++) {
								var _x16 = this.props.x[_i6];
								var _y8 = this.props.y2[_i6 * y2ValuesPerX + _j];
								if (Number.isFinite(_x16) && Number.isFinite(_y8)) {
									_x16 = transformX(_x16) - _moveLeft + _j * _barWidth;
									_y8 = transformY2(_y8);
									var _h = _y8 - y2Zero;
									if (_h < 0) {
										_h = -_h;
									} else {
										_y8 = y2Zero;
									}
									var _key2 = "y2Bar" + _i6;
									if (_j > 0) {
										_key2 += "_" + _j;
									}
									bars.push(_react2.default.createElement("rect", { key: _key2, x: _x16.toFixed(1), y: _y8.toFixed(1), width: _barWidth, height: _h.toFixed(1), stroke: "none", fill: y2Color, fillOpacity: y2Opacity }));
								}
							}
						}
					} else {
						for (var _i7 = 0; _i7 < numY2Points; _i7 += xStep) {
							var _x17 = this.props.x[_i7];
							var _y9 = this.props.y2[_i7 * y2ValuesPerX];
							if (Number.isFinite(_x17) && Number.isFinite(_y9)) {
								y2Points += " " + transformX(_x17).toFixed(1) + "," + transformY2(_y9).toFixed(1);
							}
						}
						if (xStep > 1) {
							var _i8 = numY2Points - 1;
							var _x18 = this.props.x[_i8];
							var _y10 = this.props.y2[_i8 * y2ValuesPerX];
							if (Number.isFinite(_x18) && Number.isFinite(_y10)) {
								y2Points += " " + transformX(_x18).toFixed(1) + "," + transformY2(_y10).toFixed(1);
							}
						}
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// y3 data series graphics:

				var numY3Points = 0;
				var y3Points = "";
				if (this.props.y3) {
					numY3Points = Math.min(this.props.x.length, this.props.y3.length / y3ValuesPerX);
					if (y3Bars) {
						var _barWidth2 = y3Bars / y3ValuesPerX;
						var y3Zero = transformY3(0);
						var _moveLeft2 = void 0;
						if (!yBars && !y3Bars) {
							_moveLeft2 = y3Bars * 0.5;
						} else if (yBars && y3Bars) {
							_moveLeft2 = y2Bars * -0.5;
						} else {
							_moveLeft2 = 0;
						}
						for (var _i9 = 0; _i9 < numY3Points; _i9 += xStep) {
							for (var _j2 = 0; _j2 < y3ValuesPerX; _j2++) {
								var _x19 = this.props.x[_i9];
								var y3 = this.props.y3[_i9 * y3ValuesPerX + _j2];
								if (Number.isFinite(_x19) && Number.isFinite(y3)) {
									_x19 = transformX(_x19) - _moveLeft2 + _j2 * _barWidth2;
									y3 = transformY3(y3);
									var _h2 = y3 - y3Zero;
									if (_h2 < 0) {
										_h2 = -_h2;
									} else {
										y3 = y3Zero;
									}
									var _key3 = "y3Bar" + _i9;
									if (_j2 > 0) {
										_key3 += "_" + _j2;
									}
									bars.push(_react2.default.createElement("rect", { key: _key3, x: _x19.toFixed(1), y: y3.toFixed(1), width: _barWidth2, height: _h2.toFixed(1), stroke: "none", fill: y3Color, fillOpacity: y3Opacity }));
								}
							}
						}
					} else {
						for (var _i10 = 0; _i10 < numY3Points; _i10 += xStep) {
							var _x20 = this.props.x[_i10];
							var _y11 = this.props.y3[_i10 * y3ValuesPerX];
							if (Number.isFinite(_x20) && Number.isFinite(_y11)) {
								y3Points += " " + transformX(_x20).toFixed(1) + "," + transformY3(_y11).toFixed(1);
							}
						}
						if (xStep > 1) {
							var _i11 = numY3Points - 1;
							var _x21 = this.props.x[_i11];
							var _y12 = this.props.y3[_i11 * y3ValuesPerX];
							if (Number.isFinite(_x21) && Number.isFinite(_y12)) {
								y3Points += " " + transformX(_x21).toFixed(1) + "," + transformY3(_y12).toFixed(1);
							}
						}
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// y4 data series graphics:

				var numY4Points = 0;
				var y4Points = "";
				if (this.props.y4) {
					numY4Points = Math.min(this.props.x.length, this.props.y4.length);
					for (var _i12 = 0; _i12 < numY4Points; _i12 += xStep) {
						var _x22 = this.props.x[_i12];
						var y4 = this.props.y4[_i12];
						if (Number.isFinite(_x22) && Number.isFinite(y4)) {
							y4Points += " " + transformX(_x22).toFixed(1) + "," + transformY4(y4).toFixed(1);
						}
					}
					if (xStep > 1) {
						var _i13 = numY4Points - 1;
						var _x23 = this.props.x[_i13];
						var _y13 = this.props.y4[_i13];
						if (Number.isFinite(_x23) && Number.isFinite(_y13)) {
							y4Points += " " + transformX(_x23).toFixed(1) + "," + transformY4(_y13).toFixed(1);
						}
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// Markers for data series points:

				var markers = [];
				if (markerSize > 0) {
					var r = markerSize * 0.5;
					var onClick = this.props.onClickMarker ? this.onClickMarker : null;
					for (var _i14 = 0; _i14 < numYPoints; _i14 += xStep) {
						var _x24 = this.props.x[_i14];
						var _y14 = this.props.y[_i14 * yValuesPerX];
						if (Number.isFinite(_x24) && Number.isFinite(_y14) && !(hasSelectedMarker && _i14 === selectedIndex)) {
							markers.push(_react2.default.createElement("circle", {
								key: "marker_" + _i14,
								cx: transformX(_x24).toFixed(1),
								cy: transformY(_y14).toFixed(1),
								r: r,
								stroke: "none",
								fill: yColor,
								onClick: onClick,
								"data-index": _i14,
								"data-x": _x24,
								"data-y": _y14
							}));
						}
					}
				}
				if (markerSize2 > 0) {
					var _r = markerSize2 * 0.5;
					for (var _i15 = 0; _i15 < numY2Points; _i15 += xStep) {
						var _x25 = this.props.x[_i15];
						var _y15 = this.props.y2[_i15 * y2ValuesPerX];
						if (Number.isFinite(_x25) && Number.isFinite(_y15)) {
							markers.push(_react2.default.createElement("circle", {
								key: "marker2_" + _i15,
								cx: transformX(_x25).toFixed(1),
								cy: transformY2(_y15).toFixed(1),
								r: _r,
								stroke: "none",
								fill: y2Color
							}));
						}
					}
				}
				if (markerSize3 > 0) {
					var _r2 = markerSize3 * 0.5;
					for (var _i16 = 0; _i16 < numY3Points; _i16 += xStep) {
						var _x26 = this.props.x[_i16];
						var _y16 = this.props.y3[_i16 * y3ValuesPerX];
						if (Number.isFinite(_x26) && Number.isFinite(_y16)) {
							markers.push(_react2.default.createElement("circle", {
								key: "marker3_" + _i16,
								cx: transformX(_x26).toFixed(1),
								cy: transformY3(_y16).toFixed(1),
								r: _r2,
								stroke: "none",
								fill: y3Color
							}));
						}
					}
				}
				if (markerSize4 > 0) {
					var _r3 = markerSize4 * 0.5;
					for (var _i17 = 0; _i17 < numY4Points; _i17 += xStep) {
						var _x27 = this.props.x[_i17];
						var _y17 = this.props.y4[_i17];
						if (Number.isFinite(_x27) && Number.isFinite(_y17)) {
							markers.push(_react2.default.createElement("circle", {
								key: "marker4_" + _i17,
								cx: transformX(_x27).toFixed(1),
								cy: transformY4(_y17).toFixed(1),
								r: _r3,
								stroke: "none",
								fill: y4Color
							}));
						}
					}
				}
				var _props15 = this.props,
				    extraPointsX = _props15.extraPointsX,
				    extraPointsY = _props15.extraPointsY,
				    extraPointsSize = _props15.extraPointsSize,
				    extraPointsColor = _props15.extraPointsColor;

				if (extraPointsX && extraPointsY && extraPointsSize > 0) {
					var _r4 = extraPointsSize * 0.5;
					var count = Math.min(extraPointsX.length, extraPointsY.length);
					for (var _i18 = 0; _i18 < count; _i18++) {
						var _x28 = extraPointsX[_i18];
						var _y18 = extraPointsY[_i18];
						if (Number.isFinite(_x28) && Number.isFinite(_y18)) {
							markers.push(_react2.default.createElement("circle", {
								key: "extraPoints_" + _i18,
								cx: transformX(_x28).toFixed(1),
								cy: transformY(_y18).toFixed(1),
								r: _r4,
								stroke: "none",
								fill: extraPointsColor
							}));
						}
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// Draw background color based on data series:

				var bg = [];
				if (this.props.bgValues && this.props.bgValues.length > 0 && this.props.bgColorFunc) {
					var numPoints = Math.min(this.props.x.length, this.props.bgValues.length);
					if (numPoints >= 2) {
						var lastX = transformX(this.props.x[0]);
						var lastB = this.props.bgValues[0];
						for (var _i20 = 1; _i20 < numPoints; _i20 += xStep) {
							var b = this.props.bgValues[_i20];
							if (b !== lastB) {
								var _x30 = (transformX(this.props.x[_i20 - 1]) + transformX(this.props.x[_i20])) * 0.5;
								var _width2 = _x30 - lastX;
								bg.push(_react2.default.createElement("rect", { key: "bg" + (_i20 - 1), stroke: "none", fill: this.props.bgColorFunc(lastB), x: lastX.toFixed(1), y: axisYOffsetFixed, width: _width2.toFixed(1), height: rangeHeight.toFixed(1) }));
								lastX = _x30;
								lastB = b;
							}
						}
						var _i19 = numPoints - 1;
						var _x29 = transformX(this.props.x[_i19]);
						var _width = _x29 - lastX;
						bg.push(_react2.default.createElement("rect", { key: "bg" + _i19, stroke: "none", fill: this.props.bgColorFunc(lastB), x: lastX.toFixed(1), y: axisYOffsetFixed, width: _width.toFixed(1), height: rangeHeight.toFixed(1) }));
					}
				}

				////////////////////////////////////////////////////////////////////////////////
				// X range markers left and right:

				// TODO draw markers only when active,
				// but initialize drag interactions when activated after component was mounted

				var leftMarkerX = 0;
				var leftMarkerHeight = 0;
				if (leftMarkerVisible) {
					leftMarkerX = transformX(this.props.leftMarkerX);
					leftMarkerHeight = rangeHeight;
				}

				var rightMarkerX = 0;
				var rightMarkerHeight = 0;
				if (rightMarkerVisible) {
					rightMarkerX = transformX(this.props.rightMarkerX);
					rightMarkerHeight = rangeHeight;
				}

				////////////////////////////////////////////////////////////////////////////////
				// Text in diagram center:

				var centerText = this.props.centerText.length === 0 ? null : _react2.default.createElement(
					"text",
					{
						x: width * 0.5,
						y: height * 0.5,
						textAnchor: "middle",
						fontFamily: this.props.centerTextFont,
						fontSize: this.props.centerTextSize,
						fill: this.props.centerTextColor,
						stroke: "none"
					},
					this.props.centerText
				);

				return _react2.default.createElement(
					"svg",
					{ ref: "parent", width: width, height: height, viewBox: "0 0 " + width + " " + height },
					_react2.default.createElement(
						"defs",
						null,
						_react2.default.createElement(
							"linearGradient",
							{ id: "leftMarkerGradient", x1: "0%", x2: "100%" },
							_react2.default.createElement("stop", { offset: "0%", style: { stopColor: this.props.leftMarkerColor, stopOpacity: 0 } }),
							_react2.default.createElement("stop", { offset: "100%", style: { stopColor: this.props.leftMarkerColor, stopOpacity: 1 } })
						),
						_react2.default.createElement(
							"linearGradient",
							{ id: "rightMarkerGradient", x1: "0%", x2: "100%" },
							_react2.default.createElement("stop", { offset: "0%", style: { stopColor: this.props.rightMarkerColor, stopOpacity: 1 } }),
							_react2.default.createElement("stop", { offset: "100%", style: { stopColor: this.props.rightMarkerColor, stopOpacity: 0 } })
						)
					),
					backgroundColor ? _react2.default.createElement("rect", { fill: backgroundColor, width: "100%", height: "100%" }) : null,
					centerText,
					_react2.default.createElement(
						"g",
						{ transform: "scale(1,-1) translate(0,-" + height + ")", fontFamily: labelFont, fontSize: labelSize },
						bg,
						gridLines,
						_react2.default.createElement("polyline", { stroke: this.props.axisColor, strokeWidth: "1", fill: "none", points: axisPoints }),
						labels,
						bars,
						y4Points.length > 0 ? _react2.default.createElement("polyline", { stroke: y4Color, strokeOpacity: y4Opacity, strokeWidth: this.props.y4LineWidth, strokeDasharray: this.props.y4LineDashes, fill: "none", points: y4Points }) : null,
						y3Points.length > 0 ? _react2.default.createElement("polyline", { stroke: y3Color, strokeOpacity: y3Opacity, strokeWidth: this.props.y3LineWidth, strokeDasharray: this.props.y3LineDashes, fill: "none", points: y3Points }) : null,
						y2Points.length > 0 ? _react2.default.createElement("polyline", { stroke: y2Color, strokeOpacity: y2Opacity, strokeWidth: this.props.y2LineWidth, strokeDasharray: this.props.y2LineDashes, fill: "none", points: y2Points }) : null,
						yPoints.length > 0 ? _react2.default.createElement("polyline", { stroke: yColor, strokeOpacity: yOpacity, strokeWidth: this.props.yLineWidth, strokeDasharray: this.props.yLineDashes, fill: "none", points: yPoints }) : null,
						markers,
						selectedMarker,
						_react2.default.createElement(
							"g",
							{ ref: "leftMarkerGroup" },
							_react2.default.createElement("rect", {
								ref: "leftMarkerCover",
								x: axisXOffsetFixed,
								y: axisYOffsetFixed,
								width: (leftMarkerX - axisXOffset).toFixed(1),
								height: leftMarkerHeight.toFixed(1),
								stroke: "none",
								fill: this.props.leftRightMarkerCoverColor,
								fillOpacity: this.props.leftRightMarkerCoverOpacity
							}),
							_react2.default.createElement("rect", {
								ref: "leftMarker",
								x: leftMarkerX - this.props.leftRightMarkerWidth,
								y: axisYOffset,
								width: this.props.leftRightMarkerWidth,
								height: leftMarkerHeight.toFixed(1),
								stroke: "none",
								fill: "url(#leftMarkerGradient)",
								style: { touchAction: "none" }
							})
						),
						_react2.default.createElement(
							"g",
							{ ref: "rightMarkerGroup" },
							_react2.default.createElement("rect", {
								ref: "rightMarkerCover",
								x: rightMarkerX.toFixed(1),
								y: axisYOffset.toFixed(1),
								width: (rightAxisX - rightMarkerX).toFixed(1),
								height: rightMarkerHeight.toFixed(1),
								stroke: "none",
								fill: this.props.leftRightMarkerCoverColor,
								fillOpacity: this.props.leftRightMarkerCoverOpacity
							}),
							_react2.default.createElement("rect", {
								ref: "rightMarker",
								x: rightMarkerX.toFixed(1),
								y: axisYOffset.toFixed(1),
								width: this.props.leftRightMarkerWidth,
								height: rightMarkerHeight.toFixed(1),
								stroke: "none",
								fill: "url(#rightMarkerGradient)",
								style: { touchAction: "none" }
							})
						)
					)
				);
			}
		}]);

		return XYDiagram;
	}(_react2.default.PureComponent);

	XYDiagram.displayName = "XYDiagram";
	XYDiagram.propTypes = {
		width: _react2.default.PropTypes.number.isRequired,
		height: _react2.default.PropTypes.number.isRequired,
		labelFont: _react2.default.PropTypes.string,
		labelSize: _react2.default.PropTypes.number,
		labelColor: _react2.default.PropTypes.string,
		centerText: _react2.default.PropTypes.string,
		centerTextFont: _react2.default.PropTypes.string,
		centerTextSize: _react2.default.PropTypes.number,
		centerTextColor: _react2.default.PropTypes.string,

		axisColor: _react2.default.PropTypes.string,
		backgroundColor: _react2.default.PropTypes.string,

		leftAxisXOffset: _react2.default.PropTypes.number,
		rightAxisXOffset: _react2.default.PropTypes.number,

		x: _react2.default.PropTypes.array.isRequired,
		xStep: _react2.default.PropTypes.number,
		xMin: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.number, _react2.default.PropTypes.func]),
		xMax: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.number, _react2.default.PropTypes.func]),
		xFactor: _react2.default.PropTypes.number,
		xGridOrigin: _react2.default.PropTypes.number,
		xGridSpacing: _react2.default.PropTypes.number,
		xGridAtPoint: _react2.default.PropTypes.bool,
		xGridColor: _react2.default.PropTypes.string,
		xLabelOrigin: _react2.default.PropTypes.number,
		xLabelSpacing: _react2.default.PropTypes.number,
		xLabelAtPoint: _react2.default.PropTypes.bool,
		xLabelFunc: _react2.default.PropTypes.func,
		xLabelNoOverlapCheck: _react2.default.PropTypes.bool, // overlap checks only work from left to right, disable if points are right to left

		y: _react2.default.PropTypes.array.isRequired,
		yMin: _react2.default.PropTypes.number,
		yMax: _react2.default.PropTypes.number,
		yFactor: _react2.default.PropTypes.number,
		yValuesPerX: _react2.default.PropTypes.number, // show that number of bars per point, y.length == x.length * yValuesPerX
		yColor: _react2.default.PropTypes.string,
		yOpacity: _react2.default.PropTypes.number,
		yLabelColor: _react2.default.PropTypes.string,
		yGridOrigin: _react2.default.PropTypes.number,
		yGridSpacing: _react2.default.PropTypes.number,
		yGridColor: _react2.default.PropTypes.string,
		yLabelOrigin: _react2.default.PropTypes.number,
		yLabelSpacing: _react2.default.PropTypes.number,
		yLabelFunc: _react2.default.PropTypes.func,
		yLabelAtPoint: _react2.default.PropTypes.bool,
		yLineWidth: _react2.default.PropTypes.number,
		yLineDashes: _react2.default.PropTypes.string,
		markerSize: _react2.default.PropTypes.number,
		yBars: _react2.default.PropTypes.number,
		yAxisTitle: _react2.default.PropTypes.string,

		y2: _react2.default.PropTypes.array,
		y2Min: _react2.default.PropTypes.number,
		y2Max: _react2.default.PropTypes.number,
		y2Factor: _react2.default.PropTypes.number,
		y2ValuesPerX: _react2.default.PropTypes.number, // show that number of bars per point, y2.length == x.length * y2ValuesPerX
		y2Color: _react2.default.PropTypes.string,
		y2Opacity: _react2.default.PropTypes.number,
		y2LabelColor: _react2.default.PropTypes.string,
		y2LabelOrigin: _react2.default.PropTypes.number,
		y2LabelSpacing: _react2.default.PropTypes.number,
		y2LabelFunc: _react2.default.PropTypes.func,
		y2LabelAtPoint: _react2.default.PropTypes.bool,
		y2LineWidth: _react2.default.PropTypes.number,
		y2LineDashes: _react2.default.PropTypes.string,
		markerSize2: _react2.default.PropTypes.number,
		y2OnRightAxis: _react2.default.PropTypes.bool,
		y2Bars: _react2.default.PropTypes.number,
		y2AxisTitle: _react2.default.PropTypes.string,

		y3: _react2.default.PropTypes.array,
		y3Min: _react2.default.PropTypes.number,
		y3Max: _react2.default.PropTypes.number,
		y3Factor: _react2.default.PropTypes.number,
		y3ValuesPerX: _react2.default.PropTypes.number, // show that number of bars per point, y3.length == x.length * y3ValuesPerX
		y3Color: _react2.default.PropTypes.string,
		y3Opacity: _react2.default.PropTypes.number,
		y3LabelOrigin: _react2.default.PropTypes.number,
		y3LabelSpacing: _react2.default.PropTypes.number,
		y3LabelFunc: _react2.default.PropTypes.func,
		y3LineWidth: _react2.default.PropTypes.number,
		y3LineDashes: _react2.default.PropTypes.string,
		markerSize3: _react2.default.PropTypes.number,
		y3Bars: _react2.default.PropTypes.number,

		y4: _react2.default.PropTypes.array,
		y4Min: _react2.default.PropTypes.number,
		y4Max: _react2.default.PropTypes.number,
		y4Factor: _react2.default.PropTypes.number,
		y4Color: _react2.default.PropTypes.string,
		y4Opacity: _react2.default.PropTypes.number,
		y4LabelOrigin: _react2.default.PropTypes.number,
		y4LabelSpacing: _react2.default.PropTypes.number,
		y4LabelFunc: _react2.default.PropTypes.func,
		y4LineWidth: _react2.default.PropTypes.number,
		y4LineDashes: _react2.default.PropTypes.string,
		markerSize4: _react2.default.PropTypes.number,

		bgValues: _react2.default.PropTypes.array,
		bgColorFunc: _react2.default.PropTypes.func,

		onClickMarker: _react2.default.PropTypes.func,
		selectedIndex: _react2.default.PropTypes.number,
		selectedMarkerSize: _react2.default.PropTypes.number,
		selectedMarkerColor: _react2.default.PropTypes.string,
		leftMarkerX: _react2.default.PropTypes.number,
		leftMarkerColor: _react2.default.PropTypes.string,
		leftMarkerDragged: _react2.default.PropTypes.func,
		rightMarkerX: _react2.default.PropTypes.number,
		rightMarkerColor: _react2.default.PropTypes.string,
		rightMarkerDragged: _react2.default.PropTypes.func,
		leftRightMarkerCoverColor: _react2.default.PropTypes.string,
		leftRightMarkerCoverOpacity: _react2.default.PropTypes.number,
		leftRightMarkerWidth: _react2.default.PropTypes.number,

		extraPointsX: _react2.default.PropTypes.array,
		extraPointsY: _react2.default.PropTypes.array,
		extraPointsSize: _react2.default.PropTypes.number,
		extraPointsColor: _react2.default.PropTypes.string
	};
	XYDiagram.defaultProps = {
		labelFont: "\"Lucida Console\", Monaco, monospace",
		labelSize: 16,
		labelColor: "#000",
		centerText: "",
		centerTextFont: "\"Lucida Console\", Monaco, monospace",
		centerTextSize: 48,
		centerTextColor: "#000",
		axisColor: "#000",
		backgroundColor: "#FFF",

		xStep: 1,
		xMin: 0,
		xMax: 1,
		xFactor: 1,
		xGridOrigin: 0,
		xGridAtPoint: false,
		xGridColor: "#AAA",
		xLabelOrigin: 0,
		xLabelAtPoint: false,
		xLabelFunc: defaultLabelFunc,
		xLabelNoOverlapCheck: false,

		yMin: 0,
		yMax: 1,
		yFactor: 1,
		yValuesPerX: 1,
		yColor: "#0082C8",
		yOpacity: 1,
		yGridOrigin: 0,
		yGridColor: "#AAA",
		yLabelOrigin: 0,
		yLabelFunc: defaultLabelFunc,
		yLabelAtPoint: false,
		yLineWidth: 1,
		markerSize: 0,
		yBars: 0,

		y2Min: 0,
		y2Max: 1,
		y2Factor: 1,
		y2ValuesPerX: 1,
		y2Color: "#92D050",
		y2Opacity: 1,
		y2LabelOrigin: 0,
		y2LabelFunc: defaultLabelFunc,
		y2LabelAtPoint: false,
		y2LineWidth: 1,
		markerSize2: 0,
		y2OnRightAxis: false,
		y2Bars: 0,

		y3Min: 0,
		y3Max: 1,
		y3Factor: 1,
		y3ValuesPerX: 1,
		y3Color: "#FF00FF",
		y3Opacity: 1,
		y3LabelOrigin: 0,
		y3LabelFunc: defaultLabelFunc,
		y3LineWidth: 1,
		markerSize3: 0,
		y3Bars: 0,

		y4Min: 0,
		y4Max: 1,
		y4Factor: 1,
		y4Color: "#647280",
		y4Opacity: 1,
		y4LabelOrigin: 0,
		y4LabelFunc: defaultLabelFunc,
		y4LineWidth: 1,
		markerSize4: 0,

		selectedIndex: -1,
		selectedMarkerSize: 0,
		selectedMarkerColor: "#0082C8",
		leftMarkerX: NaN,
		leftMarkerColor: "#11F",
		rightMarkerX: NaN,
		rightMarkerColor: "#11F",
		leftRightMarkerCoverColor: "#666",
		leftRightMarkerCoverOpacity: 0.5,
		leftRightMarkerWidth: 16,

		extraPointsSize: 5,
		extraPointsColor: "#F00"
	};
	exports.default = XYDiagram;
});
(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "./XYDiagram"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("./XYDiagram"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.XYDiagram);
    global.index = mod.exports;
  }
})(this, function (exports, _XYDiagram) {
  "use strict";

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  Object.defineProperty(exports, "XYDiagram", {
    enumerable: true,
    get: function () {
      return _interopRequireDefault(_XYDiagram).default;
    }
  });

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }
});

//# sourceMappingURL=index.umd.js.map


text:
                    {{ with .Site.Params.navigation.brand }}{{ . | markdownify }}{{ end }}

                    {{ range .Site.Menus.prepend }}

{{ .Name | markdownify }}

                    {{ end }}

{{ with .Site.Params.navigation.home }}{{ . | markdownify }}{{ end }}

                    {{ if .Site.Params.work.enable }}

{{ with .Site.Params.navigation.work }}{{ . | markdownify }}{{ end }}

                    {{ end }}

                    {{ if .Site.Params.testimonials.enable }}

{{ with .Site.Params.navigation.testimonials }}{{ . | markdownify }}{{ end }}

                    {{ end }}

                    {{ if .Site.Params.services.enable }}

{{ with .Site.Params.navigation.services }}{{ . | markdownify }}{{ end }}

                    {{ end }}

                    {{ if .Site.Params.about.enable }}

{{ with .Site.Params.navigation.about }}{{ . | markdownify }}{{ end }}

                    {{ end }}

                    {{ if .Site.Params.contact.enable }}

{{ with .Site.Params.navigation.contact }}{{ . | markdownify }}{{ end }}

                    {{ end }}

                    {{ range .Site.Menus.postpend }}

{{ .Name | markdownify }}

                    {{ end }}

redpajama_set_name: RedPajamaGithub


text:
<?php

class DBManagerTest extends PHPUnit_Framework_TestCase {

	/**
	 * @covers DBManager::getConnections
	 */
	public function testGetConnections() {
		$connections = DBManager::getConnections();
		$this->assertInternalType('array', $connections);
		foreach ($connections as $connection) {
			$this->assertInstanceOf('DABLPDO', $connection);
		}
	}

	/**
	 * @covers DBManager::getConnectionNames
	 */
	public function testGetConnectionNames() {
		$connection_names = DBManager::getConnectionNames();
		$this->assertInternalType('array', $connection_names);
		foreach ($connection_names as $connection_name) {
			$this->assertInternalType('string', $connection_name);
		}
	}

	/**
	 * @covers DBManager::getConnection
	 */
	public function testGetConnectionNoArgument() {
		$connection = DBManager::getConnection();

		$this->assertInstanceOf('DABLPDO', $connection);

		$connections = DBManager::getConnections();

		// verify that $connection is the first connection
		$this->assertEquals(array_shift($connections), $connection);
	}

	/**
	 * @covers DBManager::addConnection
	 * @todo Implement testAddConnection().
	 */
	public function testAddConnection() {
		// Remove the following lines when you implement this test.
		$this->markTestIncomplete(
				'This test has not been implemented yet.'
		);
	}

	/**
	 * @covers DBManager::getParameter
	 * @todo Implement testGetParameter().
	 */
	public function testGetParameter() {
		// Remove the following lines when you implement this test.
		$this->markTestIncomplete(
				'This test has not been implemented yet.'
		);
	}

	/**
	 * @covers DBManager::disconnect
	 * @todo Implement testDisconnect().
	 */
	public function testDisconnect() {
		// Remove the following lines when you implement this test.
		$this->markTestIncomplete(
				'This test has not been implemented yet.'
		);
	}

}


text:
package org.ankus.mapreduce.algorithms.statistics.numericstats;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

/**
 * NumericStats2MRMergeMapper
 * @desc 2nd mapper class for numeric statistics computation mr job (2-step)
 * @version 0.0.1
 * @date : 2013.08.21
 * @author Moonie
 */
public class NumericStats2MRMergeMapper extends Mapper<Object, Text, Text, Text>{

    @Override
    protected void setup(Context context) throws IOException, InterruptedException
    {
    }

	@Override
	protected void map(Object key, Text value, Context context) throws IOException, InterruptedException
	{
		String valueStr = value.toString();

        // TODO 딜리미터 변수값으로 수정
		int splitIndex = valueStr.indexOf("\t");

		String keyStr = valueStr.substring(0, splitIndex);
		keyStr = keyStr.substring(0, keyStr.indexOf("_"));

		valueStr = valueStr.substring(splitIndex + 1);
		context.write(new Text(keyStr), new Text(valueStr));
	}

    @Override
    protected void cleanup(Context context)
            throws IOException, InterruptedException
    {

    }

}


text:
suite('recur_expansion', function() {
  var component;
  var subject;
  var icsData = {};
  var primary;

  function createSubject(file) {

    testSupport.defineSample(file, function(data) {
      icsData[file] = data;
    });

    setup(function(done) {
      var exceptions = [];

      var parse = new ICAL.ComponentParser();

      parse.onevent = function(event) {
        if (event.isRecurrenceException()) {
          exceptions.push(event);
        } else {
          primary = event;
        }
      };

      parse.oncomplete = function() {
        exceptions.forEach(primary.relateException, primary);
        subject = new ICAL.RecurExpansion({
          component: primary.component,
          dtstart: primary.startDate
        });

        done();
      }

      parse.process(icsData[file]);
    });
  }

  createSubject('recur_instances.ics');

  test('initialization', function() {
    assert.deepEqual(
      new Date(2012, 9, 2, 10),
      subject.last.toJSDate()
    );

    assert.instanceOf(subject.ruleIterators, Array);
    assert.ok(subject.exDates);
  });

  suite('#_ensureRules', function() {
    test('.ruleDates', function() {
      var expected = [
        new Date(2012, 10, 5, 10),
        new Date(2012, 10, 10, 10),
        new Date(2012, 10, 30, 10)
      ];

      var dates = subject.ruleDates.map(function(time) {
        return time.toJSDate();
      });

      assert.deepEqual(expected, dates);
    });

    test('.exDates', function() {
      var expected = [
        new Date(2012, 11, 4, 10),
        new Date(2013, 1, 5, 10),
        new Date(2013, 3, 2, 10)
      ];

      var dates = subject.exDates.map(function(time) {
        return time.toJSDate();
      });

      assert.deepEqual(expected, dates);
    });
  });

  suite('#_nextRecurrenceIter', function() {
    var component;

    setup(function() {
      // setup a clean component with no rules
      component = primary.component.toJSON();
      component = new ICAL.Component(component);

      // Simulate a more complicated event by using
      // the original as a base and adding more complex rrule's
      component.removeProperty('rrule');
    });

    test('when rule ends', function() {
      var start = {
        year: 2012,
        month: 1,
        day: 1
      };

      component.removeAllProperties('rdate');
      component.removeAllProperties('exdate');
      component.addPropertyWithValue('rrule', { freq: "WEEKLY", count: 3, byday: ["SU"] });

      var subject = new ICAL.RecurExpansion({
        component: component,
        dtstart: start
      });

      var expected = [
        new Date(2012, 0, 1),
        new Date(2012, 0, 8),
        new Date(2012, 0, 15)
      ];

      var max = 10;
      var i = 0;
      var next;
      var dates = [];

      while (i++ <= max && (next = subject.next())) {
        dates.push(next.toJSDate());
      }

      assert.deepEqual(dates, expected);
    });

    test('multiple rules', function() {
      component.addPropertyWithValue('rrule', { freq: "MONTHLY", bymonthday: [13] });
      component.addPropertyWithValue('rrule', { freq: "WEEKLY", byday: ["TH"] });

      var start = ICAL.Time.fromData({
        year: 2012,
        month: 2,
        day: 2
      });

      var subject = new ICAL.RecurExpansion({
        component: component,
        dtstart: start
      });

      var expected = [
        new Date(2012, 1, 2),
        new Date(2012, 1, 9),
        new Date(2012, 1, 13),
        new Date(2012, 1, 16),
        new Date(2012, 1, 23)
      ];

      var inc = 0;
      var max = expected.length;
      var next;
      var dates = [];

      while (inc++ < max) {
        next = subject._nextRecurrenceIter();
        dates.push(next.last.toJSDate());
        next.next();
      }

      assert.deepEqual(dates, expected);
    });

  });

  suite('#next', function() {
    // I use JS dates widely because its much easier
    // to compare them via chai's deepEquals function
    var expected = [
      new Date(2012, 9, 2, 10),
      new Date(2012, 10, 5, 10),
      new Date(2012, 10, 6, 10),
      new Date(2012, 10, 10, 10),
      new Date(2012, 10, 30, 10),
      new Date(2013, 0, 1, 10)
    ];

    test('6 items', function() {
      var dates = [];
      var max = 6;
      var inc = 0;
      var next;

      while (inc++ < max && (next = subject.next())) {
        dates.push(next.toJSDate());
      }

      assert.deepEqual(
        dates,
        expected
      );
    });
  });

  suite('#next - finite', function() {
    createSubject('recur_instances_finite.ics');

    test('until complete', function() {
      var max = 100;
      var inc = 0;
      var next;

      var dates = [];
      var expected = [
        new Date(2012, 9, 2, 10),
        new Date(2012, 10, 5, 10),
        new Date(2012, 10, 6, 10),
        new Date(2012, 10, 10, 10),
        new Date(2012, 11, 4, 10)
      ];

      while (inc++ < max && (next = subject.next())) {
        dates.push(next.toJSDate());
      }

      // round trip
      subject = new ICAL.RecurExpansion(subject.toJSON());

      while (inc++ < max && (next = subject.next())) {
        dates.push(next.toJSDate());
      }

      assert.deepEqual(dates, expected);
      assert.isTrue(subject.complete, 'complete');
    });
  });

  suite('#toJSON', function() {
    test('from start', function() {
      var json = subject.toJSON();
      var newIter = new ICAL.RecurExpansion(json);
      var cur = 0;

      while (cur++ < 10) {
        assert.deepEqual(
          subject.next().toJSDate(),
          newIter.next().toJSDate(),
          'failed compare at #' + cur
        );
      }
    });

    test('from two iterations', function() {
      subject.next();
      subject.next();

      var json = subject.toJSON();
      var newIter = new ICAL.RecurExpansion(json);
      var cur = 0;

      while (cur++ < 10) {
        assert.deepEqual(
          subject.next().toJSDate(),
          newIter.next().toJSDate(),
          'failed compare at #' + cur
        );
      }
    });

  });

  suite('event without recurrences', function() {
    createSubject('minimal.ics');

    test('iterate', function() {
      var dates = [];
      var next;

      var expected = primary.startDate.toJSDate();

      while ((next = subject.next())) {
        dates.push(next.toJSDate());
      }

      assert.deepEqual(dates[0], expected);
      assert.length(dates, 1);
      assert.isTrue(subject.complete);

      // json check
      subject = new ICAL.RecurExpansion(
        subject.toJSON()
      );

      assert.isTrue(subject.complete, 'complete after json');
      assert.ok(!subject.next(), 'next value');
    });

  });

});


text:
var sourceArray = [];
var groupArray = [];

function importValues(){
    var lValue = $('#txtInput').val();
    var aValues = lValue.split(/\n/);
    var returnText = '';

    // console.log("a length: " + aValues.length);

    var currentItem = -1;
    for (var i = 0; i < aValues.length; i++) {

        if (aValues[i].substring(0,1) == "*"){
            groupArray.push([aValues[i].substring(1)]);
        } else {
            groupArray[groupArray.length-1].push(aValues[i]);
        }
    };

    console.log(groupArray);

    GenerateQuestion();
    GenerateAnswers();

}

var answerItem = -1;
var answerText = '';

function GenerateQuestion(){

    var selectedGroup = Math.floor(Math.random() * groupArray.length);
    var selectedItem = Math.floor(Math.random() * (groupArray[selectedGroup].length-1));

    console.log(groupArray[selectedGroup][selectedItem + 1]);

    answerItem = selectedGroup;
    answerText = groupArray[selectedGroup][selectedItem + 1];
    $('#questionArea').html(answerText);
}

function GenerateAnswers(){
    for (var i = 0; i < groupArray.length; i++) {
        $('#answerArea').append('
' + groupArray[i][0] + '
');
    };

    $('.answerItem').click(function(){

        var res = /\d{1,}/.exec(this.id)[0];
        if (answerItem == parseInt(res)){
            //console.log('correct:' + res);
            $('#answerItem' + answerItem).append(
                '
' + answerText + '
');
            GenerateQuestion();
        } else {
            $('#questionArea').effect('shake');
        }
    });

}


text:
describe ("My calculator", function() {

    it("should be able to deal with strings", function() {
        expect(function()
        {checkNum("hello")}).toThrow(new Error("show fonzie"));
    })

})


text:
#ifndef __CONFIG_H
#define __CONFIG_H

/*
 * SoC must be defined first, before hardware.h is included.
 * In this case SoC is defined in boards.cfg.
 */
#include <asm/hardware.h>

#define CONFIG_PM9G45		1	/* It's an Ronetix PM9G45 */
#define CONFIG_SYS_AT91_CPU_NAME	"AT91SAM9G45"

#define MACH_TYPE_PM9G45	2672
#define CONFIG_MACH_TYPE	MACH_TYPE_PM9G45

/* ARM asynchronous clock */
#define CONFIG_SYS_AT91_MAIN_CLOCK	12000000 /* from 12 MHz crystal */
#define CONFIG_SYS_AT91_SLOW_CLOCK	32768		/* slow clock xtal */
#define CONFIG_SYS_TEXT_BASE		0x73f00000

#define CONFIG_ARCH_CPU_INIT

#define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_INITRD_TAG	1

#define CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_BOARD_EARLY_INIT_F

/*
 * Hardware drivers
 */
#define CONFIG_AT91_GPIO	1
#define CONFIG_ATMEL_USART	1
#define CONFIG_USART_BASE		ATMEL_BASE_DBGU
#define	CONFIG_USART_ID			ATMEL_ID_SYS

#define CONFIG_SYS_USE_NANDFLASH	1

/* LED */
#define CONFIG_AT91_LED
#define CONFIG_RED_LED		GPIO_PIN_PD(31) /* this is the user1 led */
#define CONFIG_GREEN_LED	GPIO_PIN_PD(0)  /* this is the user2 led */

#define CONFIG_BOOTDELAY	3

/*
 * BOOTP options
 */
#define CONFIG_BOOTP_BOOTFILESIZE	1
#define CONFIG_BOOTP_BOOTPATH		1
#define CONFIG_BOOTP_GATEWAY		1
#define CONFIG_BOOTP_HOSTNAME		1

/*
 * Command line configuration.
 */
#include <config_cmd_default.h>
#undef CONFIG_CMD_FPGA
#undef CONFIG_CMD_IMLS

#define CONFIG_CMD_CACHE
#define CONFIG_CMD_PING		1
#define CONFIG_CMD_DHCP		1
#define CONFIG_CMD_NAND		1
#define CONFIG_CMD_USB		1

#define CONFIG_CMD_JFFS2		1
#define CONFIG_JFFS2_CMDLINE		1
#define CONFIG_JFFS2_NAND		1
#define CONFIG_JFFS2_DEV		"nand0" /* NAND dev jffs2 lives on */
#define CONFIG_JFFS2_PART_OFFSET	0	/* start of jffs2 partition */
#define CONFIG_JFFS2_PART_SIZE		(256 * 1024 * 1024) /* partition */

/* SDRAM */
#define CONFIG_NR_DRAM_BANKS		1
#define PHYS_SDRAM			0x70000000
#define PHYS_SDRAM_SIZE			0x08000000	/* 128 megs */

/* NOR flash, not available */
#define CONFIG_SYS_NO_FLASH		1
#undef CONFIG_CMD_FLASH

/* NAND flash */
#ifdef CONFIG_CMD_NAND
#define CONFIG_NAND_ATMEL
#define CONFIG_SYS_MAX_NAND_DEVICE	1
#define CONFIG_SYS_NAND_BASE		0x40000000
#define CONFIG_SYS_NAND_DBW_8		1
/* our ALE is AD21 */
#define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
/* our CLE is AD22 */
#define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
#define CONFIG_SYS_NAND_ENABLE_PIN	GPIO_PIN_PC(14)
#define CONFIG_SYS_NAND_READY_PIN	GPIO_PIN_PD(3)

#endif

/* Ethernet */
#define CONFIG_MACB			1
#define CONFIG_RMII			1
#define CONFIG_NET_RETRY_COUNT		20
#define CONFIG_RESET_PHY_R		1

/* USB */
#define CONFIG_USB_ATMEL
#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
#define CONFIG_USB_OHCI_NEW		1
#define CONFIG_DOS_PARTITION		1
#define CONFIG_SYS_USB_OHCI_CPU_INIT	1
#define CONFIG_SYS_USB_OHCI_REGS_BASE	0x00700000 /* _UHP_OHCI_BASE */
#define CONFIG_SYS_USB_OHCI_SLOT_NAME	"at91sam9g45"
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
#define CONFIG_USB_STORAGE		1

/* board specific(not enough SRAM) */
#define CONFIG_AT91SAM9G45_LCD_BASE	PHYS_SDRAM + 0xE00000

#define CONFIG_SYS_LOAD_ADDR		PHYS_SDRAM + 0x2000000 /* load addr */

#define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM
#define CONFIG_SYS_MEMTEST_END		CONFIG_AT91SAM9G45_LCD_BASE

/* bootstrap + u-boot + env + linux in nandflash */
#define CONFIG_ENV_IS_IN_NAND		1
#define CONFIG_ENV_OFFSET		0x60000
#define CONFIG_ENV_OFFSET_REDUND	0x80000
#define CONFIG_ENV_SIZE			0x20000		/* 1 sector = 128 kB */
#define CONFIG_BOOTCOMMAND	"nand read 0x72000000 0x200000 0x200000; bootm"
#define CONFIG_BOOTARGS		"fbcon=rotate:3 console=tty0 " \
				"console=ttyS0,115200 " \
				"root=/dev/mtdblock4 " \
				"mtdparts=atmel_nand:128k(bootstrap)ro," \
				"256k(uboot)ro,1664k(env)," \
				"2M(linux)ro,-(root) rw " \
				"rootfstype=jffs2"

#define CONFIG_BAUDRATE			115200

#define CONFIG_SYS_PROMPT		"U-Boot> "
#define CONFIG_SYS_CBSIZE		256
#define CONFIG_SYS_MAXARGS		16
#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
					sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_SYS_LONGHELP		1
#define CONFIG_CMDLINE_EDITING		1
#define CONFIG_AUTO_COMPLETE
#define CONFIG_SYS_HUSH_PARSER

/*
 * Size of malloc() pool
 */
#define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024,\
					0x1000)

#define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM
#define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_SDRAM_BASE + 0x1000 - \
				GENERATED_GBL_DATA_SIZE)

#endif


text:
package ChatBubble;

import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.effect.DropShadow;
import javafx.scene.paint.Color;
import javafx.scene.shape.Shape;

public class BubbledLabel extends Label {

	private BubbleSpec bs = BubbleSpec.FACE_LEFT_CENTER;
	private double pading = 5.0;
	private boolean systemCall = false;

	public BubbledLabel() {
		super();
		init();
	}

	public BubbledLabel(String arg0, Node arg1) {
		super(arg0, arg1);
		init();
	}

	public BubbledLabel(String arg0) {
		super(arg0);
		init();
	}

	public BubbledLabel(BubbleSpec bubbleSpec) {
		super();
		this.bs = bubbleSpec;
		init();
	}

	public BubbledLabel(String arg0, Node arg1,BubbleSpec bubbleSpec) {
		super(arg0, arg1);
		this.bs = bubbleSpec;
		init();
	}

	public BubbledLabel(String arg0,BubbleSpec bubbleSpec) {
		super(arg0);
		this.bs = bubbleSpec;
		init();
	}

	private void init(){
		DropShadow ds = new DropShadow();
		ds.setOffsetX(1.3);
		ds.setOffsetY(1.3);
		ds.setColor(Color.DARKGRAY);
		setPrefSize(Label.USE_COMPUTED_SIZE, Label.USE_COMPUTED_SIZE);
		shapeProperty().addListener(new ChangeListener<Shape>() {
			@Override
			public void changed(ObservableValue<? extends Shape> arg0,
					Shape arg1, Shape arg2) {
				if(systemCall){
					systemCall = false;
				}else{
					shapeIt();
				}
				/*
				if(arg2.getClass().isAssignableFrom(Bubble.class)){ // i do no need to check for this actuall is waste of time
					systemCall = false;
					return;
				}else{
					// not the required shape
					systemCall = true;
					setShape(new Bubble(bs));
					System.gc();
				}*/

			}
		});

		heightProperty().addListener(new InvalidationListener() {

			@Override
			public void invalidated(Observable arg0) {
				if(!systemCall)
					setPrefHeight(Label.USE_COMPUTED_SIZE);
			}
		});

		widthProperty().addListener(new InvalidationListener() {

			@Override
			public void invalidated(Observable observable) {
				if(!systemCall)
					setPrefHeight(Label.USE_COMPUTED_SIZE);
			}
		});

		shapeIt();
	}

	@Override
	protected void updateBounds() {
		super.updateBounds();
		//top right  bottom  left
		switch (bs) {
		case FACE_LEFT_BOTTOM:
			setPadding(new Insets(pading,pading,
					(this.getBoundsInLocal().getWidth()*((Bubble)getShape()).drawRectBubbleIndicatorRule)/2
					+pading,
					pading));
			break;
		case FACE_LEFT_CENTER:
			setPadding(new Insets(pading,pading,pading,
					(this.getBoundsInLocal().getWidth()*((Bubble)getShape()).drawRectBubbleIndicatorRule)/2
					+pading
					));
			break;
		case FACE_RIGHT_BOTTOM:
			setPadding(new Insets(pading,
					(this.getBoundsInLocal().getWidth()*((Bubble)getShape()).drawRectBubbleIndicatorRule)/2
					+pading
					,pading,pading));
			break;
		case FACE_RIGHT_CENTER:
			setPadding(new Insets(pading,
					(this.getBoundsInLocal().getWidth()*((Bubble)getShape()).drawRectBubbleIndicatorRule)/2
					+pading
					,pading,pading));
			break;
		case FACE_TOP:
			setPadding(new Insets(
					(this.getBoundsInLocal().getWidth()*((Bubble)getShape()).drawRectBubbleIndicatorRule)/2
					+pading,
					pading,pading,pading));
			break;

		default:
			break;
		}
	}

	public final double getPading() {
		return pading;
	}

	public void setPading(double pading) {
		if(pading > 25.0)
			return;
		this.pading = pading;
	}

	public BubbleSpec getBubbleSpec() {
		return bs;
	}

	public void setBubbleSpec(BubbleSpec bubbleSpec) {
		this.bs = bubbleSpec;
		shapeIt();
	}

	private final void shapeIt(){
		systemCall = true;
		setShape(new Bubble(bs));
		System.gc();
	}
}


text:
<?php

namespace Laminas\Db\Adapter\Driver\Mysqli;

use Exception as GenericException;
use Laminas\Db\Adapter\Driver\AbstractConnection;
use Laminas\Db\Adapter\Exception;
use Laminas\Db\Adapter\Exception\InvalidArgumentException;

use function constant;
use function defined;
use function is_array;
use function is_string;
use function strtoupper;

use const MYSQLI_CLIENT_SSL;
use const MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;

class Connection extends AbstractConnection
{
    /** @var Mysqli */
    protected $driver;

    /** @var \mysqli */
    protected $resource;

    /**
     * Constructor
     *
     * @param array|mysqli|null $connectionInfo
     * @throws InvalidArgumentException
     */
    public function __construct($connectionInfo = null)
    {
        if (is_array($connectionInfo)) {
            $this->setConnectionParameters($connectionInfo);
        } elseif ($connectionInfo instanceof \mysqli) {
            $this->setResource($connectionInfo);
        } elseif (null !== $connectionInfo) {
            throw new Exception\InvalidArgumentException(
                '$connection must be an array of parameters, a mysqli object or null'
            );
        }
    }

    /**
     * @return self Provides a fluent interface
     */
    public function setDriver(Mysqli $driver)
    {
        $this->driver = $driver;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function getCurrentSchema()
    {
        if (! $this->isConnected()) {
            $this->connect();
        }

        $result = $this->resource->query('SELECT DATABASE()');
        $r      = $result->fetch_row();

        return $r[0];
    }

    /**
     * Set resource
     *
     * @return self Provides a fluent interface
     */
    public function setResource(\mysqli $resource)
    {
        $this->resource = $resource;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function connect()
    {
        if ($this->resource instanceof \mysqli) {
            return $this;
        }

        // localize
        $p = $this->connectionParameters;

        // given a list of key names, test for existence in $p
        $findParameterValue = function (array $names) use ($p) {
            foreach ($names as $name) {
                if (isset($p[$name])) {
                    return $p[$name];
                }
            }

            return;
        };

        $hostname = $findParameterValue(['hostname', 'host']);
        $username = $findParameterValue(['username', 'user']);
        $password = $findParameterValue(['password', 'passwd', 'pw']);
        $database = $findParameterValue(['database', 'dbname', 'db', 'schema']);
        $port     = isset($p['port']) ? (int) $p['port'] : null;
        $socket   = $p['socket'] ?? null;

        // phpcs:ignore WebimpressCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps
        $useSSL     = $p['use_ssl'] ?? 0;
        $clientKey  = $p['client_key'] ?? '';
        $clientCert = $p['client_cert'] ?? '';
        $caCert     = $p['ca_cert'] ?? '';
        $caPath     = $p['ca_path'] ?? '';
        $cipher     = $p['cipher'] ?? '';

        $this->resource = $this->createResource();

        if (! empty($p['driver_options'])) {
            foreach ($p['driver_options'] as $option => $value) {
                if (is_string($option)) {
                    $option = strtoupper($option);
                    if (! defined($option)) {
                        continue;
                    }
                    $option = constant($option);
                }
                $this->resource->options($option, $value);
            }
        }

        $flags = null;

        // phpcs:ignore WebimpressCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps
        if ($useSSL && ! $socket) {
            // Even though mysqli docs are not quite clear on this, MYSQLI_CLIENT_SSL
            // needs to be set to make sure SSL is used. ssl_set can also cause it to
            // be implicitly set, but only when any of the parameters is non-empty.
            $flags = MYSQLI_CLIENT_SSL;
            $this->resource->ssl_set($clientKey, $clientCert, $caCert, $caPath, $cipher);
            //MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT is not valid option, needs to be set as flag
            if (
                isset($p['driver_options'])
                && isset($p['driver_options'][MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT])
            ) {
                $flags |= MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT;
            }
        }

        try {
            $flags === null
                ? $this->resource->real_connect($hostname, $username, $password, $database, $port, $socket)
                : $this->resource->real_connect($hostname, $username, $password, $database, $port, $socket, $flags);
        } catch (GenericException $e) {
            throw new Exception\RuntimeException(
                'Connection error',
                $this->resource->connect_errno,
                new Exception\ErrorException($this->resource->connect_error, $this->resource->connect_errno)
            );
        }

        if ($this->resource->connect_error) {
            throw new Exception\RuntimeException(
                'Connection error',
                $this->resource->connect_errno,
                new Exception\ErrorException($this->resource->connect_error, $this->resource->connect_errno)
            );
        }

        if (! empty($p['charset'])) {
            $this->resource->set_charset($p['charset']);
        }

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function isConnected()
    {
        return $this->resource instanceof \mysqli;
    }

    /**
     * {@inheritDoc}
     */
    public function disconnect()
    {
        if ($this->resource instanceof \mysqli) {
            $this->resource->close();
        }
        $this->resource = null;
    }

    /**
     * {@inheritDoc}
     */
    public function beginTransaction()
    {
        if (! $this->isConnected()) {
            $this->connect();
        }

        $this->resource->autocommit(false);
        $this->inTransaction = true;

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function commit()
    {
        if (! $this->isConnected()) {
            $this->connect();
        }

        $this->resource->commit();
        $this->inTransaction = false;
        $this->resource->autocommit(true);

        return $this;
    }

    /**
     * {@inheritDoc}
     */
    public function rollback()
    {
        if (! $this->isConnected()) {
            throw new Exception\RuntimeException('Must be connected before you can rollback.');
        }

        if (! $this->inTransaction) {
            throw new Exception\RuntimeException('Must call beginTransaction() before you can rollback.');
        }

        $this->resource->rollback();
        $this->resource->autocommit(true);
        $this->inTransaction = false;

        return $this;
    }

    /**
     * {@inheritDoc}
     *
     * @throws Exception\InvalidQueryException
     */
    public function execute($sql)
    {
        if (! $this->isConnected()) {
            $this->connect();
        }

        if ($this->profiler) {
            $this->profiler->profilerStart($sql);
        }

        $resultResource = $this->resource->query($sql);

        if ($this->profiler) {
            $this->profiler->profilerFinish($sql);
        }

        // if the returnValue is something other than a mysqli_result, bypass wrapping it
        if ($resultResource === false) {
            throw new Exception\InvalidQueryException($this->resource->error);
        }

        return $this->driver->createResult($resultResource === true ? $this->resource : $resultResource);
    }

    /**
     * {@inheritDoc}
     */
    public function getLastGeneratedValue($name = null)
    {
        return $this->resource->insert_id;
    }

    /**
     * Create a new mysqli resource
     *
     * @return \mysqli
     */
    protected function createResource()
    {
        return new \mysqli();
    }
}


text:
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Dean <zxxjjforever@163.com>
// +----------------------------------------------------------------------

$apps = cmf_scan_dir(APP_PATH . '*', GLOB_ONLYDIR);

$returnCommands = [];

foreach ($apps as $app) {
    $commandFile = APP_PATH . $app . '/command.php';

    if (file_exists($commandFile)) {
        $commands       = include $commandFile;

        $returnCommands = array_merge($returnCommands, $commands);
    }

}

return $returnCommands;


text:
@*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*@

    This analysis shows the task memory utilization.

    We check the ratio between your task's consumed memory AND the requested container memory.

    The consumed memory is the average of each task's [max consumed physical memory snapshot].

    The requested container memory is the "hive.tez.container.size" config for hive/tez.am.resource.memory.mb for pig, is the max physical memory the job can request.

    If this heuristic is above MODERATE, it means your used memory is relatively low compared with the requested max memory.

Example

Mapper Memory

Severity: Critical

                Number of tasks
                1000

                Avg Physical Memory (MB)
                512

                Requested Containter Memory
                4G

Suggestions

    The problem indicates you requested large task memory (set hive.tez.container.size > 2048), but the task average used physical memory is low.

    You should try to decrease hive.tez.container.size/tez.am.resource.memory.mb and  hive.tez.java.opts (80% of container size).

    If you get OutOfMemory error, think about why such error happens before increasing the memory back again.

    See Hadoop Tuning Tips for further information.