concept-tree 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Presentation
|
|
|
7
7
|
|
|
8
8
|
The package *concept-tree* helps to make a virtual tree structure and output it in different ways.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Alternative solutions:
|
|
11
11
|
|
|
12
12
|
- https://github.com/D-Sketon/fast-archy
|
|
13
13
|
- https://mermaid.ai/open-source/syntax/treeView.html
|
|
@@ -16,6 +16,44 @@ See:
|
|
|
16
16
|
Getting started
|
|
17
17
|
---------------
|
|
18
18
|
|
|
19
|
+
```bash
|
|
20
|
+
npm i concept-tree@latest
|
|
21
|
+
vim blabla.ts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
blabla.ts:
|
|
25
|
+
```JavaScript
|
|
26
|
+
import { conceptTree } from '../src/index.ts';
|
|
27
|
+
|
|
28
|
+
// create a tree
|
|
29
|
+
const myTree = conceptTree('aaa');
|
|
30
|
+
myTree.addPath('xxx/zzz');
|
|
31
|
+
myTree.addPath('xxx/yyy');
|
|
32
|
+
myTree.addSubTree(otherTree);
|
|
33
|
+
myTree.addElem('Abc');
|
|
34
|
+
|
|
35
|
+
// get a sub-tree
|
|
36
|
+
const subTree = myTree.find('xxx')
|
|
37
|
+
|
|
38
|
+
// configure the output
|
|
39
|
+
myTree.setPrefix(0); // 0, 1, 2
|
|
40
|
+
myTree.setNumbering(true);
|
|
41
|
+
myTree.setSorting(true);
|
|
42
|
+
|
|
43
|
+
// outputs
|
|
44
|
+
const lElem = myTree.listElem(); // string[]
|
|
45
|
+
const txt = myTree.drawTree(); // string
|
|
46
|
+
const lPath = myTree.listTree(); // string[]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Combining with Mermaid.js
|
|
50
|
+
-------------------------
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
Development
|
|
55
|
+
-----------
|
|
56
|
+
|
|
19
57
|
```bash
|
|
20
58
|
git clone https://github.com/charlyoleg2/bopa_mono
|
|
21
59
|
cd bopa_mono
|