Skip to content

Commit cd7e145

Browse files
committed
Improve documentation structure
1 parent bd669ed commit cd7e145

24 files changed

+74
-74
lines changed

docs/ts-graphviz/11-advanced-usage/02-extending-ts-graphviz.md renamed to docs/ts-graphviz/03-guides/03-extending-ts-graphviz.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
description: How to extend ts-graphviz with custom classes.
2+
description: How to extend ts-graphviz for advanced use cases.
33
---
44
# Extending ts-graphviz
55

6-
`ts-graphviz` is designed to be extensible, allowing advanced users to customize and enhance the library's functionality to meet specific needs. This section covers how to extend the type system and create custom implementations.
6+
`ts-graphviz` is designed to be extensible, allowing intermediate users to customize and enhance the library's functionality to meet specific needs. This section covers how to extend the type system and create custom implementations.
77

88
## Creating Custom Classes
99

@@ -172,3 +172,49 @@ console.log(
172172
),
173173
);
174174
```
175+
176+
---
177+
178+
179+
## Internal Package Overview
180+
181+
For users interested in extending or customizing `ts-graphviz`, understanding the internal packages can be valuable. Below is an overview of the internal packages and how they can be used in advanced scenarios.
182+
183+
184+
### `@ts-graphviz/adapter`
185+
186+
**Purpose**: Provides interfaces to execute Graphviz commands and convert DOT language strings into various output formats.
187+
188+
**Usage**:
189+
190+
- Convert DOT strings to streams or files.
191+
- Use in environments where you need to render graphs to images or other formats.
192+
193+
### `@ts-graphviz/ast`
194+
195+
**Purpose**: Allows manipulation of the DOT language at the Abstract Syntax Tree (AST) level.
196+
197+
**Usage**:
198+
199+
- Parse DOT strings into AST nodes.
200+
- Manipulate and transform the AST programmatically.
201+
- Useful for advanced analysis or transformations of existing DOT code.
202+
203+
### `@ts-graphviz/common`
204+
205+
**Purpose**: Centralizes Graphviz domain knowledge, providing type definitions, constants, and utilities. It is designed to handle use cases such as extending types.
206+
207+
**Usage**:
208+
209+
- Extend or customize types and attributes.
210+
- Ensure type safety when working with custom attributes.
211+
- Aggregate domain knowledge of Graphviz for consistent usage across packages.
212+
213+
### `@ts-graphviz/core`
214+
215+
**Purpose**: Contains the core implementations of the models and functions provided to users.
216+
217+
**Usage**:
218+
219+
- Use object-oriented APIs for fine-grained control over graph elements.
220+
- Extend classes for custom behaviors or attributes.

0 commit comments

Comments
 (0)