Returns the SVG code part rendering the current polygon.

@throws \RuntimeException If amount of point is less than 3.
@access public
@return void
160350
public function svg()
    {
        if (count($this->arr_points) < 3) {
            throw new \RuntimeException('Before exporting to SVG, you must give at least 3 points!');
        }

        $arr = array();

        foreach ($this->arr_points as $point) {
            $arr[] = implode(',', $point);
        }

        $str_attr_points = implode(' ', $arr);

        return sprintf('<polygon points="%s" style="fill:%s" />', $str_attr_points, $this->color);
    }
231036
function renderComponent() {
    const data = [[0.1, 0.15], [0.2, 0.3], [0.4, 0.6], [0.8, 0.9]];
    var svg = d3.select('svg')
      .datum(data);
    svg.select('.horizontal')
      .call(horizontalSvgBand);
    svg.select('.vertical')
      .call(verticalSvgBand);

    var canvas = d3.select('canvas').node();
    var ctx = canvas.getContext('2d');
    horizontalCanvasBand.context(ctx)(data);
    verticalCanvasBand.context(ctx)(data);
}
1100794
public function convexHull(): Geometry {
        $event = new ProcessOpEvent($this);
        $this->fireOperationEvent(ProcessOpEvent::CONVEX_HULL_EVENT, $event);
        return $event->getResults();
    }
1138637
private function getSubdivision()
    {
        if (null === $this->subdivision) {
            $this->subdivision = $this->loadXml($this->subdivisionFile);
        }

        return $this->subdivision;
    }
171499
public function run()
    {
        if ($this->renderSidenav) {
            $sidenavId = $this->getUniqueId('sidenav_');
            $this->initSidenav($sidenavId);
        }

        $html = [];
        $html[] = Html::endTag('div'); // container

        if ($this->renderSidenav) {
            $html[] = $this->renderSidenavToggleButton();
        }

        $html[] = Html::endTag('div'); // nav-wrapper

        $html[] = Html::endTag('nav');

        if ($this->fixed) {
            $html[] = Html::endTag('div');
        }

        if ($this->renderSidenav) {
            $html[] = $this->renderSidenav($sidenavId);
        }

        return implode("\n", $html);
    }
542394
protected function svg():string{
		$matrix = $this->matrix->matrix();

		$svg = \sprintf($this->svgHeader, $this->options->cssClass, $this->options->svgViewBoxSize ?? $this->moduleCount)
		       .$this->options->eol
		       .'<defs>'.$this->options->svgDefs.'</defs>'
		       .$this->options->eol;

		foreach($this->moduleValues as $M_TYPE => $value){
			$path = '';

			foreach($matrix as $y => $row){
				//we'll combine active blocks within a single row as a lightweight compression technique
				$start = null;
				$count = 0;

				foreach($row as $x => $module){

					if($module === $M_TYPE){
						$count++;

						if($start === null){
							$start = $x;
						}

						if($row[$x + 1] ?? false){
							continue;
						}
					}

					if($count > 0){
						$len = $count;
						$path .= 'M' .$start. ' ' .$y. ' h'.$len.' v1 h-'.$len.'Z ';

						// reset count
						$count = 0;
						$start = null;
					}

				}

			}

			if(!empty($path)){
				$svg .= '<path class="qr-'.$M_TYPE.' '.$this->options->cssClass.'" stroke="transparent" fill="'.$value.'" fill-opacity="'.$this->options->svgOpacity.'" d="'.$path.'" />';
			}

		}

		// close svg
		$svg .= '</svg>'.$this->options->eol;

		// if saving to file, append the correct headers
		if($this->options->cachefile){
			return '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'.$this->options->eol.$svg;
		}

		return $svg;
	}
1155937
public function getAbsolute(){
		if( empty( $this->parts->scheme ) )
			throw new RuntimeException( 'HTTP scheme not set' );
		if( empty( $this->parts->host ) )
			throw new RuntimeException( 'HTTP host not set' );
		$buffer	= array();
		if( $this->parts->scheme )
			$buffer[]	= $this->parts->scheme.'://';
		if( $this->parts->user ){
			$buffer[]	= $this->parts->user;
			if( $this->parts->pass )
				$buffer[]	= ':'.$this->parts->pass;
			$buffer[]	= '@';
		}
		if( $this->parts->host )
			$buffer[]	= $this->parts->host;
		if( $this->parts->port )
			$buffer[]	= ':'.$this->parts->port;
		if( $this->parts->path )
			$buffer[]	= $this->parts->path;
		if( $this->parts->query )
			$buffer[]	= '?'.$this->parts->query;
		if( $this->parts->fragment )
			$buffer[]	= '#'.$this->parts->fragment;
		return join( '', $buffer );
	}
397229
public function current()
	{
		$fact = parent::current();
		if ( $fact )
		{
			if ( ! $this->uncoveredAspectFacts )
			{
				$coveredFact = $fact;

				if ( $this->var->bindAsSequence )
				{
					if ( $coveredFact instanceof XPath2NodeIterator )
					{
						// Get the first item
						$coveredFact->rewind();
						$coveredFact = $coveredFact->current();  // Should be DOMXPathNavigator
					}
				}

				$this->uncoveredAspectFacts = array_fill_keys( $this->aspectsDefined, $coveredFact );
				$this->uncoveredAspectFacts = array_merge( $this->uncoveredAspectFacts, array_fill_keys( $this->aspectsCovered, null ) );
			}
		}

		return $fact;
	}
783018
private void render(SVG.Polygon obj)
   {
      debug("Polygon render");

      updateStyleForElement(state, obj);

      if (!display())
         return;
      if (!visible())
         return;
      if (!state.hasStroke && !state.hasFill)
         return;

      if (obj.transform != null)
         canvas.concat(obj.transform);

      int  numPoints = obj.points.length;
      if (numPoints < 2)
         return;

      Path  path = makePathAndBoundingBox(obj);
      updateParentBoundingBox(obj);

      checkForGradientsAndPatterns(obj);
      checkForClipPath(obj);
      
      boolean  compositing = pushLayer();

      if (state.hasFill)
         doFilledPath(obj, path);
      if (state.hasStroke)
         doStroke(path);

      renderMarkers(obj);

      if (compositing)
         popLayer(obj);
   }
1033061
public function getCode() {
        $result = '';

        if ($this->options->getRenderContextDirective()) {
            $result .= $this->renderedCode->getContextDirective();
        }
        if ($this->options->getRenderDirectives()) {
            $result .= $this->renderedCode->getDirectives();
        }
        if ($this->options->getRenderGlobalCode()) {
            $result .= $this->renderedCode->getGlobalCode();
        }
        if ($this->options->getRenderMainFunction()) {
            $result .= $this->renderedCode->getMainFunction();
        }

        if ($this->options->getCompress()) {
            $result = $this->compress($result);
        }
        if ($this->options->getIncludeScriptTag()) {
            $result = $this->addScriptTag($result);
        }

        return $result;
    }
267986
function() {

      var widthBy2 = this.width / 2,
          heightBy2 = this.height / 2;

      var points = [
        -widthBy2 + " " + heightBy2,
        "0 " + -heightBy2,
        widthBy2 + " " + heightBy2
      ].join(",");

      return '<polygon ' +
              'points="' + points + '" ' +
              'style="' + this.getSvgStyles() + '" ' +
              'transform="' + this.getSvgTransform() + '" ' +
              '/>';
    }
856084
public function tell()
    {
        if (is_resource($this->stream) !== false) {
            $position = ftell($this->stream);
            if ($position !== false) {
                return $position;
            }
        }
        throw new RuntimeException('Could not get the position of the pointer in stream');
    }
409163
public function getRawSvg()
		{
			$lib = array();
			$svg = array();
			
			$aggregate_paths = array();
			
			foreach ($this->paths as $path) {
				switch ($path[0]) {
					case QR_AREA_PATH:
							$pNum = 0;
							
							foreach($path[1] as $pathDetails) {
								
								$px = array_shift($pathDetails);
								$py = array_shift($pathDetails);
								$rle_steps = array_shift($pathDetails);
								
								$aggregate_add = 'M'.$px.','.$py.' ';
								
								while(count($rle_steps) > 0) {
								
									$delta = 1;
									
									$operator = array_shift($rle_steps);
									if (($operator != 'R') && ($operator != 'L') && ($operator != 'T') && ($operator != 'B')) {
										$delta = (int)$operator;
										$operator = array_shift($rle_steps);
									}
									
									if ($operator == 'R') $aggregate_add .= 'h'.$delta;
									if ($operator == 'L') $aggregate_add .= 'h-'.$delta;
									if ($operator == 'T') $aggregate_add .= 'v-'.$delta;
									if ($operator == 'B') $aggregate_add .= 'v'.$delta;
								}
								
								$aggregate_paths[] = $aggregate_add;
								
								$pNum++;
							}
	
						break;
					case QR_AREA_POINT:
								
							$symb = array_shift($path);
							
							while(count($path) > 0) {
								$px = array_shift($path);
								$py = array_shift($path);
								
								$aggregate_paths[] = 'M'.$px.','.$py.' v1h1v-1h-1';
							}
							
						break;
						
					case QR_AREA_RECT:
							
							$symb = array_shift($path);
							
							while(count($path) > 0) {
								$px = array_shift($path);
								$py = array_shift($path);
								$ex = array_shift($path);
								$ey = array_shift($path);
								
								$w = $ex-$px;
								$h = $ey-$py;
								
								$aggregate_paths[] = 'M'.$px.','.$py.' h'.$w.'v'.$h.'h-'.$w.'v-'.$h;
							}
							
						break;						
						
					case QR_AREA_LSHAPE:
								
							$symb = array_shift($path);
							
							$l_shapes[0] = 'm1,0h1v2h-2v-1h1z';
							$l_shapes[1] = 'h1v1h1v1h-2z';
							$l_shapes[2] = 'h2v2h-1v-1h-1z';
							$l_shapes[3] = 'h2v1h-1v1h-1z';
							
							while(count($path) > 0) {
								$px = array_shift($path);
								$py = array_shift($path);
								$mode = (int)array_shift($path);
								
								$aggregate_paths[] =  'M'.$px.','.$py.' '.$l_shapes[$mode];
							}
								
						break;	
						
					case QR_AREA_TRACKER:
								
							if (!isset($lib['tracker'])) {
								$lib['tracker'] = '<symbol id="tracker"><path d="m 0 7 0 7 7 0 0 -7 -7 0 z m 1 1 5 0 0 5 -5 0 0 -5 z m 1 1 0 3 3 0 0 -3 -3 0 z" style="fill:#000000;stroke:none"></path></symbol>';
							}
							
							$symb = array_shift($path);
							
							$px = array_shift($path);
							$py = array_shift($path);
								
							$svg[] = '<use x="'.$px.'" y="'.($py-7).'" xlink:href="#tracker"></use>';
									
						break;	
				}
			}
			
			$svg[] = '<path d="'.join(' ', $aggregate_paths).'" style="fill:#000000;stroke:none" ></path>';
							

			
			return join("\n", $lib)."\n".join("\n", $svg);
		}
106640
public function getMap()
    {
        $vertices = array();
        foreach ($this->vertices as $vertex) {
            $vertices[$vertex->getId()] = $vertex;
        }
        return $vertices;
    }
415249
private function _renderLegend() {
		$legend = $this->_chart->getLegend();
		if (!is_null($legend)) {
			$legendPosition = $legend->getPosition();
			$legendOverlay = $legend->getOverlay();
			switch ($legendPosition) {
				case 'r'	:
					$this->_graph->legend->SetPos(0.01,0.5,'right','center');	//	right
					$this->_graph->legend->SetColumns(1);
					break;
				case 'l'	:
					$this->_graph->legend->SetPos(0.01,0.5,'left','center');	//	left
					$this->_graph->legend->SetColumns(1);
					break;
				case 't'	:
					$this->_graph->legend->SetPos(0.5,0.01,'center','top');	//	top
					break;
				case 'b'	:
					$this->_graph->legend->SetPos(0.5,0.99,'center','bottom');	//	bottom
					break;
				default		:
					$this->_graph->legend->SetPos(0.01,0.01,'right','top');	//	top-right
					$this->_graph->legend->SetColumns(1);
					break;
			}
		} else {
			$this->_graph->legend->Hide();
		}
	}
1141161
public function render()
    {
        $dropzoneAttributes = array_diff_key($this->field->attributes, array_flip(['class']));

        if (!isset($dropzoneAttributes['container'])) {
            throw new RuntimeException('Invalid Dropzone Container Id');
        }
        $this->field->attributes = ['class' => $this->field->attributes['class']];

        $id             = $dropzoneAttributes['container'];
        $view           = isset($dropzoneAttributes['view']) ? $dropzoneAttributes['view'] : 'antares/foundation::widgets.forms.dropzone';
        $name           = $dropzoneAttributes['paramName'];
        $successDefault = <<<CBALL
        this.on("success", function(file,response) {        
            $('#$id').parent().find('input[name=$name]').val(response.path);
            %s 
            %s    
        }); 
CBALL;
        $afterLoad      = isset($dropzoneAttributes['previewsContainer']) ? $this->onSuccessDefault($id) : '';
        $onSuccess      = isset($dropzoneAttributes['onSuccess']) ? $dropzoneAttributes['onSuccess'] : '';
        $afterUpload    = sprintf($successDefault, $afterLoad, $onSuccess);


        $params = array_merge([
            'autoProcessQueue' => true,
            'uploadMultiple'   => false,
            'maxFiles'         => 100,
            'thumbnailWidth'   => 120,
            'thumbnailHeight'  => 120,
            'parallelUploads'  => 20,
            'init'             => new JavaScriptExpression(sprintf($this->onInit($dropzoneAttributes), $afterUpload))], $dropzoneAttributes);


        $cball        = <<<CBALL
(function(window,$){Dropzone.autoDiscover = false; Dropzone.options.%s = %s; %s })(window,jQuery);

CBALL;
        $attach       = <<<CBALL
                     $('#{$id}').dropzone(Dropzone.options.$id);
CBALL;
        $inlineScript = sprintf($cball, $id, JavaScriptDecorator::decorate(array_except($params, ['view', 'container', 'onSuccess'])), $attach);
        $this->asset->container('antares/foundation::scripts')->inlineScript('dropzone-' . $id, $inlineScript);
        $attributes   = $this->html->decorate($this->field->get('attributes'), ['class' => 'form-control']);
        $input        = $this->form->input('hidden', $params['paramName'], $this->field->get('value'), ['id' => $id . 'Container']);
        return view($view, ['field' => $this->field, 'attributes' => $attributes, 'params' => $params, 'input' => $input, 'id' => $id]);
    }
1041705
public function tell(){
        if(null === $this->resource){
            throw new Exception\StreamUnavailableException(
                static::EXCEPTION_MSG_UNAVAILABLE
            );
        }

        if(false === ($point = ftell($this->resource))){
            throw new \RuntimeException("Failed to get file pointer position.");
        }

        return $point;
    }