Skip to content

Tracktor/treege

Repository files navigation

Treege

Treege is a tools for decision tree generator

npm version

treege.mov

Installation

yarn add treege

Usage

import { Treege } from "treege";

const App = () => {
  return <Treege />;
};

export default App;

Options

Props Type Default Required Detail
backendConfig object undefined false Backend configuration. Only necessary if you want backend communication.
initialTreeId string undefined false If provided, this will fetch initial tree id. Cannot provided with initialTree in same time
initialTree object undefined false Initial tree data. Cannot provided with initialTreeId in same time

backendConfig

Props Type Default Required Detail
baseUrl string undefined true Base url for API communication. ex : https://api.treege.com
authToken string undefined false Authentication token
endpoints object undefined false Endpoints configuration

endpoints

Props Type Default Required Detail
workflow string undefined "/v1/workflow" Endpoint for get/post/patch single workflow
workflows string undefined "/v1/workflows" Endpoint for get all workflows. It is a array on workflow

Backend model need to be compatible with the following interface:

interface Workflow {
  id: string;
  name: string;
  description: string;
  tree: Tree;
}

Tree is a JSON object generated by Treege with the following interface:

interface Tree {
  name: string;
  attributes: any;
  children: Tree[];
  treeId?: string;
}

How use Treege data ?

You can easily generate a form with the React library treege-consumer or use our own application !

Local installation

Clone the repository and install dependencies

yarn install

Locally preview production build

Convention

Type Definitions

This library uses type definitions from @tracktor/types-treege

About

Form decision tree generator

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages