survos / connections-bundle
Renders a connections graph (survos/connections-contract) as an accessible SVG with a text list and source quotes.
Package info
github.com/survos/connections-bundle
Type:symfony-bundle
pkg:composer/survos/connections-bundle
Fund package maintenance!
Requires
- php: ^8.5
- survos/connections-contract: ^2.45
- survos/kit-bundle: ^2.28
- symfony/framework-bundle: ^8.1
- symfony/twig-bundle: ^8.1
Requires (Dev)
- phpunit/phpunit: ^13.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Draws a Survos\ConnectionsContract\ConnectionGraph as:
- an SVG (focus first, direct connections in the next column, anything further after that), with a title and a description for screen readers, readable without JavaScript. Each node shows its kind (or schema), its name, and the years and roles when it has them;
- the same connections as a list under a
detailselement, each with its source quote and a source link; - a "More connections" link for each relation group that has more than was loaded.
{{ connections(graph) }}
Links
The graph holds no addresses. The application says where links go by implementing
Survos\ConnectionsBundle\Link\ConnectionsLinker (nodeUrl, moreUrl, sourceUrl) and aliasing the interface to
its service. Without one, nodes are drawn without links, and a source link is shown only when the edge carries a
sourceUrl.
services: Survos\ConnectionsBundle\Link\ConnectionsLinker: '@App\Service\StoneConnectionsLinker'
Templates and styling
@SurvosConnections/graph.html.twig includes a small <style> block with connections-* classes and a dark-mode
rule. Override the template in templates/bundles/SurvosConnections/ to restyle it.
Edges read from the node on the left to the node they point at. An edge with status reviewed is drawn heavier, and
a same-as edge is dashed.
Tests
vendor/bin/phpunit -c bu/connections-bundle/phpunit.xml.dist