CrossClj

0.1.1 docs

SourceDocs



RECENT

    metosin/schema-viz

    Clojars

    Mar 30, 2016


    OWNER
    Metosin
    Tampere, Helsinki, Finland
    www.metosin.fi

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    Schema-viz Build Status Dependencies Status

    Plumatic Schema visualization using Graphviz.

    Clojars Project

    Prerequisites

    Install Graphviz.

    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.

    (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:

    Schema

    License

    Copyright © 2015-2016 Metosin Oy

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