edno / graphyed

Extension of the GraphML library for supporting yEd GraphML files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

edno/graphyed

Packagist Latest Version Build Status Coverage Status GitHub license FOSSA Status

GraphYEd extends graphp/graphml for supporting yEd file format for GraphML.

It provides access to the vertices (or nodes) and edges labels :

  • $vertex->getAttribute('labels')
  • $edge->getAttribute('labels')

Please refer to GraPHP library for more details on how to manipulate graphs.

Installation

The recommended way to install this library is through Composer.

$ composer require edno/graphyed

Usage

The method getAttribute('labels') will return an array of type string.

<?php

$loader = new \edno\GraphYEd\Loader();

$graphml = file_get_contents('mygraph.graphml');

$graph = $loader->loadContents($graphml);

foreach($graph->getVertices() as $vertex) {
  print($vertex->getAttribute('labels')[0]);
}

License

Released under the terms of the permissive MIT license.

About

Extension of the GraphML library for supporting yEd GraphML files

License:MIT License


Languages

Language:PHP 100.0%