{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-local-data",
  "framework": "javascript",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "local-data",
  "dependencies": [
    "@syncfusion/ej2-diagrams"
  ],
  "description": "Diagram sample binding local shape data and connector relationships for a simple business flow.",
  "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/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/diagram-local-data.md"
  },
  "files": [
    {
      "target": "src/components/diagram-local-data/diagram.html",
      "content": "<div class=\"control-section\">\n    <div style=\"width: 100%\">\n        <div id=\"container\"></div>\n    </div>\n</div>"
    },
    {
      "target": "src/components/diagram-local-data/diagram.ts",
      "content": "import type { NodeModel, ConnectorModel } from '@syncfusion/ej2-diagrams';\nimport {\n    Diagram, DataBinding, HierarchicalTree, DiagramTools\n} from '@syncfusion/ej2-diagrams';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { species } from '../datasource/diagram-data';\n\nexport interface DataInfo {\n    [key: string]: string;\n}\n\nDiagram.Inject(DataBinding, HierarchicalTree);\n\n//Sets the default values of nodes\nfunction getNodeDefaults(obj: NodeModel): NodeModel {\n    //Initialize shape\n    obj.shape = { type: 'Basic', shape: 'Rectangle' };\n    obj.style = { strokeWidth: 1 };\n    obj.width = 95;\n    obj.height = 30;\n    return obj;\n}\n\n//Sets the default values of connectors\nfunction getConnectorDefaults(connector: ConnectorModel): ConnectorModel {\n    connector.type = 'Orthogonal';\n    connector.style!.strokeColor = '#4d4d4d';\n    connector.targetDecorator!.shape = 'None';\n    return connector;\n}\n\nexport interface EmployeeInfo {\n    Role: string;\n    color: string;\n}\n\n// tslint:disable-next-line:max-func-body-length\nexport function initLocalDataDiagram(): void {\n    //Initializes diagram control\n    let diagram: Diagram = new Diagram({\n        width: '100%', height: '350px',\n        //Configures data source\n        dataSourceSettings: {\n            id: 'Name', parentId: 'Category', dataSource: new DataManager(species),\n            //binds the external data with node\n            doBinding: (nodeModel: NodeModel, data: DataInfo) => {\n                nodeModel.annotations = [\n                    {\n                        /* tslint:disable:no-string-literal */\n                        content: data['Name'],\n                        style: { color: 'black' }\n                    }\n                ];\n                nodeModel.style = { fill: '#ffeec7', strokeColor: '#f5d897', strokeWidth: 1 };\n            }\n        },\n        //Configrues HierarchicalTree layout\n        layout: {\n            type: 'HierarchicalTree', horizontalSpacing: 15, verticalSpacing: 50,\n            margin: { top: 10, left: 10, right: 10, bottom: 0 },\n        },\n        //Sets the default values of nodes\n        getNodeDefaults: getNodeDefaults,\n        //Sets the default values of connectors\n        getConnectorDefaults: getConnectorDefaults,\n        //Disables all interactions except zoom/pan\n        tool: DiagramTools.ZoomPan,\n        snapSettings: { constraints: 0 }\n    });\n    diagram.appendTo('#container');\n}\n"
    }
  ]
}