SchemaGraph: Visualizing Databases in SVG
By Weston Ruter
I just released SchemaGraph, a standalone PHP script which queries the MySQL information_schema database to get all of the necessary information about a database’s (InnoDB) tables to construct a graph; this graph is then output as an interactive SVG image (see example) with the following features:
- Tables in the schema are placed equidistantly around a circle.
- Clicking the image causes the graph to rotate.
- Foreign key constraints are represented by bézier curves connecting table labels.
- Hovering over a table or a constraint causes the table’s label to highlight along with all of its constraint paths (both incoming and outgoing).
- The paths representing incoming foreign key constraints are highlighted in a different color than outgoing constraints.
- Multiple constraints between the same two tables are prevented from overlapping by giving a unique curve to each of the lines.
- Hovering over a constraint produces a tooltip which shows the names of the fields that are linked by the constraint.
This is an open source project I developed while working at Shepherd Interactive. Find out more on the project page.
There are no comments yet.