thesaurus-tree

Visualization of thesaurus

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
thesaurus-tree
1.3.09 months ago9 months agoMinified + gzip package size for thesaurus-tree in KB

Readme

thesaurus-tree
Visualization of thesaurus

NPM JavaScript Style Guide

Install

npm install --save thesaurus-tree

Usage

import React, { Component } from 'react'

import ThesaurusTree from 'thesaurus-tree'

class Example extends Component {
  render() {
    return (
      <ThesaurusTree
        concept_id={id}
        getOneRequest={getOneRequest}
        getPartRequest={getPartRequest}
        putRequest={putRequest}
      />)
  }
}

Props

| Props | Description | Is required? | Type | DefaultProps | |:---------------|:--------------------------------------------------------------------:|:------------:|:---------------------------------:|:------------:| | conceptid | The main concept that is the basis for the tree | + | int | - | | getOneRequest | Function that sends a request to the server to get one concept | + | (conceptid) => IOneConcept | - | | getPartRequest | Function that sends a request to the server to get part of thesaurus | + | (conceptid) => IPart | - | | putRequest | Function that sends a request to the server for editing one concept | + | (conceptid, IOneConcept) => void | - | | isAdmin | Flag for adding admin capabilities (editing) | - | boolean | false | | orientation | Orientation of tree | - | "vertical" or "horizontal" | "vertical" | |
interface IOneConcept {
 ruName: string,
 enName: string,
 author: string,
 description: string,
 confirmed: boolean
}

interface IPart {
 name: string;
 attributes?: Record<string, string | number | boolean>;
 children?: IPart[];
}

License

MIT © Barashek-1507