Draw the graph and the underlying area. This method calls the Series base
function and adds the area. The areaPath is calculated in the getSegmentPath
method called from Series.prototype.drawGraph.
543951
function () {
		
		// Define or reset areaPath
		this.areaPath = [];
		
		// Call the base method
		Series.prototype.drawGraph.apply(this);
		
		// Define local variables
		var series = this,
			areaPath = this.areaPath,
			options = this.options,
			negativeColor = options.negativeColor,
			negativeFillColor = options.negativeFillColor,
			props = [['area', this.color, options.fillColor]]; // area name, main color, fill color
		
		if (negativeColor || negativeFillColor) {
			props.push(['areaNeg', negativeColor, negativeFillColor]);
		}
		
		each(props, function (prop) {
			var areaKey = prop[0],
				area = series[areaKey];
				
			// Create or update the area
			if (area) { // update
				area.animate({ d: areaPath });
	
			} else { // create
				series[areaKey] = series.chart.renderer.path(areaPath)
					.attr({
						fill: pick(
							prop[2],
							Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()
						),
						zIndex: 0 // #1069
					}).add(series.group);
			}
		});
	}
1083582
function Area( graph ) {

	// INSTANCE ATTRIBUTES //

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

	// DATA //

	this._data = graph._data;

	// TRANSFORMS //

	this._transforms = {
		'x': function X( d ) {
			return graph._xScale( d[ 0 ] );
		},
		'y0': function Y0( d ) {
			return graph._yScale( 0 );
		},
		'y1': function Y1( d ) {
			return graph._yScale( 0 + d[ 1 ] );
		}
	};

	// GENERATOR //

	this._path = this.path()
		.x( this._transforms.x )
		.y0( this._transforms.y0 )
		.y1( this._transforms.y1 )
		.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;
}
1308255
function drawQuadrant(n, q, loc) {
    // draw upper triangle going certain direction at location
    function drawUpperTriangle(d, loc) {
      if (d == "r") {
        var first = {x: 50, y: 0};
        var second = {x: 50, y: 50};
      } else {
        var first = {x: 50, y: 0};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
    function drawLowerTriangle(d, loc) {
      if (d == "r") {
        loc = {x: loc.x + 50, y: loc.y};
        var first = {x: 0, y: 50};
        var second = {x: -50, y: 50};
      } else {
        var first = {x: 50, y: 50};
        var second = {x: 0, y: 50};
      }
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + first.x, loc.y + first.y);
      context.lineTo(loc.x + second.x, loc.y + second.y);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    }
    function drawTileOutline(loc) {
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + 50, loc.y);
      context.lineTo(loc.x + 50, loc.y + 50);
      context.lineTo(loc.x, loc.y + 50);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.closePath();
    }
    // blank space, just draw outline without filling.
    if (n == 0) {
      drawTileOutline(loc);
    } else if (n == 1) { // tile.
      context.beginPath();
      context.moveTo(loc.x, loc.y);
      context.lineTo(loc.x + 50, loc.y);
      context.lineTo(loc.x + 50, loc.y + 50);
      context.lineTo(loc.x, loc.y + 50);
      context.lineTo(loc.x, loc.y);
      context.lineWidth = 1;
      context.strokeStyle = 'black';
      context.stroke();
      context.fillStyle = fill;
      context.fill();
      context.closePath();
    } else if (n == 2) {
      drawTileOutline(loc);
      if (q == 0 || q == 2) {
        drawLowerTriangle("l", loc);
      } else {
        drawLowerTriangle("r", loc);
      }
    } else if (n == 3) {
      drawTileOutline(loc);
      if (q == 0 || q == 2) {
        drawUpperTriangle("r", loc);
      } else {
        drawUpperTriangle("l", loc);
      }
    }
  }
1326721
private void boundaryAreaExteriorLine_(int half_edge, int id_a, int id_b) {
		if (m_matrix[MatrixPredicate.BoundaryExterior] == 1)
			return;

		int parentage = m_topo_graph.getHalfEdgeParentage(half_edge);

		if ((parentage & id_a) != 0 && (parentage & id_b) == 0)
			m_matrix[MatrixPredicate.BoundaryExterior] = 1;

	}
1328867
function DrawGraph() {

    if (($this->img) == "") {
      $this->DrawError('No Image Defined: DrawGraph');
            //$this->PHPlot();
        }

    if (! is_array($this->data_values)) {
      $this->DrawBackground();
      $this->DrawError("No array of data in \$data_values");
    } else {
      if (!$this->data_color) {
        $this->SetDataColors(array('blue','green','yellow','red','orange','blue'),array('black'));
      }

      $this->FindDataLimits();  //Get maxima and minima for scaling

      $this->SetXLabelHeight();		//Get data for bottom margin

      $this->SetYLabelWidth();		//Get data for left margin

      if (!$this->plot_area_width) {
        $this->SetPlotAreaPixels('','','','');		//Set Margins
      }

      if (!$this->plot_max_y) {  //If not set by user call SetPlotAreaWorld,
        $this->SetPlotAreaWorld('','','','');
      }

      if ($this->data_type == "text-data") {
        $this->SetEqualXCoord();
      }

      $this->SetPointSize($this->point_size);

      $this->DrawBackground();
      $this->DrawImageBorder();

      $this->SetTranslation();

      if ($this->draw_plot_area_background == 1) {
        $this->DrawPlotAreaBackground();
      }
//$foo = "$this->max_y, $this->min_y, $new_miny, $new_maxy, $this->x_label_height";
//ImageString($this->img, 4, 20, 20, $foo, $this->ndx_text_color);

      switch ($this->plot_type) {
        case "bars":
          $this->DrawPlotBorder();
          $this->DrawLabels();
          $this->DrawBars();
          $this->DrawXAxis();
          break;
        case "thinbarline":
          $this->DrawPlotBorder();
          $this->DrawLabels();
          $this->DrawThinBarLines();
          break;
        case "lines":
          $this->DrawPlotBorder();
          $this->DrawLabels();
          if ( $this->data_type == "text-data") {
            $this->DrawLines();
          } elseif ( $this->data_type == "data-data-error") {
            $this->DrawLinesError();
          } else {
            $this->DrawLines();
          }
          break;
        case "area":
          $this->DrawPlotBorder();
          $this->DrawLabels();
          if ( $this->data_type == "text-data") {
            $this->DrawAreaSeries();
          } else {
            $this->DrawArea();
          }
          break;
        case "linepoints":
          $this->DrawPlotBorder();
          $this->DrawLabels();
          if ( $this->data_type == "text-data") {
            $this->DrawLines();
            $this->DrawDots();
          } elseif ( $this->data_type == "data-data-error") {
            $this->DrawLinesError();
            $this->DrawDotsError();
          } else {
            $this->DrawLines();
            $this->DrawDots();
          }
          break;
        case "points";
          $this->DrawPlotBorder();
          $this->DrawLabels();
          if ( $this->data_type == "text-data") {
            $this->DrawDots();
          } elseif ( $this->data_type == "data-data-error") {
            $this->DrawDotsError();
          } else {
            $this->DrawDots();
          }
          break;
        case "pie":
          $this->DrawPieChart();
          $this->DrawLabels();
          break;
        default:
          $this->DrawPlotBorder();
          $this->DrawLabels();
          $this->DrawBars();
          break;
      }

      if ($this->legend) {
        $this->DrawLegend($this->legend_x_pos,$this->legend_y_pos,'');
      }

    }
    if ($this->print_image == 1) {
      $this->PrintImage();
    }
  }
255292
function (segment) {
		
		var lowSegment,
			highSegment = [],
			i = segment.length,
			baseGetSegmentPath = Series.prototype.getSegmentPath,
			point,
			linePath,
			lowerPath,
			options = this.options,
			step = options.step,
			higherPath;
			
		// Remove nulls from low segment
		lowSegment = HighchartsAdapter.grep(segment, function (point) {
			return point.plotLow !== null;
		});
		
		// Make a segment with plotX and plotY for the top values
		while (i--) {
			point = segment[i];
			if (point.plotHigh !== null) {
				highSegment.push({
					plotX: point.plotHighX || point.plotX, // plotHighX is for polar charts
					plotY: point.plotHigh
				});
			}
		}
		
		// Get the paths
		lowerPath = baseGetSegmentPath.call(this, lowSegment);
		if (step) {
			if (step === true) {
				step = 'left';
			}
			options.step = { left: 'right', center: 'center', right: 'left' }[step]; // swap for reading in getSegmentPath
		}
		higherPath = baseGetSegmentPath.call(this, highSegment);
		options.step = step;
		
		// Create a line on both top and bottom of the range
		linePath = [].concat(lowerPath, higherPath);
		
		// For the area path, we need to change the 'move' statement into 'lineTo' or 'curveTo'
		if (!this.chart.polar) {
			higherPath[0] = 'L'; // this probably doesn't work for spline
		}
		this.areaPath = this.areaPath.concat(lowerPath, higherPath);
		
		return linePath;
	}
729134
function () {
		var series = this,
			yAxis = series.yAxis;

		seriesTypes.area.prototype.translate.apply(series);

		// Set plotLow and plotHigh
		each(series.points, function (point) {

			var low = point.low,
				high = point.high,
				plotY = point.plotY;

			if (high === null && low === null) {
				point.y = null;
			} else if (low === null) {
				point.plotLow = point.plotY = null;
				point.plotHigh = yAxis.translate(high, 0, 1, 0, 1);
			} else if (high === null) {
				point.plotLow = plotY;
				point.plotHigh = null;
			} else {
				point.plotLow = plotY;
				point.plotHigh = yAxis.translate(high, 0, 1, 0, 1);
			}
		});

		// Postprocess plotHigh
		if (this.chart.polar) {
			each(this.points, function (point) {
				series.highToXY(point);
			});
		}
	}
612618
def draw(svg, coords, options={})
      # Check whether to use color from theme, or whether to use user defined colors from the area_colors array
      color_count = nil
      if @area_colors && @area_colors.size > 0
        area_color = @area_colors[0]
        color_count = 1
      else
        puts "Never Set Area Color"
        area_color = color
      end

      # Draw Bottom Level Polygons (Original Coords)
      draw_poly(svg, coords, area_color, options = {})

      # Draw Lower Area Polygons
      if @baselines
        # Get the Color of this Area
        puts "Drawing Baselines"
        @baselines.sort! {|x,y| y <=> x }
        @baselines.each do |baseline|
          if color_count
            area_color = area_colors[color_count]
            color_count = color_count + 1
            puts area_color.to_s
            if color_count >= area_colors.size
              color_count = 0
            end
          end

          lower_poly_coords = create_lower_polygon_coords(translate_number(baseline), coords, options)
          draw_poly(svg, lower_poly_coords, area_color, options = {})
        end
      end
    end
59312
function () {
		var series = this,
			chart = series.chart,
			group,
			setInvert,
			options = series.options,
			animation = options.animation,
			doAnimation = animation && series.animate,
			duration = doAnimation ? (animation && animation.duration) || 500 : 0,
			clipRect = series.clipRect,
			renderer = chart.renderer;


		// Add plot area clipping rectangle. If this is before chart.hasRendered,
		// create one shared clipRect.
		if (!clipRect) {
			clipRect = series.clipRect = !chart.hasRendered && chart.clipRect ?
				chart.clipRect :
				renderer.clipRect(0, 0, chart.plotSizeX, chart.plotSizeY);
			if (!chart.clipRect) {
				chart.clipRect = clipRect;
			}
		}


		// the group
		if (!series.group) {
			group = series.group = renderer.g('series');

			if (chart.inverted) {
				setInvert = function () {
					group.attr({
						width: chart.plotWidth,
						height: chart.plotHeight
					}).invert();
				};

				setInvert(); // do it now
				addEvent(chart, 'resize', setInvert); // do it on resize
				addEvent(series, 'destroy', function () {
					removeEvent(chart, 'resize', setInvert);
				});
			}
			group.clip(series.clipRect)
				.attr({
					visibility: series.visible ? VISIBLE : HIDDEN,
					zIndex: options.zIndex
				})
				.translate(chart.plotLeft, chart.plotTop)
				.add(chart.seriesGroup);
		}

		series.drawDataLabels();

		// initiate the animation
		if (doAnimation) {
			series.animate(true);
		}

		// cache attributes for shapes
		//series.getAttribs();

		// draw the graph if any
		if (series.drawGraph) {
			series.drawGraph();
		}

		// draw the points
		series.drawPoints();

		// draw the mouse tracking area
		if (series.options.enableMouseTracking !== false) {
			series.drawTracker();
		}

		// run the animation
		if (doAnimation) {
			series.animate();
		}

		// finish the individual clipRect
		setTimeout(function () {
			clipRect.isAnimating = false;
			group = series.group; // can be destroyed during the timeout
			if (group && clipRect !== chart.clipRect && clipRect.renderer) {
				group.clip((series.clipRect = chart.clipRect));
				clipRect.destroy();
			}
		}, duration);


		series.isDirty = false; // means data is in accordance with what you see

	}
961655
function() {
        const bounds = this._pixelBounds();
        const pixelSize = (bounds.max.x - bounds.min.x) / this._field.nCols;

        var stride = Math.max(
            1,
            Math.floor(1.2 * this.options.vectorSize / pixelSize)
        );

        const ctx = this._getDrawingContext();
        ctx.strokeStyle = this.options.color;

        var currentBounds = this._map.getBounds();

        for (var y = 0; y < this._field.height; y = y + stride) {
            for (var x = 0; x < this._field.width; x = x + stride) {
                let [lon, lat] = this._field._lonLatAtIndexes(x, y);
                let v = this._field.valueAt(lon, lat);
                let center = L.latLng(lat, lon);
                if (v !== null && currentBounds.contains(center)) {
                    let cell = new Cell(
                        center,
                        v,
                        this.cellXSize,
                        this.cellYSize
                    );
                    this._drawArrow(cell, ctx);
                }
            }
        }
    }
302930
function() {
            var self = this,
                treeSize = {
                    x: self.nodeDB.getMinMaxCoord('X', null, null),
                    y: self.nodeDB.getMinMaxCoord('Y', null, null)
                },

                treeWidth = treeSize.x.max - treeSize.x.min,
                treeHeight = treeSize.y.max - treeSize.y.min,

                treeCenter = {
                    x: treeSize.x.max - treeWidth/2,
                    y: treeSize.y.max - treeHeight/2
                };

            this.handleOverflow(treeWidth, treeHeight);

            var
                containerCenter = {
                    x: self.drawArea.clientWidth/2,
                    y: self.drawArea.clientHeight/2
                },

                deltaX = containerCenter.x - treeCenter.x,
                deltaY = containerCenter.y - treeCenter.y,

                // all nodes must have positive X or Y coordinates, handle this with offsets
                negOffsetX = ((treeSize.x.min + deltaX) <= 0) ? Math.abs(treeSize.x.min) : 0,
                negOffsetY = ((treeSize.y.min + deltaY) <= 0) ? Math.abs(treeSize.y.min) : 0,
                i, len, node;

            // position all the nodes
            for ( i = 0, len = this.nodeDB.db.length; i < len; i++ ) {

                node = this.nodeDB.get(i);

                self.CONFIG.callback.onBeforePositionNode.apply( self, [node, i, containerCenter, treeCenter] );

                if ( node.id === 0 && this.CONFIG.hideRootNode ) {
                    self.CONFIG.callback.onAfterPositionNode.apply( self, [node, i, containerCenter, treeCenter] );
                    continue;
                }

                // if the tree is smaller than the draw area, then center the tree within drawing area
                node.X += negOffsetX + ((treeWidth < this.drawArea.clientWidth) ? deltaX : this.CONFIG.padding);
                node.Y += negOffsetY + ((treeHeight < this.drawArea.clientHeight) ? deltaY : this.CONFIG.padding);

                var collapsedParent = node.collapsedParent(),
                    hidePoint = null;

                if (collapsedParent) {
                    // position the node behind the connector point of the parent, so future animations can be visible
                    hidePoint = collapsedParent.connectorPoint( true );
                    node.hide(hidePoint);

                }
                else if (node.positioned) {
                    // node is already positioned,
                    node.show();
                }
                else { // inicijalno stvaranje nodeova, postavi lokaciju
                    node.nodeDOM.style.left = node.X + 'px';
                    node.nodeDOM.style.top = node.Y + 'px';
                    node.positioned = true;
                }

                if (node.id !== 0 && !(node.parent().id === 0 && this.CONFIG.hideRootNode)) {
                    this.setConnectionToParent(node, hidePoint); // skip the root node
                }
                else if (!this.CONFIG.hideRootNode && node.drawLineThrough) {
                    // drawlinethrough is performed for for the root node also
                    node.drawLineThroughMe();
                }

                self.CONFIG.callback.onAfterPositionNode.apply( self, [node, i, containerCenter, treeCenter] );
            }
            return this;
        }
1248896
function () {
		var series = this,
			graphPath = [],
			segmentPath,
			singlePoints = []; // used in drawTracker

		// Divide into segments and build graph and area paths
		each(series.segments, function (segment) {
			
			segmentPath = series.getSegmentPath(segment);
			
			// add the segment to the graph, or a single point for tracking
			if (segment.length > 1) {
				graphPath = graphPath.concat(segmentPath);
			} else {
				singlePoints.push(segment[0]);
			}
		});

		// Record it for use in drawGraph and drawTracker, and return graphPath
		series.singlePoints = singlePoints;
		series.graphPath = graphPath;
		
		return graphPath;
		
	}
1033586
function () {
		var series = this;

		// cache attributes for shapes
		//series.getAttribs();

		this.drawPoints();

		// draw the mouse tracking area
		if (series.options.enableMouseTracking !== false) {
			series.drawTracker();
		}
        
        // PATCH by Simon Fishel
        //
        // execute beforeLabelRender hook to allow re-formatting of data labels
        //
        // + if(series.options.hooks && series.options.hooks.beforeLabelRender) {
        // +    series.options.hooks.beforeLabelRender(series)
        // + }
        
        if(series.options.hooks && series.options.hooks.beforeLabelRender) {
            series.options.hooks.beforeLabelRender(series)
        }

		this.drawDataLabels();

		if (series.options.animation && series.animate) {
			series.animate();
		}

		series.isDirty = false; // means data is in accordance with what you see
	}
1225362
function drawBrush() {
            chartBrush = svg.select('.brush-group')
                                .call(brush);

            // Update the height of the brushing rectangle
            chartBrush.selectAll('rect')
                .classed('brush-rect', true)
                .attr('height', chartHeight);

            chartBrush.selectAll('.selection')
                .attr('fill', `url(#${gradientId})`);
        }
986630
function () {
            var series = this,
              chart = series.chart,
              options = series.options,
              borderWidth = series.borderWidth = pick(
                options.borderWidth,
                series.activePointCount > 0.5 * series.xAxis.len ? 0 : 1
              ),
              yAxis = series.yAxis,
              threshold = options.threshold,
              translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),
              minPointLength = pick(options.minPointLength, 5),
              metrics = series.getColumnMetrics(),
              pointWidth = metrics.width,
              seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width
              pointXOffset = series.pointXOffset = metrics.offset,
              xCrisp = -(borderWidth % 2 ? 0.5 : 0),
              yCrisp = borderWidth % 2 ? 0.5 : 1;

            if (chart.renderer.isVML && chart.inverted) {
                yCrisp += 1;
            }

            // When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual
            // columns to have individual sizes. When pointPadding is greater, we strive for equal-width
            // columns (#2694).
            if (options.pointPadding) {
                seriesBarW = mathCeil(seriesBarW);
            }

            Series.prototype.translate.apply(series);

            // Record the new values
            each(series.points, function (point) {
                var yBottom = pick(point.yBottom, translatedThreshold),
                  plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)
                  barX = point.plotX + pointXOffset,
                  barW = seriesBarW,
                  barY = mathMin(plotY, yBottom),
                  right,
                  bottom,
                  fromTop,
                  barH = mathMax(plotY, yBottom) - barY;

                // Handle options.minPointLength
                if (mathAbs(barH) < minPointLength) {
                    if (minPointLength) {
                        barH = minPointLength;
                        barY =
                          mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked
                          yBottom - minPointLength : // keep position
                          translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)
                    }
                }

                // Cache for access in polar
                point.barX = barX;
                point.pointWidth = pointWidth;

                // Fix the tooltip on center of grouped columns (#1216, #424)
                point.tooltipPos = chart.inverted ?
                  [yAxis.len - plotY, series.xAxis.len - barX - barW / 2] :
                  [barX + barW / 2, plotY + yAxis.pos - chart.plotTop];

                // Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)
                right = mathRound(barX + barW) + xCrisp;
                barX = mathRound(barX) + xCrisp;
                barW = right - barX;

                fromTop = mathAbs(barY) < 0.5;
                bottom = mathRound(barY + barH) + yCrisp;
                barY = mathRound(barY) + yCrisp;
                barH = bottom - barY;

                // Top edges are exceptions
                if (fromTop) {
                    barY -= 1;
                    barH += 1;
                }

                // Register shape type and arguments to be used in drawPoints
                point.shapeType = 'rect';
                point.shapeArgs = {
                    x: barX,
                    y: barY,
                    width: barW,
                    height: barH
                };

            });

        }
726952
function _drawLine(v0, v1, color) {
        var p = new Primitive();

        p.vertices = [v0, v1];
        p.color = toColor(color);

        renderer.addPrimitive(p);
    }
884648
function drawLinearTick(context, x1, y1, x2, y2) {
    context.beginPath();

    context.moveTo(x1, y1);
    context.lineTo(x2, y2);
    context.stroke();

    context.closePath();
    context.save();
}