1.0.1 • Published 3 years ago

ngx-json-tree v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Json2Tree

JSON data to Tree View

This library is mainly created to easily visualize JSON data/string into Object tree. It was generated with Angular CLI version 12.0.5.

Installation

npm install ngx-json-tree

To save this in dependencies: npm install ngx-json-tree --save

Usage

In your parent module, Import Json2TreeModule

@NgModule({
  ...,
  imports: [
    ...,
    Json2TreeModule,
    ...
  ],
  ...
})
export class AppModule { }

In your component: <json2-tree [data]="data"></json2-tree>

To expand all nodes: <json2-tree [data]="data" [expandAllNodes]=true></json2-tree>

To expand only 2 levels: <json2-tree [data]="data" [expandLevel]=2></json2-tree>

Example

An example for this project can be found at github-pages of this repository

Properties

NameTypeDefaultDescription
dataanynullJSON Object or string to display
expandAllNodesbooleanfalseSet this to true to expand all the nodes(If available)
expandLevelnumber-1To expand nodes for given levels
separatorstring:To change the separator
styleanynullInline style of the component

Styles Used

NameElement
jtree-nodeNode element
jnode-togglerToggle element
jnode-keyNode key element
jnode-separatorSeparator element
jnode-valueNode value element
child-jnodeChildren (or) Nested Node element

Dependencies

None.

Changelog

v1.0.0

  • Initial Release

Development

Want to contribute? Great!

Make a change in your file and instantaneously see your updates!

Credits

A credit to JSON formatter where I got the idea to develop this.

Further help

To get more on this, go and check out the json2-tree github page.

Reach out to me

Jeganath PV

Thank you!