specs-feup / lara-framework

Tools and APIs to develop weavers for the LARA language (LARA Compiler, LARA Interpreter, Weaver Generator, etc...)
Apache License 2.0
13 stars 2 forks source link

[LaraApi] Graph dot formatter now supports layout options #54

Open tiagolascasas opened 8 months ago

tiagolascasas commented 8 months ago

Adds a method to specify layout options on a DotFormatter object, and further edits Graphs.js to generate a DOT that includes those options.

Usage example:

formatter.setLayoutOption("rankdir", "LR");
formatter.setLayoutOption("rankdir", "TB"); // overrides previous value
formatter.setLayoutOption("layout", "neato");

Generated DOT:

digraph G {
rankdir="TB";
layout="neato";
...