PHP code example of power-modules / dependency-graph-mermaid

1. Go to this page and download the library: Download power-modules/dependency-graph-mermaid library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

power-modules / dependency-graph-mermaid example snippets


use Modular\Framework\App\ModularAppBuilder;
use Modular\DependencyGraph\PowerModule\Setup\DependencyGraphSetup;
use Modular\DependencyGraph\Graph\DependencyGraph;
use Modular\DependencyGraph\Renderer\RendererPluginRegistry;
use Modular\DependencyGraph\Renderer\Mermaid\MermaidRendererModule;
use Modular\Plugin\PowerModule\Setup\PluginRegistrySetup; // from power-modules/plugin

$app = (new ModularAppBuilder(__DIR__))
    ->withModules(
        // your app modules ...
        // any registered renderer on demand
$renderer = $registry->makePlugin(\Modular\DependencyGraph\Renderer\Mermaid\MermaidClassDiagram::class);
$mermaid = $renderer->render($graph);

file_put_contents(__DIR__ . '/../dependency-graph.mmd', $mermaid);


new MermaidGraph(
    showExports: true,
    showServices: true,
    maxServiceLength: 50,
)

new MermaidClassDiagram(
    showExports: true,
    showServices: true,
    maxServiceLength: 50,
)

new MermaidTimeline(
    title: 'Module initialization timeline',
    showCounts: true,
)