Skip to content
CCPEDIAby Unity Nodes
App Development

Visualizing Daml Contracts in Mac

7 posts373 views7 likesLast activity Dec 2021

  1. raghuOP

    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

  2. Leonid_Rozenberg 2

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

  3. quidagis

    Is Graphviz installed by default in MACOSX?

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

  4. cocreature 2

    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
    
    
  5. quidagis

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

  6. raghu 2

    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

  7. quidagis 1

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