PAD Charts
All charts/Network

Who imports whom

arrows show the direction, value= the weight of a link.

1 The data network/modules.php php
<?php

  // Which module of an application imports which, and how many functions it uses.

  $imports = [
    'app'      => [ 'router' => 6, 'auth' => 4, 'views' => 9 ],
    'router'   => [ 'request' => 5, 'views' => 3 ],
    'auth'     => [ 'session' => 7, 'db' => 4, 'crypt' => 3 ],
    'views'    => [ 'template' => 12, 'i18n' => 2 ],
    'template' => [ 'cache' => 3, 'i18n' => 1 ],
    'session'  => [ 'cache' => 2, 'crypt' => 1 ],
    'db'       => [ 'cache' => 4, 'log' => 2 ],
    'request'  => [ 'log' => 1 ]
  ];

  $modules = [];

  foreach ( $imports as $module => $uses )
    foreach ( $uses as $used => $functions )
      $modules [] = [ 'module' => $module, 'imports' => $used, 'functions' => $functions ];

?>
2 The chart tag network/modules.pad pad
{chart 'network', data='modules', source='module', target='imports', value='functions', arrows, title='Imports between modules', width=640, height=420}
3 The result inline SVG · no JavaScript
Imports between modules 12 nodes, 17 links; app → router: 6; app → auth: 4; app → views: 9; router → request: 5; router → views: 3; auth → session: 7; auth → db: 4; auth → crypt: 3; views → template: 12; views → i18n: 2; template → cache: 3; template → i18n: 1; session → cache: 2; session → crypt: 1; db → cache: 4; db → log: 2; request → log: 1 app → router: 6 app → auth: 4 app → views: 9 router → request: 5 router → views: 3 auth → session: 7 auth → db: 4 auth → crypt: 3 views → template: 12 views → i18n: 2 template → cache: 3 template → i18n: 1 session → cache: 2 session → crypt: 1 db → cache: 4 db → log: 2 request → log: 1 app: 3 links app router: 3 links router auth: 4 links auth views: 4 links views request: 2 links request session: 3 links session db: 3 links db crypt: 2 links crypt template: 3 links template i18n: 2 links i18n cache: 3 links cache log: 2 links log