
engine ( str) Specify the dot engine used to generate the image.
#GRAPHVIZ ERD CODE#
Promise.post('/generate', editor.getValue()). ERD graphviz-erd documentation ERD class (filename'erd', engine'dot', imageformat'png') Bases: object Parameters: filename ( str) Name of the generated dot code and image file. Var a = document.getElementById("generateLink") loadERFromText process a Text and loadER read from a fileĬase parse (do " erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. LoadER :: String -> Handle -> IO (Either String ER) In this way I can receive the code in an http request and process it in memory, without the necessity of dumping it to a file.

Basically I removed the Main function and I changed one single method ( loadER) to accept a Text instance instead of a file handle. For now I just copied the code from Erd in my project. I opened an issue in the Erd project and I hope to able to send a pull-request in the future. So ideally I would like Erd to expose a library and, as a separate project, a console utility wrapping that library. It means that the module cannot be used as a dependency for other modules. Unfortunately it is not possible because Erd is a cabal application module ( Cabal is the package manager for Haskell). Now, ideally my project would just add Erd to the dependencies and everything should be easy and fine. Interfacing with ErdĮrd is a nice program written in Haskell. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. In the rest of this post I describe its implementation.
#GRAPHVIZ ERD SOFTWARE#
I wrote this piece of software named Erd web-server and it is available on GitHub. The server process the code and generate an image which is sent back to the browser and displayed in the page. It should be enough for the MVP ( Minimum Viable Product: now that the enterprise world has taken my soul I have to use these acronyms, right?). The basic idea is pretty simple: the web application will present an editor and when the user clicks on a button the code is sent to the server.

#GRAPHVIZ ERD INSTALL#

To use it you need to install Graphviz, the Haskell platform and cabal. Erd is a fantastic tool written in Haskell which parses its own DSL and invoke Graphviz, producing images in several different formats. Last week I started discussing how I am working on improving my approach to diagrams generation, so that it could become acceptable for a Software Engineer.Ĭurrently I write a textual description of my entity-diagrams and I generate the corresponding images using Erd.
