Skip to content

Neovici/cosmoz-treenode

Repository files navigation

<cosmoz-treenode>

Build Status semantic-release

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-treenode

Usage

<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 8000
  • npm run build - Builds the TypeScript source files
  • npm run build:watch - Watches and builds TypeScript files
  • npm test - Runs tests with coverage
  • npm run test:watch - Runs tests in watch mode
  • npm run storybook:build - Builds Storybook for production
  • npm run storybook:preview - Builds and previews Storybook

Development

This component is written in TypeScript. The source files are in the src/ directory.

Development workflow

  1. Clone the repository
  2. Install dependencies: npm ci
  3. Start Storybook: npm start

Testing

Run tests:

npm test

Run tests in watch mode:

npm run test:watch

License

Apache-2.0

About

Utility class to manipulate a tree data structure.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 13