diff --git a/Clava-JS/src-api/visualization/README.md b/Clava-JS/src-api/visualization/README.md new file mode 100644 index 000000000..218f2a604 --- /dev/null +++ b/Clava-JS/src-api/visualization/README.md @@ -0,0 +1,28 @@ +# LARA Visualization Tool + +Clava integration of LARA's web tool for visualization and analysis of the AST and its source code. + +For more details, see the [LARA Framework repository](https://github.com/specs-feup/lara-framework). + +## Usage + +To launch or update the visualization tool, execute the following statements: + +```js +import VisualizationTool from "clava-js/api/visualization/VisualizationTool.js"; + +await VisualizationTool.visualize(); +``` + +Once ready, Clava will provide the URL that should be opened in the browser to access the web interface. The function can also change the AST root and URL domain and port. + +Other properties will allow the user to know other important information from the server: + +```js +VisualizationTool.isLaunched; // true if the server is running +VisualizationTool.url; // URL where the server is running +VisualizationTool.port; // port to which the server is listening +VisualizationTool.hostname; // hostname to which the server is listening +``` + +For more details, refer to the `GenericVisualizationTool` documentation, from [LARA](https://github.com/specs-feup/lara-framework). \ No newline at end of file diff --git a/Clava-JS/src-api/visualization/VisualizationTool.ts b/Clava-JS/src-api/visualization/VisualizationTool.ts index 983b90c84..d09258efd 100644 --- a/Clava-JS/src-api/visualization/VisualizationTool.ts +++ b/Clava-JS/src-api/visualization/VisualizationTool.ts @@ -3,7 +3,7 @@ import GenericVisualizationTool from 'lara-js/api/visualization/GenericVisualiza import ClavaAstConverter from './ClavaAstConverter.js'; export class VisualizationTool extends GenericVisualizationTool { - private joinPointConverter = new ClavaAstConverter(); + private astConverter = new ClavaAstConverter(); private static instance: VisualizationTool = new VisualizationTool(); public static getInstance(): VisualizationTool { @@ -11,7 +11,7 @@ export class VisualizationTool extends GenericVisualizationTool { } protected override getAstConverter(): GenericAstConverter { - return this.joinPointConverter; + return this.astConverter; } } diff --git a/ClavaLaraApi/src-lara/clava/visualization/VisualizationTool.js b/ClavaLaraApi/src-lara/clava/visualization/VisualizationTool.js index 24ec8e872..9e6e3e6a5 100644 --- a/ClavaLaraApi/src-lara/clava/visualization/VisualizationTool.js +++ b/ClavaLaraApi/src-lara/clava/visualization/VisualizationTool.js @@ -1,13 +1,13 @@ import GenericVisualizationTool from 'lara-js/api/visualization/GenericVisualizationTool.js'; import ClavaAstConverter from './ClavaAstConverter.js'; export class VisualizationTool extends GenericVisualizationTool { - joinPointConverter = new ClavaAstConverter(); + astConverter = new ClavaAstConverter(); static instance = new VisualizationTool(); static getInstance() { return this.instance; } getAstConverter() { - return this.joinPointConverter; + return this.astConverter; } } export default VisualizationTool.getInstance();