treege.mov
yarn add treege
import { Treege } from "treege";
const App = () => {
return <Treege />;
};
export default App;
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 |
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 |
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;
}
You can easily generate a form with the React library
treege-consumer or use our own application !
Clone the repository and install dependencies
yarn install
Locally preview production build
This library uses type definitions from @tracktor/types-treege