https://github.com/metosin/schema-viz
Plumatic Schema visualization using Graphviz.
https://github.com/metosin/schema-viz
clojure clojurescript metosin-inactive schema visualization
Last synced: about 1 month ago
JSON representation
Plumatic Schema visualization using Graphviz.
- Host: GitHub
- URL: https://github.com/metosin/schema-viz
- Owner: metosin
- Created: 2016-03-10T07:23:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-01T07:08:33.000Z (almost 9 years ago)
- Last Synced: 2025-05-09T22:47:43.675Z (5 months ago)
- Topics: clojure, clojurescript, metosin-inactive, schema, visualization
- Language: Clojure
- Homepage:
- Size: 687 KB
- Stars: 74
- Watchers: 11
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Schema-viz [](https://travis-ci.org/metosin/schema-viz) [](https://jarkeeper.com/metosin/schema-viz)
Plumatic [Schema](https://github.com/plumatic/schema) visualization using Graphviz.
[](http://clojars.org/metosin/schema-viz)
## Prerequisites
Install [Graphviz](http://www.graphviz.org/).
## Usage
Public functions in `schema-viz.core`:
* `visualize-schemas` displays schemas from a namespace in a window.
* `save-schemas` saves schema visualization in a file.Both take an optional options-map to configure the rendering process.
See docs for details.```clj
(require '[schema-viz.core :as svc])
(require '[schema.core :as s])(s/defschema Country
{:name (s/enum :FI :PO)
:neighbors [(s/recursive #'Country)]})(s/defschema Burger
{:name s/Str
(s/optional-key :description) s/Str
:origin (s/maybe Country)
:price (s/constrained s/Int pos?)
s/Keyword s/Any})(s/defschema OrderLine
{:burger Burger
:amount s/Int})(s/defschema Order
{:lines [OrderLine]
:delivery {:delivered s/Bool
:address {:street s/Str
:zip s/Int
:country Country}}})(svc/visualize-schemas)
```Produces the following:

## License
Copyright © 2015-2016 [Metosin Oy](http://www.metosin.fi)
Distributed under the Eclipse Public License, the same as Clojure.