Visualizing Daml Contracts in Mac

Hi ,

Has anyone tried out Visualizing Daml Contracts in Mac using Graphviz ?
If yes , please help provide the steps and also the link of Graphviz package that needs to be downloaded.

Regards
Raghu

daml damlc visual [path-to-dar] generates a DOT file of the templates in a dar.

2 Likes

Is Graphviz installed by default in MACOSX?

I had to install it on all of my Ubuntu machines.

You can find installation instructions for graphviz on MacOS at Download | Graphviz.

One you installed it you can first generate the dot file as @Leonid_Rozenberg pointed out and then run graphviz to produce an svg (or whatever output format you prefer).

> daml damlc visual .daml/dist/foobar-0.0.1.dar --dot daml.dot
> dot -Tsvg < daml.dot > out.svg

2 Likes

Thanks @cocreature for the reply re the installation process :+1:t2:

Thanks everyone for your response, i was able to generate visual graphs for contracts

for completeness adding pre steps i performed before step of generating the dot file pointed by @Leonid_Rozenberg

  1. install Xcode (this is needed before installing graphviz , i was getting Error: No Xcode installation was found while installing graphviz as first step)
  2. install graphviz > sudo port install graphviz
  3. From project directory execute > daml build this will create the DAR file
  4. Proceed with steps mentioned by @Leonid_Rozenberg

Thanks and Regards
Raghu

2 Likes

Thank you for showing the actual workflow :+1:t2:

1 Like