Common function used by line/spline/area charts to compute
the next X coordinate when generating the chart SVG path.
430544
function makeXcord(chart, fullWidth, t, spacing, markerRadius) {
    if (chart.drawChart) {
          return Math.min(fullWidth * t, spacing + markerRadius);
        } else if (chart.stretchChart) {
          return t * (spacing + markerRadius);
        } else {
          return spacing + markerRadius;
        }
  }
466188
function() {
			
            var point = svg.createSVGPoint();
            point.x = this.x;
            point.y = this.y;
			
            return point;
        }
601963
function findSelectedData(data, x) {
  // For each chart line (pointArray), find the point with the closest x to the mouse.
  const closestXPoints = data.map(line =>
    line.points.reduce((previous, current) =>
      Math.abs(current.x - x) < Math.abs(previous.x - x) ? current : previous
    )
  );
  // Of those, find one with the closest x to the mouse.
  const closestXPoint = closestXPoints.reduce((previous, current) =>
    Math.abs(current.x - x) < Math.abs(previous.x - x) ? current : previous
  );
  const nearlyEqualX = thisPoint =>
    Math.abs(thisPoint.x - closestXPoint.x) < threshold;
  // Only select the chart lines (pointArrays) which have their closest x to the mouse = the overall closest.
  const selectedPoints = closestXPoints.filter(nearlyEqualX);

  const isSelectedArray = closestXPoints.map(nearlyEqualX);
  const selectedData = data.filter((line, i) => isSelectedArray[i]);
  selectedData.forEach((line, i) => {
    line.point = selectedPoints[i];
  }); // TODO: this adds the property to the original data - bad.
  return selectedData;
}
899451
function drawArea() {
            if (brushArea) {
                svg.selectAll('.brush-area').remove();
            }

            // Create and configure the area generator
            brushArea = d3Shape.area()
                .x(({date}) => xScale(date))
                .y0(chartHeight)
                .y1(({value}) => yScale(value))
                .curve(d3Shape.curveBasis);

            // Create the area path
            svg.select('.chart-group')
              .append('path')
                .datum(data)
                .attr('class', 'brush-area')
                .attr('d', brushArea);
        }
883994
function svgShapesToPathRectToPath(attributes) {
  const x = 'undefined' !== typeof attributes.x ? parseFloat(attributes.x) : 0;
  const y = 'undefined' !== typeof attributes.y ? parseFloat(attributes.y) : 0;
  const width =
    'undefined' !== typeof attributes.width ? parseFloat(attributes.width) : 0;
  const height =
    'undefined' !== typeof attributes.height
      ? parseFloat(attributes.height)
      : 0;
  const rx =
    'undefined' !== typeof attributes.rx
      ? parseFloat(attributes.rx)
      : 'undefined' !== typeof attributes.ry ? parseFloat(attributes.ry) : 0;
  const ry =
    'undefined' !== typeof attributes.ry ? parseFloat(attributes.ry) : rx;

  return (
    '' +
    // start at the left corner
    'M' +
    (x + rx) +
    ' ' +
    y +
    // top line
    'h' +
    (width - rx * 2) +
    // upper right corner
    (rx || ry ? 'a ' + rx + ' ' + ry + ' 0 0 1 ' + rx + ' ' + ry : '') +
    // Draw right side
    'v' +
    (height - ry * 2) +
    // Draw bottom right corner
    (rx || ry ? 'a ' + rx + ' ' + ry + ' 0 0 1 ' + rx * -1 + ' ' + ry : '') +
    // Down the down side
    'h' +
    (width - rx * 2) * -1 +
    // Draw bottom right corner
    (rx || ry
      ? 'a ' + rx + ' ' + ry + ' 0 0 1 ' + rx * -1 + ' ' + ry * -1
      : '') +
    // Down the left side
    'v' +
    (height - ry * 2) * -1 +
    // Draw bottom right corner
    (rx || ry ? 'a ' + rx + ' ' + ry + ' 0 0 1 ' + rx + ' ' + ry * -1 : '') +
    // Close path
    'z'
  );
}
472966
function Line( graph ) {

	// INSTANCE ATTRIBUTES //

	this._parent = graph;
	this._root = undefined;
	this._children = {};
	this._config = {
		"type": "line",
		"interpolation": {
			"mode": "linear",
			"tension": 0.7
		},
		"labels": []
	};

	// DATA //

	this._data = graph._data;

	// TRANSFORMS //

	this._transforms = {
		'x': function X( d ) {
			return graph._xScale( d[ 0 ] );
		},
		'y': function Y( d ) {
			return graph._yScale( d[ 1 ] );
		}
	};

	// GENERATOR //

	this._path = this.path()
		.x( this._transforms.x )
		.y( this._transforms.y )
		.interpolate( this._config.interpolation.mode )
		.tension( this._config.interpolation.tension );

	// REGISTER //
	if ( graph._config.hasOwnProperty( 'marks' ) ) {
		graph._config.marks.push( this._config );
	} else {
		graph._config.marks = [ this._config ];
	}
	if ( graph._children.hasOwnProperty( 'marks' ) ) {
		graph._children.marks.push( this );
	} else {
		graph._children.marks = [ this ];
	}

	return this;
}
50665
function drawHorizontalExtendedLine() {
            baseLine = svg.select('.grid-lines-group')
                .selectAll('line.extended-x-line')
                .data([0])
                .enter()
                  .append('line')
                    .attr('class', 'extended-x-line')
                    .attr('x1', xAxisPadding.left)
                    .attr('x2', chartWidth)
                    .attr('y1', chartHeight)
                    .attr('y2', chartHeight);
        }
103061
function drawDataReferencePoints() {
            // Creates Dots on Data points
            var points = svg.select('.chart-group').selectAll('.dots')
                .data(layers)
                .enter()
                  .append('g')
                    .attr('class', 'dots')
                    .attr('d', ({values}) => area(values))
                    .attr('clip-path', 'url(#clip)');

            // Processes the points
            // TODO: Optimize this code
            points.selectAll('.dot')
                .data(({values}, index) => values.map((point) => ({index, point})))
                .enter()
                  .append('circle')
                    .attr('class','dot')
                    .attr('r', () => pointsSize)
                    .attr('fill', () => pointsColor)
                    .attr('stroke-width', '0')
                    .attr('stroke', pointsBorderColor)
                    .attr('transform', function(d) {
                        let {point} = d;
                        let key = xScale(point.date);

                        dataPoints[key] = dataPoints[key] || [];
                        dataPoints[key].push(d);

                        let {date, y, y0} = point;

                        return `translate( ${xScale(date)}, ${yScale(y + y0)} )`;
                    });
        }
1182602
def _y_axis(self, draw_axes=True):
        """"""
        axis = self.svg.node(self.nodes['plot'], class_="axis x gauge")

        for i, (label, theta) in enumerate(self._y_labels):
            guides = self.svg.node(axis, class_='guides')

            self.svg.line(
                guides, [self.view((.95, theta)),
                         self.view((1, theta))],
                close=True,
                class_='line'
            )

            self.svg.line(
                guides, [self.view((0, theta)),
                         self.view((.95, theta))],
                close=True,
                class_='guide line %s' %
                ('major' if i in (0, len(self._y_labels) - 1) else '')
            )

            x, y = self.view((.9, theta))
            self.svg.node(guides, 'text', x=x, y=y).text = label

            self.svg.node(
                guides,
                'title',
            ).text = self._y_format(theta)
448515
function drawLinesDataset(axis, animPc, data, config, ctx, offsets, vars) {
		var xAxisPosY = vars.xAxisPosY;
		var yAxisPosX = vars.yAxisPosX;
		var valueHop = vars.valueHop;
		var nbValueHop = vars.nbValueHop;
		var scaleHop = vars.scaleHop;
		var zeroY = vars.zeroY;
		var calculatedScale = vars.calculatedScale;
		var logarithmic = vars.logarithmic;
		var currentAnimPc = animationCorrection(animPc, data, config, 0, 0, 0);
		var totvalue = new Array();
		var maxvalue = new Array();
		var lmaxvalue = new Array();
		var lminvalue = new Array();
		for (var i = 0; i < data.datasets.length; i++) {
			lmaxvalue[i] = -999999999;
			lminvalue[i] = 999999999;
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					totvalue[j] = 0;
					maxvalue[j] = -999999999;
				}
			}
		}
		currentAnimPc.mainVal = 1;
		for (var i = 0; i < data.datasets.length; i++) {
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					totvalue[j] += data.datasets[i].data[j];
					maxvalue[j] = Max([maxvalue[j], data.datasets[i].data[j]]);
					lmaxvalue[i] = Max([lmaxvalue[i], yPos(i, j)]);
					lminvalue[i] = Min([lminvalue[i], yPos(i, j)]);
				}
			}
		}
		for (var i = 0; i < data.datasets.length; i++) {
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				var prevpt = -1;
				var frstpt = -1;
				if (typeof data.datasets[i].strokeColor == "function") {
					ctx.strokeStyle = data.datasets[i].strokeColor("STROKECOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
				} else if (typeof data.datasets[i].strokeColor == "string") {
					ctx.strokeStyle = data.datasets[i].strokeColor;
				} else ctx.strokeStyle = config.defaultStrokeColor;
				ctx.lineWidth = config.datasetStrokeWidth;
				ctx.beginPath();
				var prevAnimPc;
				var prevXpos;
				prevAnimPc = 0;
				prevnotempty = 0;
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					var xposj = xPos(i, j, data);
					currentAnimPc = animationCorrection(animPc, data, config, i, j, 0);
					if (currentAnimPc.mainVal == 0 && prevAnimPc > 0) {
						ctx.stroke();
						ctx.strokeStyle = "rgba(0,0,0,0)";
						//          ctx.lineWidth =0.01;                                                                   
						ctx.lineTo(prevXpos, xAxisPosY - zeroY);
					}
					prevAnimPc = currentAnimPc.mainVal;
					if (currentAnimPc.mainVal >= 1) {
						if (typeof(data.datasets[i].title) == "string") lgtxt = data.datasets[i].title.trim();
						else lgtxt = "";
					}
					if (!(typeof(data.datasets[i].data[j]) == 'undefined')) {
						prevXpos = xPos(i, j, data);
						if (prevpt == -1) {
							ctx.moveTo(xposj, yPos(i, j));
							frstpt = j;
						} else {
							if (config.bezierCurve) {
								ctx.bezierCurveTo(xPos(i, j - (j - prevpt) / 2, data), yPos(i, prevpt), xPos(i, j - (j - prevpt) / 2, data), yPos(i, j), xPos(i, j, data), yPos(i, j));
							} else {
								ctx.lineTo(xPos(i, j, data), yPos(i, j));
							}
						}
						if ((typeof(data.datasets[i].data[j + 1]) !== 'undefined') || (true == config.extrapolateMissingData)) {
							if (currentAnimPc.subVal > 0) {
								// next not missing value
								nxtnotmiss = -1;
								for (t = j + 1; t < data.datasets[i].data["length"] && nxtnotmiss == -1; t++) {
									if (!(typeof(data.datasets[i].data[t]) == 'undefined')) nxtnotmiss = t;
								}
								if (nxtnotmiss != -1) {
									prevXpos = xPos(i, j + currentAnimPc.subVal, data);
									if (config.bezierCurve) {
										ctx.bezierCurveTo(xPos(i, j + currentAnimPc.subVal / 2, data), yPos(i, j), xPos(i, j + currentAnimPc.subVal / 2, data), yPos(i, nxtnotmiss), xPos(i, j + currentAnimPc.subVal, data), yPos(i, nxtnotmiss));
									} else {
										ctx.lineTo(xPos(i, j + currentAnimPc.subVal, data), yPos(i, j + 1));
									}
								}
							}
							prevpt = j;
							if (animPc >= 1) {
								if (i == 0) divprev = data.datasets[i].data[j];
								else divprev = data.datasets[i].data[j] - data.datasets[i - 1].data[j];
								if (i == data.datasets.length - 1) divnext = data.datasets[i].data[j];
								else divnext = data.datasets[i].data[j] - data.datasets[i + 1].data[j];
								lgtxt2 = "";
								if (typeof data.datasets[i].xPos != "undefined") {
									if (!(typeof data.datasets[i].xPos[j] == "undefined")) lgtxt2 = data.datasets[i].xPos[j];
								}
								if (lgtxt2 == "" && !(typeof(data.labels[j]) == "undefined")) lgtxt2 = data.labels[j];
								if (typeof lgtxt2 == "string") lgtxt2 = lgtxt2.trim();
								jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", xPos(i, j, data), yPos(i, j), lgtxt, lgtxt2, 1 * data.datasets[i].data[j], divprev, divnext, maxvalue[j], totvalue[j], i, j];
								if (config.inGraphDataShow) {
									ctx.save();
									ctx.textAlign = config.inGraphDataAlign;
									ctx.textBaseline = config.inGraphDataVAlign;
									ctx.font = config.inGraphDataFontStyle + ' ' + config.inGraphDataFontSize + 'px ' + config.inGraphDataFontFamily;
									ctx.fillStyle = config.inGraphDataFontColor;
									var dotX = yAxisPosX + (valueHop * k),
										dotY = xAxisPosY - currentAnimPc.mainVal * (calculateOffset(logarithmic, data.datasets[i].data[j], calculatedScale, scaleHop)),
										paddingTextX = config.inGraphDataPaddingX,
										paddingTextY = config.inGraphDataPaddingY;
									var dispString = tmplbis(config.inGraphDataTmpl, {
										config: config,
										v1: fmtChartJS(config, lgtxt, config.fmtV1),
										v2: fmtChartJS(config, lgtxt2, config.fmtV2),
										v3: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV3),
										v4: fmtChartJS(config, divprev, config.fmtV4),
										v5: fmtChartJS(config, divnext, config.fmtV5),
										v6: fmtChartJS(config, maxvalue[j], config.fmtV6),
										v7: fmtChartJS(config, totvalue[j], config.fmtV7),
										v8: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[j], config.fmtV8), config.roundPct),
										v9: fmtChartJS(config, yAxisPosX + (valueHop * k), config.fmtV9),
										v10: fmtChartJS(config, xAxisPosY - (calculateOffset(logarithmic, data.datasets[i].data[j], calculatedScale, scaleHop)), config.fmtV10),
										v11: fmtChartJS(config, i, config.fmtV11),
										v12: fmtChartJS(config, j, config.fmtV12),
										data: data
									});
									ctx.translate(xPos(i, j, data) + paddingTextX, yPos(i, j) - paddingTextY);
									ctx.rotate(config.inGraphDataRotate * (Math.PI / 180));
									ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, config.inGraphDataFontSize);
									ctx.restore();
								}
							}
						}
					} else {
						if (false == config.extrapolateMissingData) {
							ctx.stroke();
							if (config.datasetFill) {
								ctx.lineTo(prevXpos, xAxisPosY - zeroY);
								ctx.lineTo(xPos(i, frstpt, data), xAxisPosY - zeroY);
								ctx.lineTo(xPos(i, frstpt, data), yPos(i, frstpt));
								ctx.closePath();
								if (typeof data.datasets[i].fillColor == "function") ctx.fillStyle = data.datasets[i].fillColor("FILLCOLOR", data, config, i, -1, currentAnimPc.mainVal, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
								else if (typeof data.datasets[i].fillColor == "string") ctx.fillStyle = data.datasets[i].fillColor;
								else ctx.fillStyle = config.defaultFillColor;
								ctx.fill();
							}
							ctx.beginPath();
							prevpt = -1;
							frstpt = -1;
							prevAnimPc = 0;
							prevnotempty = 0;
						} else {
							if (currentAnimPc.subVal > 0) {
								nxtnotmiss = -1;
								for (t = j + 1; t < data.datasets[i].data["length"] && nxtnotmiss == -1; t++) {
									if (!(typeof(data.datasets[i].data[t]) == 'undefined')) nxtnotmiss = t;
								}
								if ((typeof(data.datasets[i].data[j]) !== 'undefined') || (true == config.extrapolateMissingData)) {
									if (nxtnotmiss != -1) {
										prevXpos = xPos(i, j + currentAnimPc.subVal, data);
										if (config.bezierCurve) {
											ctx.bezierCurveTo(xPos(i, prevpt + (j + currentAnimPc.subVal - prevpt) / 2, data), yPos(i, prevpt), xPos(i, prevpt + (j + currentAnimPc.subVal - prevpt) / 2, data), yPos(i, nxtnotmiss), xPos(i, j + currentAnimPc.subVal, data), yPos(i, nxtnotmiss));
										} else {
											ctx.lineTo(xPos(i, j + currentAnimPc.subVal, data), yPos(i, j + 1));
										}
									}
								}
							}
						}
					}
				}
				ctx.stroke();
				if (config.datasetFill) {
					//				ctx.lineTo(yAxisPosX + (valueHop * (data.datasets[i].data.length - 1)), xAxisPosY - zeroY);
					ctx.lineTo(prevXpos, xAxisPosY - zeroY);
					ctx.lineTo(xPos(i, frstpt, data), xAxisPosY - zeroY);
					ctx.lineTo(xPos(i, frstpt, data), yPos(i, frstpt));
					ctx.closePath();
					if (typeof data.datasets[i].fillColor == "function") { ctx.fillStyle = data.datasets[i].fillColor("FILLCOLOR", data, config, i, -1, currentAnimPc.mainVal, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i])); }
					else if (typeof data.datasets[i].fillColor == "string") ctx.fillStyle = data.datasets[i].fillColor;
					else ctx.fillStyle = config.defaultFillColor;
					ctx.fill();
				} else {
					ctx.closePath();
				}
				if (config.pointDot) {
					if (typeof data.datasets[i].pointColor == "function") ctx.fillStyle = data.datasets[i].pointColor("POINTCOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
					else ctx.fillStyle = data.datasets[i].pointColor;
					if (typeof data.datasets[i].pointStrokeColor == "function") ctx.strokeStyle = data.datasets[i].pointStrokeColor("POINTSTROKECOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
					else ctx.strokeStyle = data.datasets[i].pointStrokeColor;
					ctx.lineWidth = config.pointDotStrokeWidth;
					for (var k = 0; k < data.datasets[i].data.length; k++) {
						if (!(typeof(data.datasets[i].data[k]) == 'undefined')) {
							var currentAnimPc = animationCorrection(animPc, data, config, i, k, 0);
							if (currentAnimPc.mainVal > 0 || !config.animationLeftToRight) {
								ctx.beginPath();
								ctx.arc(xPos(i, k, data), yPos(i, k), config.pointDotRadius, 0, Math.PI * 2, true);
								ctx.fill();
								ctx.stroke();
							}
						}
					}
				}
			}
		};

		function yPos(dataSet, iteration) {
			return xAxisPosY - zeroY - currentAnimPc.mainVal * (calculateOffset(logarithmic, data.datasets[dataSet].data[iteration], calculatedScale, scaleHop) - zeroY);
		};

		function xPos(ival, iteration, data) {
			if (typeof data.datasets[ival].xPos == "object") {
				if (!(typeof data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] == "undefined")) {
					var width = valueHop * nbValueHop;
					var deb = (typeof data.xBegin != "undefined") ? data.xBegin : 1 * data.labels[0];
					var fin = (typeof data.xEnd != "undefined") ? data.xEnd : 1 * data.labels[data.labels.length - 1];
					if (fin <= deb) fin = deb + 100;
					if (1 * data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] >= deb && data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] <= fin) {
						var p1 = yAxisPosX + width * ((1 * data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] - deb) / (fin - deb));
						var p2 = p1;
						if (Math.abs(iteration - Math.floor(iteration + 0.0001)) > 0.0001) {
							var tt = iteration + Math.floor(iteration + 0.0001);
							var p2 = xPos(ival, Math.ceil(iteration - 0.0001), data);
						}
						return p1 + (iteration - Math.floor(iteration + 0.0001)) * (p2 - p1);
					}
				}
			}
			return yAxisPosX + (valueHop * iteration);
		};
	}
267725
public SVGPath relativeEllipticalArc(double[] rxy, double ar, double la, double sp, double[] xy) {
    return append(PATH_ARC_RELATIVE).append(rxy[0]).append(rxy[1]).append(ar).append(la).append(sp).append(xy[0]).append(xy[1]);
  }
14785
function drawAxis() {
            let translateX = hasTitle() ? legendSpacing : 0;

            svg.select('.axis-group')
                .attr('transform', `translate(${translateX}, ${chartHeight + paddingBetweenAxisAndChart})`)
                .call(axis);

            drawHorizontalExtendedLine();
        }
1289777
function (x, y) {
                var matrix = selectedShape.node().getCTM(),
                    position = chart.svg.node().createSVGPoint();
                position.x = x || 0;
                position.y = y || 0;
                return position.matrixTransform(matrix);
            }
1363401
function drawSlices() {
            // Not ideal, we need to figure out how to call exit for nested elements
            if (slices) {
                svg.selectAll('g.arc').remove();
            }

            slices = svg.select('.chart-group')
                .selectAll('g.arc')
                .data(layout(data));

            let newSlices = slices.enter()
                .append('g')
                  .each(storeAngle)
                  .each(reduceOuterRadius)
                  .classed('arc', true)
                  .append('path');

            if (isAnimated) {
                newSlices.merge(slices)
                    .attr('fill', getSliceFill)
                    .on('mouseover', function(d) {
                        handleMouseOver(this, d, chartWidth, chartHeight);
                    })
                    .on('mousemove', function(d) {
                        handleMouseMove(this, d, chartWidth, chartHeight);
                    })
                    .on('mouseout', function(d) {
                        handleMouseOut(this, d, chartWidth, chartHeight);
                    })
                    .on('click', function(d) {
                        handleClick(this, d, chartWidth, chartHeight);
                    })
                    .transition()
                    .ease(ease)
                    .duration(pieDrawingTransitionDuration)
                    .attrTween('d', tweenLoading);
            } else {
                newSlices.merge(slices)
                    .attr('fill', getSliceFill)
                    .attr('d', shape)
                    .on('mouseover', function(d) {
                        handleMouseOver(this, d, chartWidth, chartHeight);
                    })
                    .on('mousemove', function(d) {
                        handleMouseMove(this, d, chartWidth, chartHeight);
                    })
                    .on('mouseout', function(d) {
                        handleMouseOut(this, d, chartWidth, chartHeight);
                    })
                    .on('click', function(d) {
                        handleClick(this, d, chartWidth, chartHeight);
                    });
            }

            slices.exit().remove();
        }
636196
function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
            var axis = this,
              sign = 1,
              cvsOffset = 0,
              localA = old ? axis.oldTransA : axis.transA,
              localMin = old ? axis.oldMin : axis.min,
              returnValue,
              minPixelPadding = axis.minPixelPadding,
              postTranslate = (axis.options.ordinal || (axis.isLog && handleLog)) && axis.lin2val;

            if (!localA) {
                localA = axis.transA;
            }

            // In vertical axes, the canvas coordinates start from 0 at the top like in
            // SVG.
            if (cvsCoord) {
                sign *= -1; // canvas coordinates inverts the value
                cvsOffset = axis.len;
            }

            // Handle reversed axis
            if (axis.reversed) {
                sign *= -1;
                cvsOffset -= sign * (axis.sector || axis.len);
            }

            // From pixels to value
            if (backwards) { // reverse translation

                val = val * sign + cvsOffset;
                val -= minPixelPadding;
                returnValue = val / localA + localMin; // from chart pixel to value
                if (postTranslate) { // log and ordinal axes
                    returnValue = axis.lin2val(returnValue);
                }

                // From value to pixels
            } else {
                if (postTranslate) { // log and ordinal axes
                    val = axis.val2lin(val);
                }
                if (pointPlacement === 'between') {
                    pointPlacement = 0.5;
                }
                returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +
                  (isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);
            }

            return returnValue;
        }
726449
function Trendline() { // Closure function
    var p = {},  // Container for private, direct access mixed in variables
        dispatch = d3_dispatch('mouseenter', 'mouseout', 'mousemove', 'drag', 'dragstart', 'dragend');

    function trendline(g) {
      var group = plot.groupSelect(g, plot.dataMapper.unity),
          trendlineGroup = group.entry.append('g').attr('class', 'trendline');

      trendlineGroup.append('path').attr('class', 'body');
      trendlineGroup.append('circle').attr({ class: 'start', r: 1 });
      trendlineGroup.append('circle').attr({ class: 'end', r: 1 });

      var interaction = group.entry.append('g').attr('class', 'interaction').style({ opacity: 0, fill: 'none' })
        .call(plot.interaction.mousedispatch(dispatch));

      interaction.append('path').attr('class', 'body').style('stroke-width', 16);
      interaction.append('circle').attr({ class: 'start', r: 8 });
      interaction.append('circle').attr({ class: 'end', r: 8 });

      trendline.refresh(g);
    }

    trendline.refresh = function(g) {
      refresh(g, p.accessor, p.xScale, p.yScale);
    };

    trendline.drag = function(g) {
      g.selectAll('.interaction circle.start')
        .call(dragEnd(dispatch, p.accessor, p.accessor.sd, p.xScale, p.accessor.sv, p.yScale));
      g.selectAll('.interaction circle.end')
        .call(dragEnd(dispatch, p.accessor, p.accessor.ed, p.xScale, p.accessor.ev, p.yScale));
      g.selectAll('.interaction path.body')
        .call(dragBody(dispatch, p.accessor, p.xScale, p.yScale));
    };

    // Mixin 'superclass' methods and variables
    plotMixin(trendline, p)
      .plot(accessor_trendline())
      .on(dispatch);

    return trendline;
  }
781835
public SVGPath lineTo(double x, double y) {
    return append(PATH_LINE_TO).append(x).append(y);
  }