@neovici/cosmoz-treenode
v6.2.0
Published
Utility class to manipulate a tree data structure.
Downloads
1,324
Readme
<cosmoz-treenode>
A web component to display a node in a tree data structure. Written in TypeScript using PionJS.
Features
- Display a path to a node in a tree structure
- Control display options like maximum nodes to show
- Hide parts of the path from the root
- Customizable separator between path parts
- Fallback text when a path cannot be found
Installation
npm install @neovici/cosmoz-treenodeUsage
<cosmoz-treenode
key-property="pathLocator"
key-value="1.2.3.301"
value-property="name"
path-separator=" / "
hide-from-root="0"
show-max-nodes="0"
fallback="Not found"
></cosmoz-treenode>Scripts
npm start- Starts Storybook development server at port 8000npm run build- Builds the TypeScript source filesnpm run build:watch- Watches and builds TypeScript filesnpm test- Runs tests with coveragenpm run test:watch- Runs tests in watch modenpm run storybook:build- Builds Storybook for productionnpm run storybook:preview- Builds and previews Storybook
Development
This component is written in TypeScript. The source files are in the src/ directory.
Development workflow
- Clone the repository
- Install dependencies:
npm ci - Start Storybook:
npm start
Testing
Run tests:
npm testRun tests in watch mode:
npm run test:watchLicense
Apache-2.0
