All Projects → e-cloud → ngx-tree

e-cloud / ngx-tree

Licence: other
A derived version of angular-tree-component without mobx, better performance.

Programming Languages

typescript
32286 projects
HTML
75241 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ngx-tree

react-org-tree
😃 a simple organization tree component based on react
Stars: ✭ 72 (+453.85%)
Mutual labels:  tree
redrock
Typesafe, reactive redux
Stars: ✭ 14 (+7.69%)
Mutual labels:  rxjs
mst-effect
💫 Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.
Stars: ✭ 19 (+46.15%)
Mutual labels:  rxjs
performant-array-to-tree
Converts an array of items with ids and parent ids to a nested tree in a performant O(n) way. Runs in browsers and Node.js.
Stars: ✭ 193 (+1384.62%)
Mutual labels:  tree
vue2-data-tree
A tree that data is lazy loaded. Support dragging node, checking node, editing node's name and selecting node.
Stars: ✭ 41 (+215.38%)
Mutual labels:  tree
5itv
familytree家谱宗谱族谱 刘三才族裔刘氏族谱网源码
Stars: ✭ 23 (+76.92%)
Mutual labels:  tree
ipld-explorer-cli
🔎 Explore the IPLD directed acyclic graph with your keyboard
Stars: ✭ 22 (+69.23%)
Mutual labels:  tree
filterCSV
Tools to manipulate CSV files in a format suitable for importing into various mindmapping programs - such as iThoughts, Freemind, and MindNode.
Stars: ✭ 29 (+123.08%)
Mutual labels:  tree
js-symbol-tree
Turn any collection of objects into its own efficient tree or linked list using Symbol
Stars: ✭ 86 (+561.54%)
Mutual labels:  tree
rust-lapper
Rust implementation of a fast, easy, interval tree library nim-lapper
Stars: ✭ 39 (+200%)
Mutual labels:  tree
firebase-ignite
Firebase PWA Boilerplate
Stars: ✭ 12 (-7.69%)
Mutual labels:  rxjs
react-rxjs
🔌 "Plug and play" for Observables in React Apps!
Stars: ✭ 36 (+176.92%)
Mutual labels:  rxjs
kirby3-bolt
Kirby 3 Plugin for a fast Page lookup even in big content trees
Stars: ✭ 24 (+84.62%)
Mutual labels:  tree
angular-ebook
Contains the code for the Step-by-Step Angular Guide Ebook
Stars: ✭ 28 (+115.38%)
Mutual labels:  rxjs
ngx-mobx
Mobx decorators for Angular Applications
Stars: ✭ 14 (+7.69%)
Mutual labels:  rxjs
comment tree
Render comment tree like facebook comment - reply
Stars: ✭ 37 (+184.62%)
Mutual labels:  tree
Soft-Decision-Tree
PyTorch Implementation of "Distilling a Neural Network Into a Soft Decision Tree." Nicholas Frosst, Geoffrey Hinton., 2017.
Stars: ✭ 67 (+415.38%)
Mutual labels:  tree
bassdrum
reactive, type safe components with preact and rxjs.
Stars: ✭ 44 (+238.46%)
Mutual labels:  rxjs
jh-weapp-demo
微信小程序项目- 实现一些常用效果、封装通用组件和工具类
Stars: ✭ 60 (+361.54%)
Mutual labels:  tree
rx-query
timdeschryver.github.io/rx-query/
Stars: ✭ 195 (+1400%)
Mutual labels:  rxjs

ngx-tree DEMO

Travis Status Version License

Claims

This module derivates from angular-tree-component. We remove the mobx dependency and do some performance improvements, whilst keep a similar component interface.

Installation

To install this library, run:

$ npm install @e-cloud/ngx-tree --save

NOTE: we use Element.closest, If you want to compromise with IE 11, please apply the polyfill https://github.com/jonathantneal/closest to your probject.

Usage

For details, please take a look at document site

Imports

Once you have installed the library, you can import it in your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { NgxTreeModule } from '@e-cloud/ngx-tree';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Specify your library as an import
    NgxTreeModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Applications

demo usage

<!-- You can now use your library component in app.component.html -->
<h1>
  {{title}}
</h1>
<ngx-tree
  [nodes]="nodes"
  [dataOptions]="customOptions">
  <ng-template #treeNodeTemplate let-node="node">
    <span title="{{node.data.subTitle}}">{{ node.data.name }}</span>
  </ng-template>
</ngx-tree>

NOTE: the minimum input for ngx-tree component is nodes.

Root config

There is a forRoot() method on NgxTreeModule, which should be used only on root module of apps.

forRoot injects two providers, TreeDraggingTargetService and VIRTUAL_SCROLL_NODE_HEIGHT_QUOTA. The first holds the dragging element. The other specify the round size to calculate the average tree item height.

Tree options

We split the tree options into two category, TreeDataOptions and TreeUIOptions. dataOptions inputted by user will be passed into TreeModel which handle the tree data operations. uiOption will be passed into every child components required and declared tree templates(will introduce late).

Tree templates

We predefine five tree templates for flexible customization.

  • loadingTemplate - loading indicator for async nodes
  • expanderTemplate - for tree expander customization,
  • treeNodeTemplate - for customization of tree node contents(not including node children components and node expander, only for every single node's content)
  • treeNodeWrapperTemplate - treeNodeTemplate + full customization over expander
  • treeNodeFullTemplate - treeNodeWrapperTemplate + full customization over how the node children display.

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

License

MIT © e-cloud

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].