{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-organization-chart",
  "framework": "react",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "organization-chart",
  "dependencies": [
    "@syncfusion/ej2-react-diagrams",
    "@syncfusion/ej2-react-inputs",
    "@syncfusion/ej2-data"
  ],
  "description": "Organization chart arranges local employee data in a horizontally aligned hierarchy.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/diagram-organization-chart.md"
  },
  "files": [
    {
      "target": "src/components/diagram-organization-chart/Diagram.tsx",
      "content": "import {\n  type TreeInfo,\n  Node,\n  LayoutAnimation,\n  HierarchicalTree,\n  DataBinding,\n  DiagramComponent,\n  type NodeModel,\n  type ConnectorModel,\n  ConnectorConstraints,\n  SnapConstraints,\n  Inject,\n  DiagramTools\n} from \"@syncfusion/ej2-react-diagrams\";\nimport { DataManager } from \"@syncfusion/ej2-data\";\nimport { localBindData } from \"../datasource/diagram-organization-chart-data\";\n\nexport interface EmployeeInfo {\n  Role: string;\n  color: string;\n}\n\nexport interface DataInfo {\n  [key: string]: string;\n}\n\nconst SAMPLE_CSS = `\n/* Property panel orientation and sub tree alignment */\n.diagram-organization .image-pattern-style {\n        background-color: white;\n        background-size: contain;\n        background-repeat: no-repeat;\n        height: 75px;\n        width: calc((100% - 18px) / 3);\n        cursor: pointer;\n        border: 1px solid #D5D5D5;\n        background-position: center;\n        float: left;\n    }\n\n    .diagram-organization .image-pattern-style:hover {\n        border-color: gray;\n        border-width: 2px;\n    }\n\n    .diagram-organization .row {\n        margin-left: 0px;\n        margin-right: 0px;\n    }\n\n    .diagram-organization .row-header {\n        font-size: 13px;\n        font-weight: 500;\n    }\n\n    .diagram-organization .property-panel-header {\n      padding-top: 15px;\n      padding-bottom: 15px;\n    }\n\n    .diagram-organization .e-selected-orientation-style {\n        border-color: #006CE6;\n        border-width: 2px;\n    }\n\n    .diagram-organization .e-selected-pattern-style {\n        border-color: #006CE6;\n        border-width: 2px;\n    }\n\n    .diagram-organization .col-xs-6 {\n        padding-left: 0px;\n        padding-right: 0px;\n    }`;\n\nfunction OrganizationModel() {\n  //sets default value for Node.\n  function nodeDefaults(obj: Node): Node {\n    obj.backgroundColor = (obj.data as EmployeeInfo).color;\n    obj.style = { fill: \"none\", strokeColor: \"none\", color: \"white\" };\n    obj.expandIcon = {\n      height: 10,\n      width: 10,\n      shape: \"None\",\n      fill: \"lightgray\",\n      offset: { x: 0.5, y: 1 }\n    };\n    obj.expandIcon.verticalAlignment = \"Center\";\n    obj.expandIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };\n    obj.collapseIcon = { height: 10, width: 10, shape: \"None\", fill: \"lightgray\", offset: { x: 0.5, y: 1 } };\n    obj.collapseIcon.verticalAlignment = \"Center\";\n    obj.collapseIcon.margin = { left: 0, right: 0, top: 0, bottom: 0 };\n    obj.width = 120;\n    obj.height = 30;\n    return obj;\n  }\n\n  //sets default value for Connector.\n  function connectorDefaults(\n    connector: ConnectorModel,\n  ): ConnectorModel {\n    if (connector.targetDecorator) {\n      connector.targetDecorator.shape = \"None\";\n    }\n    connector.type = \"Orthogonal\";\n    connector.constraints = ConnectorConstraints.None;\n    connector.cornerRadius = 0;\n    return connector;\n  }\n\n  return (\n    <div className=\"control-pane diagram-organization\">\n      <style>{SAMPLE_CSS}</style>\n      <div className=\"col-lg-8 control-section\">\n        <div  style={{ width: \"100%\" }}>\n          <DiagramComponent\n            id=\"diagram\"\n            width={\"100%\"}\n            height={\"700px\"}\n            snapSettings={{ constraints: SnapConstraints.None }}\n            //configures data source settings\n            dataSourceSettings={{\n              id: \"Id\",\n              parentId: \"Manager\",\n              dataSource: new DataManager(localBindData as unknown as JSON[]),\n              doBinding: (\n                nodeModel: NodeModel,\n                data: object,\n              ) => {\n                nodeModel.shape = {\n                  type: \"Text\",\n                  content: (data as EmployeeInfo).Role,\n                  margin: { left: 10, right: 10, top: 10, bottom: 10 },\n                };\n              },\n            }}\n            //Disables all interactions except zoom/pan\n            tool={DiagramTools.ZoomPan}\n            //Configures automatic layout\n            layout={{\n              type: \"OrganizationalChart\",\n              getLayoutInfo: (node: Node, options: TreeInfo) => {\n                if ((node.data as DataInfo)[\"Role\"] === \"General Manager\") {\n                  options.assistants?.push(options.children?.[0] as never);\n                  options.children?.splice(0, 1);\n                }\n                if (!options.hasSubTree) {\n                  options.type = \"Right\";\n                }\n              },\n            }}\n            //Defines the default node and connector properties\n            getNodeDefaults={(obj: Node) => {\n              return nodeDefaults(obj);\n            }}\n            getConnectorDefaults={(\n              connector: ConnectorModel,\n            ) => {\n              return connectorDefaults(connector);\n            }}\n          >\n            <Inject\n              services={[DataBinding, HierarchicalTree, LayoutAnimation]}\n            />\n          </DiagramComponent>\n        </div>\n      </div>\n\n    </div>\n  );\n}\nexport default OrganizationModel;\n"
    }
  ]
}