Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/glossary.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-
- **Branch**: May refer to a TreeBranch, BranchComponent, or a Userland Component, depending on the level of abstraction.
- **Branches Container**: An element and/or its associated viewContainerRef of a ComponentContainer whose purpose is to render child branches.
- **Node**: A Branch or Root in a Tree.
**Root**: May refer to a TreeRoot or RootComponent, depending on the level of abstraction. Can also refer to the tree as a whole.
- **Tree**: A RootComponent, its parent view container, and all of its descendent elements, as well as all of the objects and utilities that manage and support that structure.
- **Userland Component**: A component supplied to the library by the user, which is dynamically rendered inside a BranchComponent.
- **Branch**: May refer to a TreeBranch, BranchComponent, or a Userland Component, depending on the level of abstraction.
- **Branches Container**: An element and/or its associated viewContainerRef of a ComponentContainer whose purpose is to render child branches.
- **Node**: A Branch or Root in a Tree.
**Root**: May refer to a TreeRoot or RootComponent, depending on the level of abstraction. Can also refer to the tree as a whole.
- **Tree**: A RootComponent, its parent view container, and all of its descendent elements, as well as all of the objects and utilities that manage and support that structure.
- **Userland Component**: A component supplied to the library by the user, which is dynamically rendered inside a BranchComponent.
1,919 changes: 852 additions & 1,067 deletions package-lock.json

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "limble-tree",
"version": "0.0.0",
"version": "6.1.1",
"engines": {
"node": ">=22.22 <23",
"npm": ">=10.9.4"
Expand All @@ -23,43 +23,43 @@
},
"private": true,
"dependencies": {
"@angular/animations": "19.2.20",
"@angular/animations": "19.2.21",
"@angular/cdk": "19.2.19",
"@angular/common": "19.2.20",
"@angular/compiler": "19.2.20",
"@angular/core": "19.2.20",
"@angular/forms": "19.2.20",
"@angular/common": "19.2.21",
"@angular/compiler": "19.2.21",
"@angular/core": "19.2.21",
"@angular/forms": "19.2.21",
"@angular/material": "19.2.19",
"@angular/platform-browser": "19.2.20",
"@angular/platform-browser-dynamic": "19.2.20",
"@angular/router": "19.2.20",
"rxjs": "7.8.0",
"tslib": "2.5.0",
"zone.js": "0.15.0"
"@angular/platform-browser": "19.2.21",
"@angular/platform-browser-dynamic": "19.2.21",
"@angular/router": "19.2.21",
"rxjs": "7.8.2",
"tslib": "2.8.1",
"zone.js": "0.15.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "19.2.22",
"@angular-eslint/eslint-plugin": "19.0.2",
"@angular-eslint/eslint-plugin-template": "19.0.2",
"@angular-eslint/schematics": "19.0.2",
"@angular-eslint/template-parser": "19.0.2",
"@angular/cli": "19.2.22",
"@angular/compiler-cli": "19.2.20",
"@types/jasmine": "4.0.0",
"eslint": "8.57.0",
"eslint-import-resolver-typescript": "3.6.1",
"@angular-devkit/build-angular": "19.2.24",
"@angular-eslint/eslint-plugin": "19.8.1",
"@angular-eslint/eslint-plugin-template": "19.8.1",
"@angular-eslint/schematics": "19.8.1",
"@angular-eslint/template-parser": "19.8.1",
"@angular/cli": "19.2.24",
"@angular/compiler-cli": "19.2.21",
"@types/jasmine": "4.6.6",
"eslint": "8.57.1",
"eslint-import-resolver-typescript": "3.10.1",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.29.1",
"jasmine-core": "4.3.0",
"karma": "6.4.0",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.2.0",
"eslint-plugin-import": "2.32.0",
"jasmine-core": "4.6.1",
"karma": "6.4.4",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.0.0",
"karma-jasmine-html-reporter": "2.2.0",
"ng-packagr": "19.2.2",
"prettier": "3.3.3",
"typescript": "5.7.3",
"typescript-eslint": "8.21.0"
"prettier": "3.8.3",
"typescript": "5.8.3",
"typescript-eslint": "8.59.0"
Comment thread
cheefbird marked this conversation as resolved.
},
"overrides": {
"tar": ">=7.5.10",
Expand Down
42 changes: 21 additions & 21 deletions projects/limble-tree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ An Angular library for building visual tree structures. Built and used by the te

## Features

- Allows any number of different components to be rendered in the same tree.
- Collapsible tree branches
- Move branches around both programmatically and with built-in drag-and-drop.
- Branches can be moved between trees.
- No limit on tree depth or size.
- Recently redesigned to allow better performance with large/complex trees.
- Allows any number of different components to be rendered in the same tree.
- Collapsible tree branches
- Move branches around both programmatically and with built-in drag-and-drop.
- Branches can be moved between trees.
- No limit on tree depth or size.
- Recently redesigned to allow better performance with large/complex trees.

## Compatibility Table

Expand Down Expand Up @@ -392,12 +392,12 @@ Events bubble up the tree. So subscribing to the root's `events()` observable wi

Below is a list of event types that are currently emitted by the tree.

- drag start
- drop
- drag end
- prune
- graft
- destruction
- drag start
- drop
- drag end
- prune
- graft
- destruction

Each event contains applicable information about the event, such as the nodes involved, position in the tree, etc.

Expand Down Expand Up @@ -441,8 +441,8 @@ public ngAfterViewInit(): void {

There are a couple other methods used to traverse the tree.

- `traverse()` traverses the tree in [depth-first pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR) and executes a provided callback on each node.
- `plot()` traverses the tree and returns a many-dimensional [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)representing the shape of the tree.
- `traverse()` traverses the tree in [depth-first pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR) and executes a provided callback on each node.
- `plot()` traverses the tree and returns a many-dimensional [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)representing the shape of the tree.

### Get Branch's Current Location in the Tree

Expand All @@ -468,13 +468,13 @@ Destroyed roots and branches have very limited functionality. Many methods will

There are methods on TreeBranch and TreeRoot instances which grant access to underlying structures. We recommend only using these in advanced scenarios. They are not fully documented here at this time.

- detectChanges()
- dispatch()
- getBranchesContainer()
- getComponentInstance()
- getHostView()
- getNativeElement()
- getUserlandComponentRef()
- detectChanges()
- dispatch()
- getBranchesContainer()
- getComponentInstance()
- getHostView()
- getNativeElement()
- getUserlandComponentRef()

## Development and Contributions

Expand Down
2 changes: 1 addition & 1 deletion projects/limble-tree/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@limble/limble-tree",
"version": "6.1.0",
"version": "6.1.1",
"peerDependencies": {
"@angular/common": "^19.0.0",
"@angular/core": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import type { TreeBranch } from "./tree-branch";
/**
* A wrapper around the BranchComponent that helps instantiate it and handles its events.
*/
export class BranchController<UserlandComponent>
implements ComponentContainer<BranchComponent<UserlandComponent>>
{
export class BranchController<UserlandComponent> implements ComponentContainer<
BranchComponent<UserlandComponent>
> {
private readonly branchComponentRef: ComponentRef<
BranchComponent<UserlandComponent>
>;
Expand Down
6 changes: 3 additions & 3 deletions projects/limble-tree/src/lib/core/tree-node-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { TreeBranch } from "./tree-branch";
import type { TreePlot } from "./tree-plot.interface";
import type { TreeNode } from "./tree-node.interface";

export class TreeNodeBase<UserlandComponent>
implements Partial<TreeNode<UserlandComponent>>
{
export class TreeNodeBase<UserlandComponent> implements Partial<
TreeNode<UserlandComponent>
> {
private readonly _branches: Array<TreeBranch<UserlandComponent>>;
private readonly events$: Subject<TreeEvent<UserlandComponent>>;
private destroyed: boolean = false;
Expand Down
3 changes: 1 addition & 2 deletions projects/limble-tree/src/lib/core/tree-node.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import type { TreeEvent } from "../events";
import type { NodeComponent } from "../components";

export interface TreeNode<UserlandComponent>
extends Branchable<UserlandComponent>,
ComponentContainer<NodeComponent> {
extends Branchable<UserlandComponent>, ComponentContainer<NodeComponent> {
destroy: () => void;
dispatch: (event: TreeEvent<UserlandComponent>) => void;
events: () => Observable<TreeEvent<UserlandComponent>>;
Expand Down
6 changes: 3 additions & 3 deletions projects/limble-tree/src/lib/core/tree-root/tree-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import { DestructionEvent, TreeEvent } from "../../events";
* branches. It has methods for creating and accessing those branches. It emits
* events when things happen in the tree.
*/
export class TreeRoot<UserlandComponent>
implements TreeNode<UserlandComponent>
{
export class TreeRoot<
UserlandComponent
> implements TreeNode<UserlandComponent> {
private readonly rootController: RootController<UserlandComponent>;
private readonly treeNodeBase: TreeNodeBase<UserlandComponent>;

Expand Down
6 changes: 3 additions & 3 deletions projects/limble-tree/src/lib/events/relational/graft-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { TreeRelationship } from "./tree-relationship.interface";
import type { TreeBranch, TreeNode } from "../../core";

/** Emits when a branch is grafted to another tree node */
export class GraftEvent<UserlandComponent>
implements RelationalTreeEvent<UserlandComponent>
{
export class GraftEvent<
UserlandComponent
> implements RelationalTreeEvent<UserlandComponent> {
private readonly _source: TreeBranch<UserlandComponent>;
private readonly _parent: TreeNode<UserlandComponent>;
private readonly _child: TreeBranch<UserlandComponent>;
Expand Down
6 changes: 3 additions & 3 deletions projects/limble-tree/src/lib/events/relational/prune-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { TreeRelationship } from "./tree-relationship.interface";
import type { TreeNode, TreeBranch } from "../../core";

/** Emitted when a branch is pruned from its parent branch */
export class PruneEvent<UserlandComponent>
implements RelationalTreeEvent<UserlandComponent>
{
export class PruneEvent<
UserlandComponent
> implements RelationalTreeEvent<UserlandComponent> {
private readonly _source: TreeBranch<UserlandComponent>;
private readonly _parent: TreeNode<UserlandComponent>;
private readonly _child: TreeBranch<UserlandComponent>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import type { TreeBranch, TreeNode } from "../../core";
import type { TreeEvent } from "../tree-event.interface";

/** A TreeEvent which involves a parent/child relationship */
export interface RelationalTreeEvent<UserlandComponent>
extends TreeEvent<UserlandComponent> {
export interface RelationalTreeEvent<
UserlandComponent
> extends TreeEvent<UserlandComponent> {
/** @returns The parent branch of the relationship */
parent: () => TreeNode<UserlandComponent>;
/** @returns The child branch of the relationship */
Expand Down
Loading