thesaurus-tree

1.3.0 • Public • Published

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
concept_id The main concept that is the basis for the tree + int -
getOneRequest Function that sends a request to the server to get one concept + (concept_id) => IOneConcept -
getPartRequest Function that sends a request to the server to get part of thesaurus + (concept_id) => IPart -
putRequest Function that sends a request to the server for editing one concept + (concept_id, 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

Dependents (0)

Package Sidebar

Install

npm i thesaurus-tree

Weekly Downloads

13

Version

1.3.0

License

MIT

Unpacked Size

8.42 MB

Total Files

7

Last publish

Collaborators

  • barashek1507