metosin/schema-viz

Name: schema-viz

Owner: Metosin

Description: Plumatic Schema visualization using Graphviz.

Created: 2016-03-10 07:23:57.0

Updated: 2018-05-17 04:22:28.0

Pushed: 2016-12-01 07:08:33.0

Homepage:

Size: 703

Language: Clojure

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Schema-viz Build Status Dependencies Status

Plumatic Schema visualization using Graphviz.

Clojars Project

Prerequisites

Install Graphviz.

Usage

Public functions in schema-viz.core:

Both take an optional options-map to configure the rendering process. See docs for details.

uire '[schema-viz.core :as svc])
uire '[schema.core :as s])

efschema Country
name (s/enum :FI :PO)
neighbors [(s/recursive #'Country)]})

efschema Burger
name s/Str
s/optional-key :description) s/Str
origin (s/maybe Country)
price (s/constrained s/Int pos?)
/Keyword s/Any})

efschema OrderLine
burger Burger
amount s/Int})

efschema Order
lines [OrderLine]
delivery {:delivered s/Bool
          :address {:street s/Str
                    :zip s/Int
                    :country Country}}})

/visualize-schemas)

Produces the following:

Schema

License

Copyright © 2015-2016 Metosin Oy

Distributed under the Eclipse Public License, the same as Clojure.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.