balkan-orgchart-react-community 9.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "balkan-orgchart-react-community",
3
+ "type": "module",
4
+ "types": "./index.es.d.ts",
5
+ "main": "./index.umd.js",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./index.es.d.ts",
9
+ "import": "./index.es.js",
10
+ "require": "./index.umd.js"
11
+ }
12
+ },
13
+ "peerDependencies": {
14
+ "react": ">=17",
15
+ "react-dom": ">=17"
16
+ },
17
+ "files": [
18
+ "index.es.js",
19
+ "index.umd.js",
20
+ "index.es.d.ts",
21
+ "package.json",
22
+ "readme.md"
23
+ ],
24
+ "author": {
25
+ "name": "BALKAN App <support@balkan.app> (https://balkan.app)"
26
+ },
27
+ "sideEffects": false,
28
+ "bugs": {
29
+ "email": "support@balkan.app",
30
+ "url": "https://github.com/BALKANGraph/OrgChartReact/issues"
31
+ },
32
+ "deprecated": false,
33
+ "description": "React organizational chart library for visualizing hierarchy, company structure, and team relationships with interactive diagrams.",
34
+ "homepage": "https://balkan.app/",
35
+ "keywords": [
36
+ "react-organizational-chart",
37
+ "react-orgchart",
38
+ "reactorgchart",
39
+ "react-org-chart",
40
+ "react-hierarchy",
41
+ "react-tree",
42
+ "react-hierarchical-data",
43
+ "react-tree-visualization",
44
+ "react-data-visualization",
45
+ "react-diagram",
46
+ "react-employee-chart",
47
+ "react-company-structure",
48
+ "react-hierarchy-chart",
49
+ "react-chart-library"
50
+ ],
51
+ "license": "Community",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/BALKANGraph/OrgChartReact-Community.git"
55
+ },
56
+ "dependencies": {
57
+ "balkan-orgchart-js-community": "^9.1.80"
58
+ },
59
+ "version": "9.1.80"
60
+ }
package/readme.md ADDED
@@ -0,0 +1,177 @@
1
+ # ![OrgChart JS](https://orgchartjs.balkan.app/favicon-32x32.png) OrgChart React Community
2
+
3
+
4
+
5
+ **BALKAN OrgChart React Community** is a powerful **JavaScript library** for building **interactive organizational charts and hierarchy diagrams**. Create responsive org charts for **company structures, HR systems, dashboards, and internal tools** with minimal code and full customization.
6
+
7
+ ![OrgChart React Community](https://balkan.app/Content/Img/oc.png)
8
+
9
+ ## [Docs](https://balkan.app/OrgChartReact/Docs/GettingStarted) &nbsp;&nbsp;&nbsp;&nbsp; [Support](https://balkan.app/OrgChartReact/Support)
10
+
11
+
12
+ <br>
13
+
14
+ ## Overview
15
+
16
+ **OrgChart React Community** is free and comes with all of the core features expected from a React Organizational chart, including [Expand/Collapse](https://balkan.app/OrgChartReact/Docs/ExpandCollapse), [Custom Template](https://balkan.app/OrgChartReact/Docs/CreatingCustomTemplate), [Minimize/Maximize](https://balkan.app/OrgChartReact/Docs/MinMax), [CSS Customization](https://balkan.app/OrgChartReact/Docs/CSSCustomization) and more.
17
+
18
+ <br>
19
+
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install balkan-orgchart-react-community
25
+ ```
26
+
27
+ or with yarn:
28
+
29
+ ```bash
30
+ yarn add balkan-orgchart-react-community
31
+ ```
32
+
33
+
34
+
35
+
36
+
37
+
38
+ ## Declarative Usage
39
+
40
+ ```js
41
+
42
+ import {OrgChartReact, Employee} from "balkan-orgchart-react-community";
43
+
44
+ export const ChartExample = () => {
45
+ return <OrgChartReact nodeBinding={{ field_0: 'name', field_1: 'title', img_0: 'photo'}} >
46
+ <Employee name='Denny Curtis' title='CEO' photo='https://cdn.balkan.app/shared/a/6.jpg'>
47
+ <Employee name='Lexie Cole' title='QA Lead' photo='https://cdn.balkan.app/shared/a/5.jpg'></Employee>
48
+ <Employee name='Janae Barrett' title='Technical Director' photo='https://cdn.balkan.app/shared/a/4.jpg'></Employee>
49
+ <Employee name='Aaliyah Webb' title='Assistant' photo='https://cdn.balkan.app/shared/a/3.jpg'></Employee>
50
+ </Employee>
51
+ </OrgChartReact>
52
+ }
53
+
54
+ ```
55
+
56
+
57
+ ## Load form JSON
58
+
59
+ ```js
60
+
61
+ import {OrgChartReact} from "balkan-orgchart-react-community";
62
+
63
+ export const ChartExample = () => {
64
+ const [jsonData, setJsonData] = useState([]);
65
+
66
+ useEffect(() => {
67
+ fetch('/data.json')
68
+ .then((response) => response.json())
69
+ .then((data) => {
70
+ setJsonData(data)
71
+ })
72
+ .catch((error) => {
73
+ console.error('Error loading data:', error)
74
+ })
75
+ }, []);
76
+
77
+ return <OrgChartReact data={jsonData} nodeBinding={{ field_0: 'name', field_1: 'title' }}></OrgChartReact>
78
+ }
79
+
80
+
81
+
82
+ ```
83
+
84
+ ## Custom Template
85
+
86
+ ```js
87
+ import {OrgChartReact, Employee, Template} from "balkan-orgchart-react-community";
88
+
89
+ export const ChartExample = () => {
90
+ return <OrgChartReact template='myTemplate1'>
91
+
92
+ <Template name='myTemplate1' nodeWidth={200} nodeHeight={100} baseTemplateName='ana' renderNode={(node, data) => {
93
+ return <>
94
+ <rect x="0" y="0" height={node.h} width={node.w} fill="#fff" stroke="#aeaeae" strokeWidth={1} rx={10} ry={10}> </rect>
95
+
96
+ <text x={node.w ? node.w / 2 : 0} y={node.h ? node.h / 2 + 10: 0} fill="#aeaeae" fontSize="20" textAnchor="middle">
97
+ {data.employeeName}
98
+ </text>
99
+ </>
100
+ }}>
101
+ </Template>
102
+
103
+ <Template name='myTemplate2' nodeWidth={500} nodeHeight={500} baseTemplateName='myTemplate1'></Template>
104
+
105
+ <Employee employeeName='Denny Curtis' >
106
+ <Employee employeeName='Lexie Cole'></Employee>
107
+ <Employee employeeName='Janae Barrett' template='myTemplate2'></Employee>
108
+ <Employee employeeName='Aaliyah Webb'></Employee>
109
+ </Employee>
110
+ </OrgChartReact>
111
+ }
112
+
113
+
114
+ ```
115
+
116
+
117
+ ## API Call
118
+
119
+
120
+ ```js
121
+
122
+
123
+ import { OrgChartReact, Employee, OrgChartJS } from "balkan-orgchart-react-community";
124
+
125
+ export const ChartExample = () => {
126
+ const chartRef = useRef<OrgChartJS>(null);
127
+
128
+ const handleExport = () => {
129
+ if (chartRef.current) {
130
+ chartRef.current.exportToPDF();
131
+ }
132
+ };
133
+
134
+ return (
135
+ <>
136
+ <button onClick={handleExport} style={{ fontSize: "24px"}}>Export PDF</button>
137
+
138
+ <OrgChartReact ref={chartRef} nodeBinding={{ field_0: "name", field_1: "title", img_0: "photo" }} >
139
+ <Employee name="Denny Curtis" title="CEO" photo="https://cdn.balkan.app/shared/a/6.jpg">
140
+ <Employee name="Lexie Cole" title="QA Lead" />
141
+ <Employee name="Janae Barrett" title="Technical Director" />
142
+ <Employee name="Aaliyah Webb" title="Assistant" />
143
+ </Employee>
144
+ </OrgChartReact>
145
+ </>
146
+ );
147
+ };
148
+
149
+
150
+ ```
151
+
152
+
153
+
154
+
155
+ You can call any API method from [here](https://balkan.app/OrgChartJS/API/classes/OrgChart)
156
+
157
+
158
+
159
+ <br>
160
+
161
+ <br>
162
+
163
+ ## Other Framework-Specific OrgChart JS Libraries
164
+ - Community
165
+ - [balkan-orgchart-js-community](https://www.npmjs.com/package/balkan-orgchart-js-community)
166
+ - [balkan-orgchart-react-community](https://www.npmjs.com/package/balkan-orgchart-react-community)
167
+ - [balkan-orgchart-vue-community](https://www.npmjs.com/package/balkan-orgchart-vue-community)
168
+ - [balkan-orgchart-angular-community](https://www.npmjs.com/package/balkan-orgchart-angular-community)
169
+ - Commercial - FREE Trial License
170
+ - [balkan-orgchart-js](https://www.npmjs.com/package/balkan-orgchart-js)
171
+ - [balkan-orgchart-react](https://www.npmjs.com/package/balkan-orgchart-react)
172
+ - [balkan-orgchart-vue](https://www.npmjs.com/package/balkan-orgchart-vue)
173
+ - [balkan-orgchart-angular](https://www.npmjs.com/package/balkan-orgchart-angular)
174
+
175
+ <br>
176
+
177
+ ## [Docs](https://balkan.app/OrgChartReact/Docs/GettingStarted) &nbsp;&nbsp;&nbsp;&nbsp; [Support](https://balkan.app/OrgChartReact/Support)