Returns a GraphViz DOT graph to represent the circular dependency found. A PNG image can be generated using
this command: `dot -Tpng input.dot output.png`

@see https://en.wikipedia.org/wiki/DOT_(graph_description_language)

@return string
969256
public function getDotGraph() : string {
		$escapeClassName = function(string $class) : string {
			return '"' . \str_replace('\\', '\\\\', $class) . '"';
		};

		$dotData = 'digraph modules {' . PHP_EOL;
		foreach ($this->modules as $moduleSpec) {
			$module = $moduleSpec['object'];
			if ($module instanceof OrderAwareModule) {
				foreach ($module->getModulesBefore() as $moduleBeforeClass) {
					$dotData .= '    ' . $escapeClassName($moduleBeforeClass) . ' -> ' .
						$escapeClassName($moduleSpec['class']) . ';' . PHP_EOL;
				}
				foreach ($module->getModulesAfter() as $moduleAfterClass) {
					$dotData .= '    ' . $escapeClassName($moduleSpec['class']) . ' -> ' .
						$escapeClassName($moduleAfterClass) . ';' . PHP_EOL;
				}
			} else {
				$dotData .= '    ' . $escapeClassName($moduleSpec['class']) . ';' . PHP_EOL;
			}
		}
		$dotData .= '}';

		return $dotData;
	}
493334
public function getOrderedProcesses()
    {
        $graph = new DependencyGraph();
        $root = new DependencyGraphNode(self::ROOT_NODE_NAME);
        $graph->addRoot($root);

        $processes = $this->getProcesses();
        $nodes = [];
        foreach ($processes as $process) {
            $processName = $this->getProcessName($process);
            $node = new DependencyGraphNode($processName);
            $graph->addDependency($root, $node);
            $nodes[$processName] = [$process, $node];
        }

        foreach ($nodes as $processName => $nodeDescription) {
            list($process, $node) = $nodeDescription;
            if (!$process instanceof DependentChainProcessInterface) {
                $graph->addDependency($root, $node);
                continue;
            }

            foreach ($process->dependsOn() as $dependencyName) {
                if (!array_key_exists($dependencyName, $nodes)) {
                    throw new UnresolvedDependencyException(sprintf(
                        'Process "%s" is dependent of "%s" which is not found',
                        $processName,
                        $dependencyName
                    ));
                }

                if ($graph->addDependency($node, $nodes[$dependencyName][1]) instanceof Left) {
                    throw new CircularDependencyException(sprintf(
                        'Circular dependency found: %s already depends on %s',
                        $dependencyName, $processName
                    ));
                }
            }
        }

        return array_map(function ($nodeName) use ($nodes) {
            return $nodes[$nodeName][0];
        }, array_filter($graph->flatten(), function ($nodeName) {
            return $nodeName !== self::ROOT_NODE_NAME;
        }));
    }
453159
protected function getMask()
    {

        $w = imagesx($this->driver->getResource());
        $h = imagesy($this->driver->getResource());
        $m = min($w, $h);

        $bg = imagecreatetruecolor($w, $h);

        $bg = $this->drawCirlce($bg, $w, $h, 255, 255, 255, 0);

        return $bg;
    }
809439
public function svg()
    {
        $str_g = '';

        $bg = new Primitive\Square();
        $bg->point(0, 0)->size(self::SIZE);
        $bg->color($this->bg());

        $str_g .= $bg->svg();

        foreach ($this->arr_primitives as $p) {
            $str_g .= $p->svg();
        }

        return $str_g;
    }
1268027
def html_output_graph(self, node):
    
    graph = node['graph']
    parts = node['parts']

    graph_hash = get_graph_hash(node)
    name = "inheritance%s" % graph_hash
    path = '_images'
    dest_path = os.path.join(setup.app.builder.outdir, path)
    if not os.path.exists(dest_path):
        os.makedirs(dest_path)
    png_path = os.path.join(dest_path, name + ".png")
    path = setup.app.builder.imgpath

    # Create a mapping from fully-qualified class names to URLs.
    urls = {}
    for child in node:
        if child.get('refuri') is not None:
            urls[child['reftitle']] = child.get('refuri')
        elif child.get('refid') is not None:
            urls[child['reftitle']] = '#' + child.get('refid')

    # These arguments to dot will save a PNG file to disk and write
    # an HTML image map to stdout.
    image_map = graph.run_dot(['-Tpng', '-o%s' % png_path, '-Tcmapx'],
                              name, parts, urls)
    return ('<img src="%s/%s.png" usemap="#%s" class="inheritance"/>%s' %
            (path, name, name, image_map))
1286445
def graph_png(self):
        
        if not self.out_file:
            ui.error(c.MESSAGES["png_missing_out"])
            sys.exit(1)

        cli_flags = "-Gsize='{0}' -Gdpi='{1}' {2} ".format(self.size, self.dpi,
                                                           self.flags)
        cli_flags += "-o {0}".format(self.out_file)

        (out, err) = utils.capture_shell(
            "ansigenome export -t graph -f dot | dot -Tpng {0}"
            .format(cli_flags))

        if err:
            ui.error(err)
829375
public function getFileSortOrder()
    {
        $fileSortOrder = $this->getCachedValue('fileSortOrder');
        if ($fileSortOrder === false) {

            $data = $this->dataProvider->getData();

            $fileSortOrder = array();

            // get flat list of file dependencies for each file
            $dependsInfo = $this->getDependsInfo();

            // build into graph
            $graph = new Concentrate_Graph();
            $nodes = array();
            foreach ($dependsInfo as $file => $dependencies) {
                if (!isset($nodes[$file])) {
                    $nodes[$file] = new Concentrate_Graph_Node(
                        $graph,
                        $file
                    );
                }
                foreach ($dependencies as $dependentFile) {
                    if (!isset($nodes[$dependentFile])) {
                        $nodes[$dependentFile] = new Concentrate_Graph_Node(
                            $graph,
                            $dependentFile
                        );
                    }
                }
            }
            foreach ($dependsInfo as $file => $dependencies) {
                foreach ($dependencies as $dependentFile) {
                    $nodes[$file]->connectTo($nodes[$dependentFile]);
                }
            }

            // add combines to graph
            $combinesInfo = $this->getCombinesInfo();
            foreach ($combinesInfo as $combine => $combineInfo) {

                $files = $combineInfo['Includes'];

                if (!isset($nodes[$combine])) {
                    $nodes[$combine] = new Concentrate_Graph_Node(
                        $graph,
                        $combine
                    );
                }

                // get combine dependencies as difference of union of
                // dependencies of contained files and combined set
                $depends = array();
                foreach ($files as $file => $info) {
                    if (isset($dependsInfo[$file])) {
                        $depends = array_merge(
                            $dependsInfo[$file],
                            $depends
                        );
                    }
                }
                $depends = array_diff($depends, array_keys($files));
                foreach ($depends as $depend) {
                    $nodes[$combine]->connectTo($nodes[$depend]);
                }

                // add combine as dependency of all contained files
                foreach ($files as $file => $info) {
                    if (!isset($nodes[$file])) {
                        $nodes[$file] = new Concentrate_Graph_Node(
                            $graph,
                            $file
                        );
                    }
                    $nodes[$file]->connectTo($nodes[$combine]);
                }
            }

            $sorter = new Concentrate_Graph_TopologicalSorter();
            try {
                $sortedNodes = $sorter->sort($graph);
            } catch (Concentrate_CyclicDependencyException $e) {
                throw new Concentrate_CyclicDependencyException(
                    'File dependency order can not be determined because '
                    . 'file dependencies contain one more more cycles. '
                    . 'There is likely a typo in the provides section of one '
                    . 'or more YAML files.'
                );
            }

            $fileSortOrder = array();
            foreach ($sortedNodes as $node) {
                $fileSortOrder[] = $node->getData();
            }

            // Flip the sorted array so it is indexed by file with values
            // being the relative sort order.
            $fileSortOrder = array_flip($fileSortOrder);

            $this->setCachedValue('fileSortOrder', $fileSortOrder);
        }

        return $fileSortOrder;
    }
579792
public static function getRelativePathDotDot($path, $base)
    {
        // Normalize paths.
        $base = preg_replace('![\\\/]+!', '/', $base);
        $path = preg_replace('![\\\/]+!', '/', $path);

        if ($path === $base) {
            return '';
        }

        $baseParts = explode('/', ltrim($base, '/'));
        $pathParts = explode('/', ltrim($path, '/'));

        array_pop($baseParts);
        $lastPart = array_pop($pathParts);
        foreach ($baseParts as $i => $directory) {
            if (isset($pathParts[$i]) && $pathParts[$i] === $directory) {
                unset($baseParts[$i], $pathParts[$i]);
            } else {
                break;
            }
        }
        $pathParts[] = $lastPart;
        $path = str_repeat('../', count($baseParts)) . implode('/', $pathParts);

        return '' === $path
        || strpos($path, '/') === 0
        || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos)
            ? "./$path" : $path;
    }
1268327
public static function getGlyphiconBreadcrumbNodes() {

        $breadcrumbNodes = [];

        $breadcrumbNodes[] = new BreadcrumbNode("label.edit_profile", "g:user", "fos_user_profile_edit", NavigationInterface::NAVIGATION_MATCHER_ROUTER);
        $breadcrumbNodes[] = new BreadcrumbNode("label.show_profile", "g:user", "fos_user_profile_show", NavigationInterface::NAVIGATION_MATCHER_ROUTER);
        $breadcrumbNodes[] = new BreadcrumbNode("label.change_password", "g:lock", "fos_user_change_password", NavigationInterface::NAVIGATION_MATCHER_ROUTER);

        return $breadcrumbNodes;
    }
962682
public function getData()
    {
        if ( $this->ContentObjectAttribute->hasContent() )
        {
            $imageAliasHandler = $this->ContentObjectAttribute->attribute( 'content' );
            $imageAlias = $imageAliasHandler->imageAlias( 'opengraph' );

            if ( $imageAlias['is_valid'] == 1 )
            {
                return eZSys::serverURL() . '/' . $imageAlias['full_path'];
            }
        }

        return eZSys::serverURL() . eZURLOperator::eZImage( null, 'opengraph_default_image.png', '' );
    }
775137
public function icon()
	{
		$input = [
			[icon('plane'),                  "icon('plane');",               ],
			[icon('bolt'),                   "icon('bolt');",                ],
			[icon('bolt', '#FF00FF'),        "icon('bolt', '#FF00FF');",     ],
			[icon('info', 'info'),           "icon('info', 'info');",        ],
			[icon(true),                     "icon(true);",                  ],
			[icon(false),                    "icon(false);",                 ],
		];
		$data = array_reduce($input, function ($output, $arr)
		{
			$output[] = (object) ['code' => $arr[1], 'icon' => $arr[0]];
			return $output;
		}, []);
		return view('sketchpad::help/helpers/icon', compact('data'));
	}
1143071
public function asEndpoint()
    {
        $graphVersionPrefix = '';
        if ($this->graphVersion) {
            $graphVersionPrefix = '/'.$this->graphVersion;
        }

        return $graphVersionPrefix.$this->graphNode->asUrl($this->appSecret);
    }
1127841
private function getPatternId() : string
    {
        return sprintf(
            '%s::u%d::c%d::d%s::p%s',
            $this->patternId['division'],
            $this->patternId['useragent'],
            $this->patternId['child'],
            $this->patternId['device'],
            $this->patternId['platform']
        );
    }
834575
public function getEdgesOut()
    {
        $that = $this;

        return $this->getEdges()->getEdgesMatch(function (Edge $edge) use ($that) {
            return $edge->hasVertexStart($that);
        });
    }
414943
public function getThumb()
    {
        $image = $this->node
            ->filter('.item_imagePic .lazyload[data-imgsrc]')
            ->first();

        if (0 === $image->count()) {
            return null;
        }

        $src = $image
            ->attr('data-imgsrc');

        return (string)Http::createFromString($src)->withScheme('https');
    }
666554
public function exportDot($debug_opts = false)
	{
		ob_start();

		// DOT Header
		echo	"#\n",
			"# State machine visualization\n",
			"#\n",
			"# Use \"dot -Tpng this-file.dot -o this-file.png\" to compile.\n",
			"#\n",
			"digraph structs {\n",
			"	rankdir = TB;\n",
			"	bgcolor = transparent;\n",
			"	pad = 0;\n",
			"	margin = 0;\n",
			//"	splines = line;\n",
			"	edge [ arrowtail=none, arrowhead=normal, dir=both, arrowsize=0.6, fontsize=8, fontname=\"sans\" ];\n",
			"	node [ shape=box, style=\"rounded,filled\", fontsize=9, fontname=\"sans\", fillcolor=\"#eeeeee\" ];\n",
			"	graph [ fontsize=9, fontname=\"sans bold\" ];\n",
			"\n";

		// Wrap state diagram into subgraph if there are extras to avoid mixing of them together
		if (!empty($this->state_diagram_extras)) {
			echo "\tsubgraph cluster_main {\n",
				"\t\t", "graph [ margin = 10 ];\n",
				"\t\t", "color = transparent;\n\n";
		}

		// Start state
		echo "\t\t", "BEGIN [",
			"id = \"BEGIN\",",
			"label = \"\",",
			"shape = circle,",
			"color = black,",
			"fillcolor = black,",
			"penwidth = 0,",
			"width = 0.25,",
			"style = filled",
			"];\n";

		// States
		echo "\t\t", "node [ shape=ellipse, fontsize=9, style=\"filled\", fontname=\"sans\", fillcolor=\"#eeeeee\", penwidth=2 ];\n";
		$group_content = array();
		if (!empty($this->states)) {
			foreach ($this->states as $s => $state) {
				if ($s != '') {
					$id = $this->exportDotIdentifier($s);
					echo "\t\t", $id;
					//echo " [ label=\"", addcslashes(empty($state['label']) ? $s : $state['label'], '"'), "\"";
					echo " [ id = \"", addcslashes($id, '"'), "\", label=\"", addcslashes($s, '"'), "\"";
					if (!empty($state['color'])) {
						echo ", fillcolor=\"", addcslashes($state['color'], '"'), "\"";
					}
					echo " ];\n";
				}

				if (isset($state['group'])) {
					$group_content[$state['group']][] = $s;
				}
			}
		}
		echo "\n";

		// State groups
		if (!empty($this->state_groups)) {
			$this->exportDotRenderGroups($this->state_groups, $group_content);
		}

		$have_final_state = false;
		$missing_states = array();

		// Transitions
		if (!empty($this->actions)) {
			foreach ($this->actions as $a => $action) {
				if (empty($action['transitions'])) {
					continue;
				}
				foreach ($action['transitions'] as $src => $transition) {
					$transition = array_merge($action, $transition);
					if ($src === null || $src === '') {
						$s_src = 'BEGIN';
					} else {
						$s_src = $this->exportDotIdentifier($src);
						if (!array_key_exists($src, $this->states)) {
							$missing_states[$src] = true;
						}
					}
					foreach ($transition['targets'] as $dst) {
						if ($dst === null || $dst === '') {
							$s_dst = $src == '' ? 'BEGIN':'END';
							$have_final_state = true;
						} else {
							$s_dst = $this->exportDotIdentifier($dst);
							if (!array_key_exists($dst, $this->states)) {
								$missing_states[$dst] = true;
							}
						}
						echo "\t\t", $s_src, " -> ", $s_dst, " [ ";
						echo "label=\" ", addcslashes($a, '"'), "  \"";
						if (!empty($transition['color'])) {
							echo ", color=\"", addcslashes($transition['color'], '"'), "\"";
							echo ", fontcolor=\"", addcslashes($transition['color'], '"'), "\"";
						}
						if (isset($transition['weight'])) {
							echo ", weight=", (int) $transition['weight'];
						}
						if (isset($transition['access_policy']) && isset($this->access_policies[$transition['access_policy']]['arrow_tail'])) {
							$arrow_tail = $this->access_policies[$transition['access_policy']]['arrow_tail'];
							echo ", arrowtail=\"", addcslashes($arrow_tail, '"'), "\"";
						}
						echo " ];\n";
					}
				}
			}
		}

		// Missing states
		foreach ($missing_states as $s => $state) {
			echo "\t\t", $this->exportDotIdentifier($s), " [ label=\"", addcslashes($s, '"'), "\\n(undefined)\", fillcolor=\"#ffccaa\" ];\n";
		}

		// Final state
		if ($have_final_state) {
			echo "\n\t\t", "END [",
				" id = \"END\",",
				" label = \"\",",
				" shape = doublecircle,",
				" color = black,",
				" fillcolor = black,",
				" penwidth = 1.8,",
				" width = 0.20,",
				" style = filled",
				" ];\n";
		}

		// Close state diagram subgraph
		if (!empty($this->state_diagram_extras)) {
			echo "\t}\n";
		}

		// Optionaly render machine-specific debug data
		if ($debug_opts) {
			$this->exportDotRenderExtras($debug_opts);
		}
		// DOT Footer
		echo "}\n";

		return ob_get_clean();
	}
363763
public function getPixelFormat()
    {
        if ($this->pixelFormat === null) {
            $match = [];
            preg_match(self::$REGEX_PIXEL_FORMAT, $this->output, $match);
            $this->pixelFormat = array_key_exists(1, $match) ? trim($match[1]) : '';
        }

        return $this->pixelFormat;
    }