com.stuartsierra/class-diagram
Generate & display class hierarchy diagrams for Java classes.
Uses Graphviz via Rhizome to generate graphs.
This tool helps you examine subsets of a class hierarchy. To see all of Clojure's built-in classes and interfaces in one big diagram, try the Clojure class chart by Chouser.
Releases and Dependency Information
Releases are deployed to Clojars.
Latest stable release is 0.1.0
Leiningen dependency information:
[com.stuartsierra/class-diagram "0.1.0"]
Maven dependency information:
<dependency>
<groupId>com.stuartsierra</groupId>
<artifactId>class-diagram</artifactId>
<version>0.1.0</version>
</dependency>
Git master branch is at version 0.1.1-SNAPSHOT
Usage and Examples
(require '[com.stuartsierra.class-diagram :as diagram])
To open up a window showing the class hierarchy diagram of Clojure's persistent list:
(diagram/view clojure.lang.PersistentList)
Or save it to a PNG file:
(diagram/png "PersistentList.png" clojure.lang.PersistentList)
Say you want to understand the relationships among Clojure's persistent map types:
(->> [(hash-map 1 2) (array-map) (sorted-map)]
(map class)
(apply diagram/view))
(You have to call hash-map
with arguments because an empty map
defaults to an array-map.)
Note: The diagrams only show ancestors of the input classes, not subclasses.
You can get a legend for the symbols and colors used in the diagram:
(diagram/view-legend)
Or save that to a file:
(diagram/png-legend "legend.png")
Change Log
- Version 0.1.1-SNAPSHOT: current Git master
- Version 0.1.0 on 1-Oct-2013: Initial release
Copyright and License
Copyright © 2013 Stuart Sierra. All rights reserved.
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.