Graphviz alternatives and similar libraries
Based on the "Miscellaneous" category.
Alternatively, view Graphviz alternatives based on common mentions on social networks and blogs.
-
Country List
:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats. -
Hprose-PHP
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP -
dotenv-linter
⚡️Lightning-fast linter for .env files. Written in Rust 🦀 -
SuperClosure
Serialize closures. Not maintained. Consider using opis/closure. -
Pagerfanta
Pagination library for PHP applications with support for several data providers -
Essence
Extracts information about web pages, like youtube videos, twitter statuses or blog articles. -
sabre/vobject
:date: The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects -
Token Bucket
Implementation of the Token Bucket algorithm in PHP. -
Lodash-PHP
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP -
Prooph Service Bus
PHP Lightweight Message Bus supporting CQRS. -
Embera
A Oembed consumer library, that gives you information about urls. It helps you replace urls to youtube or vimeo for example, with their html embed code. It has advanced features like offline support, responsive embeds and caching support. -
noCAPTCHA
:passport_control: Helper for Google's new noCAPTCHA (reCAPTCHA v2 & v3) -
ClassPreloader
Optimizes class loading performance by generating a single PHP file containing all of the autoloaded files. -
Metrics
Simple library that abstracts different metrics collectors. I find this necessary to have a consistent and simple metrics (functional) API that doesn't cause vendor lock-in. -
Slimdump
A tool for creating configurable dumps of large MySQL-databases. -
git-profile
Utility that helps you switch git configurations with ease. -
Cake Utility
[READ-ONLY] CakePHP Utility classes such as Inflector, Text, Hash, Security and Xml. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp -
RedisSessionHandler
An alternative Redis session handler for PHP featuring per-session locking and session fixation protection -
html-object
A set of classes to create and manipulate HTML objects abstractions -
Sslurp
Sslurp is a simple library which aims to make properly dealing with SSL in PHP suck less. -
Procrastinator
Execute time consuming tasks as late as possible in a request -
Yell
PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Graphviz or a related project?
README
Graphviz
Graphviz generation for PHP
- [View CHANGELOG](CHANGELOG.md)
- [View CONTRIBUTORS](CONTRIBUTORS.md)
Installation
Install the latest version with:
composer require alom/graphviz
Usage
This library allow you to create Dot Graph with a PHP fluid interface:
$graph = new Alom\Graphviz\Digraph('G');
$graph
->subgraph('cluster_1')
->attr('node', array('style' => 'filled', 'fillcolor' => 'blue'))
->node('A')
->node('B')
->edge(array('b0', 'b1', 'b2', 'b3'))
->end()
->edge(array('A', 'B', 'C'))
;
echo $graph->render();
Escaping of labels
By default, labels will be escaped, so that your PHP string is represented "as it is" in the graph. If you don't want the label to be escaped, add set the special _escaped attribute to false:
$graph = new Alom\Graphviz\Digraph('G');
$graph
->node('my_table', array(
'label' => '<<table>...</table>>',
'_escaped' => false
))
Browsing the graph
When you have created lot of subgraphs and nodes, it might be useful to be able to browse it using identifiers. For example, if you have the following graph:
$graph = new Alom\Graphviz\Digraph('G');
$graph
->subgraph('cluster_1')
->node('A')
->node('B')
->end()
->subgraph('cluster_2')
->node('C')
->node('D')
->end()
->edge(array('C', 'D'))
;
You can do the following to access the nodes in the existing graph:
$cluster = $graph->get('cluster_1');
$node = $graph->get('cluster_2')->get('D');
When you have a node or an edge, you can manipulate its attributes:
# read a value
echo $node->getAttribute('label', 'no label'); # second argument is default value
# write a value
$node->attribute('label', 'new label');
On a graph, you can access or verify edge existence:
$graph->hasEdge(array('A', 'B'));
$graph->getEdge(array('C', 'D'));
Using cluster and record IDs
If you create an edge from/to an ID inside a record, use an array instead of a string:
$graph = new Alom\Graphviz\Digraph('G');
$graph
->node('A', array('shape' => 'record', 'label' => '{ <1> Part 1 | <2> Part 2}'))
->node('B')
->edge(array('B', array('A', '1')))
;
As you can see in the example above, the edge is composed of two parts:
'B'
: a regular nodearray('A', '1')
: targets the cell "1" inside the A node
This method also work for getEdge, hasEdge and every edge-related method.
Samples
Take a look at examples located in samples folder:
- [00-readme.php](samples/00-readme.php): Example from graphviz README
- [01-basic.php](samples/01-basic.php): Basic styling of nodes
- [02-table.php](samples/02-table.php): An example for HTML table escaping
You can generate any of those graph by using the following commands:
php samples/00-readme.php | dot -Tpdf -oout.pdf
xdg-open out.pdf
*Note that all licence references and agreements mentioned in the Graphviz README section above
are relevant to that project's source code only.