Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ts-graphviz/ast

ts-graphviz2mMIT2.0.7TypeScript support: included

Graphviz AST(Abstract Syntax Tree) Utilities

readme

@ts-graphviz/ast

It is part of the ts-graphviz library, which is split into modular packages to improve maintainability, flexibility, and ease of use.

This package contains the module for processing the DOT language at the A*bstract *Syntax Tree (AST) level for the ts-graphviz library.

Features

  • Parsing and generating DOT language ASTs
  • Functions for manipulating and transforming ASTs
  • Support for custom AST nodes and attributes

Usage

Import the necessary functions and classes from the @ts-graphviz/ast package:

import { parse, stringify } from '@ts-graphviz/ast';

Use the imported items in your project to work with DOT language ASTs:

const dotString = 'digraph G { A -> B; }';
const ast = parse(dotString);

const outputDotString = stringify(ast);
console.log('Output DOT string:', outputDotString);

For more examples and usage details, please refer to the ts-graphviz documentation.

Contributing

Contributions to the ts-graphviz project are welcome.

Please refer to the main ts-graphviz repository for guidelines on how to contribute.

License

This package is released under the MIT License.

changelog

@ts-graphviz/ast

2.0.7

Patch Changes

  • #1318 c043ba9 Thanks @kamiazya! - Improve error handling and documentation in the @ts-graphviz/ast package.

    The most important changes include fixing an unexpected parsing error, updating the error class used in the parse function, and enhancing the documentation for the DotSyntaxError class.

2.0.6

Patch Changes

2.0.5

Patch Changes

2.0.4

Patch Changes

2.0.3

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

2.0.0

Initial release

It is part of the ts-graphviz library, which is split into modular packages to improve maintainability, flexibility, and ease of use.

This package contains the module for processing the DOT language at the A*bstract *Syntax Tree (AST) level for the ts-graphviz library.

Features

  • Parsing and generating DOT language ASTs
  • Functions for manipulating and transforming ASTs
  • Support for custom AST nodes and attributes

Usage

Import the necessary functions and classes from the @ts-graphviz/ast package:

import { parse, stringify } from "@ts-graphviz/ast";

Use the imported items in your project to work with DOT language ASTs:

const dotString = "digraph G { A -> B; }";
const ast = parse(dotString);

const outputDotString = stringify(ast);
console.log("Output DOT string:", outputDotString);