예제 #1
0
 /**
  * @param array $dependencyTree
  *
  * @return string
  */
 public function build(array $dependencyTree)
 {
     foreach ($dependencyTree as $dependency) {
         $this->graph->addNode($dependency[DependencyTree::META_BUNDLE], $this->getNodeAttributes($dependency));
         $this->graph->addNode($dependency[DependencyTree::META_FOREIGN_BUNDLE], $this->getForeignNodeAttributes($dependency));
     }
     foreach ($dependencyTree as $dependency) {
         $this->graph->addEdge($dependency[DependencyTree::META_BUNDLE], $dependency[DependencyTree::META_FOREIGN_BUNDLE], $this->getEdgeAttributes($dependency));
     }
     return $this->graph->render('svg');
 }
예제 #2
0
 /**
  * @param array $dependencyTree
  *
  * @return string
  */
 public function build(array $dependencyTree)
 {
     foreach ($dependencyTree as $dependency) {
         $this->graph->addNode($dependency[DependencyTree::META_BUNDLE], $this->getFromAttributes($dependency));
         if (!empty($dependency[DependencyTree::META_COMPOSER_NAME])) {
             $this->graph->addNode($dependency[DependencyTree::META_COMPOSER_NAME], $this->getToAttributes($dependency));
         }
     }
     foreach ($dependencyTree as $dependency) {
         if (empty($dependency[DependencyTree::META_COMPOSER_NAME])) {
             continue;
         }
         $this->graph->addEdge($dependency[DependencyTree::META_BUNDLE], $dependency[DependencyTree::META_COMPOSER_NAME], $this->getEdgeAttributes($dependency));
     }
     return $this->graph->render('svg');
 }
예제 #3
0
 /**
  * @param \Orm\Zed\Category\Persistence\SpyCategoryNode $node
  *
  * @return void
  */
 protected function renderChildren(SpyCategoryNode $node)
 {
     $children = $this->queryContainer->queryFirstLevelChildrenByIdLocale($node->getPrimaryKey(), $this->locale->getIdLocale())->find();
     $deleteLink = '/category-tree/index/delete-node?id=';
     $deleteString = '<br/>click to delete';
     $this->addClosureConnections($node);
     $this->graph->addNode($this->getNodeHash($node), ['URL' => $deleteLink . $node->getPrimaryKey(), 'label' => $this->getNodeName($node) . $deleteString, 'fontsize' => $this->fontSize]);
     foreach ($children as $child) {
         $this->graph->addNode($this->getNodeHash($child), ['URL' => $deleteLink . $child->getPrimaryKey(), 'label' => $this->getNodeName($child) . $deleteString, 'fontsize' => $this->fontSize]);
         $this->graph->addEdge($this->getNodeHash($node), $this->getNodeHash($child));
         /*
          * Recursive call
          */
         $this->renderChildren($child);
     }
 }
예제 #4
0
 /**
  * @param array $dependencyInformation
  * @param string $group
  *
  * @return void
  */
 private function addForeignBundleLayer(array $dependencyInformation, $group)
 {
     $foreignBundleLayerNodeId = $this->getForeignBundleLayerNodeId($dependencyInformation);
     $label = $dependencyInformation[DependencyTree::META_FOREIGN_BUNDLE] . ' ' . $dependencyInformation[DependencyTree::META_FOREIGN_LAYER];
     $attributes = $this->layerAttributes;
     $attributes['label'] = $label;
     $this->graph->addNode($foreignBundleLayerNodeId, $attributes, $group);
     $this->graph->addEdge($this->getRootFileNodeId($dependencyInformation), $foreignBundleLayerNodeId, ['label' => $this->getForeignUsage($dependencyInformation[DependencyTree::META_FINDER]) . ' : ' . $dependencyInformation[DependencyTree::META_FOREIGN_CLASS_NAME], 'fontsize' => 8]);
 }
예제 #5
0
파일: Drawer.php 프로젝트: spryker/Oms
 /**
  * @param \Spryker\Zed\Oms\Business\Process\StateInterface $state
  * @param array $attributes
  * @param string|null $name
  * @param bool $highlighted
  *
  * @return void
  */
 protected function addNode(StateInterface $state, $attributes = [], $name = null, $highlighted = false)
 {
     $name = $name === null ? $state->getName() : $name;
     $label = [];
     $label[] = str_replace(' ', $this->br, trim($name));
     if ($state->isReserved()) {
         $label[] = '<font color="blue" point-size="' . $this->fontSizeSmall . '">' . 'reserved' . '</font>';
     }
     if ($state->hasFlags()) {
         $flags = implode(', ', $state->getFlags());
         $label[] = '<font color="violet" point-size="' . $this->fontSizeSmall . '">' . $flags . '</font>';
     }
     $attributes['label'] = implode($this->br, $label);
     if (!$state->hasOutgoingTransitions() || $this->hasOnlySelfReferences($state)) {
         $attributes['peripheries'] = 2;
     }
     if ($highlighted) {
         $attributes['fillcolor'] = '#FFFFCC';
     }
     $attributes = array_merge($this->attributesState, $attributes);
     $this->graph->addNode($name, $attributes, $state->getProcess()->getName());
 }