-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathcustom-node-chart.js
More file actions
43 lines (40 loc) · 1.21 KB
/
custom-node-chart.js
File metadata and controls
43 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from "react";
import OrganizationChart from "../components/ChartContainer";
import MyNode from "./my-node";
const CustomNodeChart = () => {
const ds = {
id: "n1",
name: "Lao Lao",
title: "general manager",
children: [
{ id: "n2", name: "Bo Miao", title: "department manager" },
{
id: "n3",
name: "Su Miao",
title: "department manager",
children: [
{ id: "n4", name: "Tie Hua", title: "senior engineer" },
{
id: "n5",
name: "Hei Hei",
title: "senior engineer",
children: [
{ id: "n6", name: "Dan Dan", title: "engineer" },
{ id: "n7", name: "Xiang Xiang", title: "engineer" }
]
},
{ id: "n8", name: "Pang Pang", title: "senior engineer" }
]
},
{ id: "n9", name: "Hong Miao", title: "department manager" },
{
id: "n10",
name: "Chun Miao",
title: "department manager",
children: [{ id: "n11", name: "Yue Yue", title: "senior engineer" }]
}
]
};
return <OrganizationChart datasource={ds} chartClass="myChart" NodeTemplate={MyNode}/>;
};
export default CustomNodeChart;