Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
Process-ing committed Aug 16, 2024
1 parent e7f7a40 commit 715e4c3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
28 changes: 28 additions & 0 deletions Clava-JS/src-api/visualization/README.md
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 2 additions & 2 deletions Clava-JS/src-api/visualization/VisualizationTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ 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 {
return this.instance;
}

protected override getAstConverter(): GenericAstConverter {
return this.joinPointConverter;
return this.astConverter;
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 715e4c3

Please sign in to comment.