{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-swimlane",
  "framework": "angular",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "swimlane",
  "dependencies": [
    "@syncfusion/ej2-angular-diagrams",
    "@syncfusion/ej2-navigations"
  ],
  "description": "Swimlane diagram builds a sales process flow chart with parallel lanes, a phase header, and a symbol palette of flow shapes.",
  "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/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/diagram-swimlane.md"
  },
  "files": [
    {
      "target": "src/components/diagram-swimlane/diagram.component.html",
      "content": "<div class=\"control-section\">\n    <style>\n\n\n         #swimlaneDiagram .e-toggle-palette::before {\n             content: \"\\e700\"\n         }\n\n         #swimlaneDiagram .sb-mobile-palette {\n             width: 195px;\n             height: 559px;\n             float: left;\n         }\n\n         #swimlaneDiagram .sb-mobile-palette-bar {\n             display: none;\n         }\n\n         #swimlaneDiagram .sb-mobile-diagram {\n             width: calc(100% - 197px);\n             height: 559px;\n             float: left;\n             border: 1px solid rgba(0, 0, 0, 0.12);\n             border-left: none;\n         }\n\n         @media (max-width: 550px) {\n             #swimlaneDiagram .sb-mobile-palette {\n                 z-index: 19;\n                 position: absolute;\n                 transition: transform 300ms linear, visibility 0s linear 300ms;\n                 width: 39%;\n                 height: 100%;\n             }\n             #swimlaneDiagram .sb-mobile-diagram {\n                 width: 100%;\n             }\n             #swimlaneDiagram .sb-mobile-palette-bar {\n                 display: block;\n                 width: 100%;\n                 background: #fafafa;\n                 padding: 10px 10px;\n                 border: 0.5px solid #e0e0e0;\n                 min-height: 40px;\n             }\n             #swimlaneDiagram #palette-icon {\n                 font-size: 20px;\n             }\n         }\n\n         #swimlaneDiagram .sb-mobile-palette-open {\n             position: absolute;\n             display: block;\n             right: 15px;\n         }\n\n     </style>\n    <div id=\"swimlaneDiagram\" style=\"width: 100%;\">\n        <div class=\"sb-mobile-palette-bar\">\n            <div id=\"palette-icon\" style=\"float: right;\" role=\"button\" class=\"e-ddb-icons1 e-toggle-palette\"></div>\n        </div>\n        <div id=\"palette-space\" class=\"sb-mobile-palette\">\n            <ejs-symbolpalette #symbolpalette id=\"symbolpalette\" [expandMode]='expandMode' [palettes]='palettes' [getSymbolInfo]='getSymbolInfo' width=\"100%\" height=\"100%\" [getNodeDefaults]='getNodeDefaults' [getConnectorDefaults]='getConnectorDefaults' [symbolHeight]=48\n                [symbolWidth]=48>\n            </ejs-symbolpalette>\n        </div>\n        <div id=\"diagram-space\" class=\"sb-mobile-diagram\">\n            <ejs-diagram #diagram id=\"diagram\" width=\"100%\" height=\"100%\" [snapSettings]='snapSettings' [contextMenuSettings]  ='contextMenuSettings' [selectedItems]='selectedItems'\n                [nodes]=\"nodes\" [connectors]=\"connectors\" [getConnectorDefaults]='getConnectorDefaults' (dragEnter)=\"dragEnter($event)\"  (created)=\"diagramCreate($event)\"\n                (contextMenuOpen)=\"contextMenuOpen($event)\" (contextMenuClick)=\"contextMenuClick($event)\" [getNodeDefaults]='getNodeDefaults' (created)=\"created()\">\n            </ejs-diagram>\n        </div>\n    </div>\n</div>"
    },
    {
      "target": "src/components/diagram-swimlane/diagram.component.ts",
      "content": "import { Component, ViewEncapsulation, ViewChild } from '@angular/core';\nimport { DiagramComponent, NodeModel, ConnectorModel, PaletteModel, SnapSettingsModel, SnapConstraints, SymbolPaletteComponent, PointPortModel, PortVisibility, PortConstraints, ContextMenuSettingsModel, IDragEnterEventArgs, DiagramBeforeMenuOpenEventArgs, SwimLaneModel, Node, SymbolInfo, LaneModel, randomId, cloneObject, ShapeStyleModel, HeaderModel, SymbolPaletteModule, DiagramModule,SelectorModel, SelectorConstraints } from '@syncfusion/ej2-angular-diagrams';\nimport { MenuEventArgs, ExpandMode } from '@syncfusion/ej2-navigations';\nimport { paletteIconClick } from '../diagram-common';\n\nlet pathData: string = 'M 120 24.9999 C 120 38.8072 109.642 50 96.8653 50 L 23.135' +\n    ' 50 C 10.3578 50 0 38.8072 0 24.9999 L 0 24.9999 C' +\n    '0 11.1928 10.3578 0 23.135 0 L 96.8653 0 C 109.642 0 120 11.1928 120 24.9999 Z';\n\n/**\n * Sample for swimlane\n */\n@Component({\n    selector: 'control-content',\n    templateUrl: 'diagram.component.html',\n    encapsulation: ViewEncapsulation.None,\n    standalone: true,\n    imports: [SymbolPaletteModule, DiagramModule]\n})\n\nexport class SwimLaneDiagramComponent {\n    //Create and add ports for node.\n    public port: PointPortModel[] = [\n        { id:'Port1', offset: { x: 0, y: 0.5 }, visibility: PortVisibility.Connect | PortVisibility.Hover, constraints: PortConstraints.Default | PortConstraints.Draw },\n        { id:'Port2',offset: { x: 0.5, y: 0 }, visibility: PortVisibility.Connect | PortVisibility.Hover, constraints: PortConstraints.Default | PortConstraints.Draw },\n        { id:'Port3',offset: { x: 1, y: 0.5 }, visibility: PortVisibility.Connect | PortVisibility.Hover, constraints: PortConstraints.Default | PortConstraints.Draw },\n        { id:'Port4',offset: { x: 0.5, y: 1 }, visibility: PortVisibility.Connect | PortVisibility.Hover, constraints: PortConstraints.Default | PortConstraints.Draw }\n    ];\n\n    // Initializes the nodes for the diagram.\n    public nodes: NodeModel[] = [\n        {\n            id: 'swimlane',\n            shape: {\n                type: 'SwimLane',\n                orientation: 'Horizontal',\n                header: {\n                    annotation: { content: 'SALES PROCESS FLOW CHART', style: { fill: 'transparent' } },\n                    height: 50, style: { fontSize: 11 },\n                },\n                lanes: [\n                    {\n                        id: 'stackCanvas1',\n                        header: {\n                            annotation: { content: 'Consumer' }, width: 50,\n                            style: { fontSize: 11 }\n                        },\n                        height: 100,\n                        children: [\n                            {\n                                id: 'node1',\n                                annotations: [\n                                    {\n                                        content: 'Consumer learns \\n of product',\n                                        style: { fontSize: 11 }\n                                    }\n                                ],\n                                margin: { left: 60, top: 30 },\n                                height: 40, width: 100, ports: this.port\n                            },\n                            {\n                                id: 'node2',\n                                shape: { type: 'Flow', shape: 'Decision' },\n                                annotations: [\n                                    {\n                                        content: 'Does \\nConsumer want \\nthe product',\n                                        style: { fontSize: 11 }\n                                    }\n                                ],\n                                margin: { left: 200, top: 20 },\n                                height: 60, width: 120, ports: this.port\n                            },\n                            {\n                                id: 'node3',\n                                annotations: [\n                                    {\n                                        content: 'No sales lead',\n                                        style: { fontSize: 11 }\n                                    }\n                                ],\n                                margin: { left: 370, top: 30 }, shape: { type: 'Path', data: pathData },\n                                height: 40, width: 100, ports: this.port\n                            },\n                            {\n                                id: 'node4',\n                                annotations: [\n                                    {\n                                        content: 'Sell to consumer',\n                                        style: { fontSize: 11 }\n                                    }\n                                ],\n                                margin: { left: 510, top: 30 },\n                                height: 40, width: 100, ports: this.port\n                            },\n                        ],\n                    },\n                    {\n                        id: 'stackCanvas2',\n                        header: {\n                            annotation: { content: 'Marketing' }, width: 50,\n                            style: { fontSize: 11 }\n                        },\n                        height: 100,\n                        children: [\n                            {\n                                id: 'node5',\n                                annotations: [{ content: 'Create marketing campaigns' }],\n                                margin: { left: 60, top: 20 },\n                                height: 40, width: 100, ports: this.port\n                            },\n                            {\n                                id: 'node6',\n                                annotations: [{ content: 'Marketing finds sales leads' }],\n                                margin: { left: 210, top: 20 },\n                                height: 40, width: 100, ports: this.port\n                            }\n                        ],\n                    },\n                    {\n                        id: 'stackCanvas3',\n                        header: {\n                            annotation: { content: 'Sales' }, width: 50,\n                            style: { fontSize: 11 }\n                        },\n                        height: 100,\n                        children: [\n                            {\n                                id: 'node7',\n                                annotations: [{ content: 'Sales receives lead' }],\n                                margin: { left: 210, top: 30 },\n                                height: 40, width: 100, ports: this.port\n                            }\n                        ],\n                    },\n                    {\n                        id: 'stackCanvas4',\n                        header: {\n                            annotation: { content: 'Success' }, width: 50,\n                            style: { fontSize: 11 }\n                        },\n                        height: 100,\n                        children: [\n                            {\n                                id: 'node8',\n                                annotations: [{ content: 'Success helps \\n retain consumer \\n as a customer' }],\n                                margin: { left: 510, top: 20 },\n                                height: 50, width: 100, ports: this.port\n                            }\n                        ],\n                    },\n                ],\n                phases: [\n                    {\n                        id: 'phase1', offset: 170,\n                        header: { annotation: { content: 'Phase' } }\n                    },\n                ],\n                phaseSize: 20,\n            },\n            offsetX: 390, offsetY: 320,\n            height: 100,\n            width: 650\n        },\n    ];\n\n    // Initializes the connectors for the diagram.\n    public connectors: ConnectorModel[] = [\n        {\n            id: 'connector1', sourceID: 'node1',\n            targetID: 'node2'\n        },\n        {\n            id: 'connector2', sourceID: 'node2',\n            targetID: 'node3', annotations: [{content:'No', style: {fill: 'white'}}]\n        },\n        {\n            id: 'connector3', sourceID: 'node4',\n            targetID: 'node8'\n        },\n        {\n            id: 'connector4', sourceID: 'node2',\n            targetID: 'node6', annotations: [{content:'Yes', style: {fill: 'white'}}]\n        },\n        {\n            id: 'connector5', sourceID: 'node5',\n            targetID: 'node1'\n        },\n        {\n            id: 'connector6', sourceID: 'node6',\n            targetID: 'node7'\n        },\n        {\n            id: 'connector7', sourceID: 'node4',\n            targetID: 'node7', sourcePortID: 'Port1', targetPortID: 'Port3'\n        },\n    ];\n\n    // SymbolPalette Properties\n    public expandMode: ExpandMode = 'Multiple';\n    public palettes: PaletteModel[] = [\n        {\n            id: 'flow', expanded: true, title: 'Flow Shapes', symbols: [\n                {\n                    id: 'Terminator', addInfo: { tooltip: 'Terminator' }, width: 50, height: 60, shape: { type: 'Flow', shape: 'Terminator' },ports: this.port\n                },\n                {\n                    id: 'Process',  addInfo: { tooltip: 'Process' }, width: 50, height: 60, shape: { type: 'Flow', shape: 'Process' }, ports: this.port\n                },\n                {\n                    id: 'Decision', addInfo: { tooltip: 'Decision' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Decision' }, ports: this.port\n                },\n                {\n                    id: 'Document', addInfo: { tooltip: 'Document' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Document' },  ports: this.port\n                },\n                {\n                    id: 'Predefinedprocess', addInfo: { tooltip: 'Predefined process' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'PreDefinedProcess' }, ports: this.port\n                },\n                {\n                    id: 'Data', addInfo: { tooltip: 'Data' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Data' }, ports: this.port\n                },\n            ]\n        },\n        {\n            id: 'swimlaneShapes', expanded: true,\n            title: 'Swimlane Shapes',\n            symbols: [\n                {\n                    id: 'Horizontalswimlane', addInfo: { tooltip: 'Horizontal swimlane' },\n                    shape: {\n                        type: 'SwimLane', lanes: [\n                            {\n                                id: 'lane1',\n                                height: 60, width: 150,\n                                header: { width: 50, height: 50, style: {fontSize: 11 } },\n                            }\n                        ],\n                        orientation: 'Horizontal', isLane: true\n                    },\n                    height: 60,\n                    width: 140,\n                    offsetX: 70,\n                    offsetY: 30,\n                }, {\n                    id: 'Verticalswimlane', addInfo: { tooltip: 'Vertical swimlane' },\n                    shape: {\n                        type: 'SwimLane',\n                        lanes: [\n                            {\n                                id: 'lane1',\n                                 height: 150, width: 60,\n                                header: { width: 50, height: 50, style: {  fontSize: 11 } },\n                            }\n                        ],\n                        orientation: 'Vertical', isLane: true\n                    },\n                    height: 140,\n                    width: 60,\n                    offsetX: 70,\n                    offsetY: 30,\n                }, {\n                    id: 'Verticalphase', addInfo: { tooltip: 'Vertical phase' },\n                    shape: {\n                        type: 'SwimLane',\n                        phases: [{ style: { strokeWidth: 1 }, }],\n                        annotations: [{ text: '' }],\n                        orientation: 'Vertical', isPhase: true\n                    },\n                    height: 60,\n                    width: 140,\n                }, {\n                    id: 'Horizontalphase', addInfo: { tooltip: 'Horizontal phase' },\n                    shape: {\n                        type: 'SwimLane',\n                        phases: [{ style: { strokeWidth: 1 } }],\n                        annotations: [{ text: '' }],\n                        orientation: 'Horizontal', isPhase: true\n                    },\n                    height: 60,\n                    width: 140,\n                }\n            ]\n        },\n        {\n            id: 'connectors', expanded: true, symbols: [\n                {\n                    id: 'orthogonal', type: 'Orthogonal', sourcePoint: { x: 0, y: 0 }, targetPoint: { x: 40, y: 40 },\n                    \n                },\n                {\n                    id: 'orthogonaldashed', type: 'Orthogonal', sourcePoint: { x: 0, y: 0 }, targetPoint: { x: 40, y: 40 },\n                     style: { strokeDashArray: '4 4' }\n                },\n                {\n                    id: 'straight', type: 'Straight', sourcePoint: { x: 0, y: 0 }, targetPoint: { x: 60, y: 60 },\n                  \n                },\n                {\n                    id: 'straightdashed', type: 'Straight', sourcePoint: { x: 0, y: 0 }, targetPoint: { x: 60, y: 60 },\n                  style: {strokeDashArray: '4 4'}\n                }\n            ], title: 'Connectors'\n        }\n    ];\n\n    @ViewChild('diagram')\n    public diagram!: DiagramComponent;\n    public palete!: SymbolPaletteComponent;\n    public selectedItems: SelectorModel = { constraints: SelectorConstraints.All & ~SelectorConstraints.Rotate };\n    public snapSettings: SnapSettingsModel = {\n        constraints: SnapConstraints.All & ~SnapConstraints.ShowLines\n    }\n    public created(): void {\n        this.diagram.fitToPage();\n    }\n    //Define custom menu items\n    public contextMenuSettings: ContextMenuSettingsModel = {\n        show: true, items: [\n            {\n                text: 'Clone', id: 'Clone', target: '.e-diagramcontent', iconCss: 'e-icons e-copy'\n            },\n            {\n                text: 'Cut', id: 'Cut', target: '.e-diagramcontent', iconCss: 'e-icons e-cut'\n            },\n            {\n                text: 'Paste', id: 'Paste', target: '.e-diagramcontent', iconCss: 'e-icons e-paste'\n            },\n            {\n                text: 'InsertLaneBefore', id: 'InsertLaneBefore', target: '.e-diagramcontent',\n            },\n            {\n                text: 'InsertLaneAfter', id: 'InsertLaneAfter', target: '.e-diagramcontent',\n            }],\n        showCustomMenuOnly: true,\n    };\n    //Set the default values of a Connector.\n    public getConnectorDefaults(connector: ConnectorModel): ConnectorModel {\n        if ((connector.id!.indexOf(\"straight\") !== -1) || (connector.id!.indexOf(\"straightdashed\") !== -1)) {\n            connector.type = 'Straight';\n        }\n        else {\n            connector.type = 'Orthogonal';\n        }\n        var color = '#717171';\n        //set styles for connector\n        connector.targetDecorator!.style!.strokeColor = color;\n        connector.targetDecorator!.style!.fill = color;\n        connector.style!.strokeColor = color;\n        connector.style!.strokeWidth = 1;\n        return connector;\n    }    \n    public getSymbolInfo(symbol: NodeModel): SymbolInfo {\n       return { tooltip: symbol.addInfo ? (symbol.addInfo as Record<string, string>)['tooltip'] : symbol.id };\n    }\n     //Set the default values of a node.\n    public getNodeDefaults(node: NodeModel) {\n        node.style!.strokeColor = '#717171';\n        node.style!.strokeWidth = 1;\n        return node;\n    }\n   //Set the node style for the DragEnter element.\n    public dragEnter(arg: IDragEnterEventArgs): void {\n        if (arg.element instanceof Node) {\n            let shape: SwimLaneModel = arg.element.shape as SwimLaneModel;\n            if (shape.isLane) {\n                if (shape.orientation === 'Horizontal') {\n                    shape.lanes![0].height = 100;\n                    shape.lanes![0].width = 500;\n                } else if (shape.orientation === 'Vertical') {\n                    shape.lanes![0].height = 500;\n                    shape.lanes![0].width = 100;\n                }\n            }\n        }\n    }\n    //Open the context menu \n    public contextMenuOpen(args: DiagramBeforeMenuOpenEventArgs): void {\n        for (let item of args.items) {\n            if ((this.diagram.selectedItems.connectors!.length + this.diagram.selectedItems.nodes!.length) > 0) {\n                if (item.id === 'InsertLaneBefore' || item.id === 'InsertLaneAfter') {\n                    if (this.diagram.selectedItems.connectors!.length || (this.diagram.selectedItems.nodes!.length && !(this.diagram.selectedItems.nodes![0] as Node).isLane)) {\n                        args.hiddenItems.push(item.text!);\n                    }\n                }\n            } else {\n                args.hiddenItems.push(item.text!);\n            }\n        }\n    }\n //Handle click event for menu items.\n    public contextMenuClick(args: MenuEventArgs): void {\n        if (args.item.id === 'InsertLaneBefore' || args.item.id === 'InsertLaneAfter') {\n            if (this.diagram.selectedItems.nodes!.length > 0 && (this.diagram.selectedItems.nodes![0] as Node).isLane) {\n                let index: number;\n                let node: Node = this.diagram.selectedItems.nodes![0] as Node;\n                let swimlane: NodeModel = this.diagram.getObject((this.diagram.selectedItems.nodes![0] as Node).parentId);\n                let shape: SwimLaneModel = swimlane.shape as SwimLaneModel;\n                let existingLane: LaneModel = cloneObject(shape.lanes![0]);\n\n                let newLane: LaneModel = {\n                    id: randomId(),\n                    header: {\n                        width: existingLane.header!.width, height: existingLane.header!.height,\n                        style: existingLane.header!.style as ShapeStyleModel\n                    } as HeaderModel,\n                    style: existingLane.style as ShapeStyleModel,\n                    height: existingLane.height, width: existingLane.width,\n                } as LaneModel;\n\n                if (shape.orientation === 'Horizontal') {\n                    let exclude = 0;\n                    exclude += (shape.header) ? 1 : 0;\n                    exclude += (shape.phases!.length) ? 1 : 0;\n                    index = node.rowIndex - exclude;\n                    newLane.header!.width = existingLane.header!.width;\n                    newLane.header!.height = existingLane.height;\n                } else {\n                    index = node.columnIndex - (shape.phases!.length) ? 1 : 0;\n                    newLane.header!.width = existingLane.width;\n                    newLane.header!.height = existingLane.header!.height;\n                }\n                if (args.item.id === 'InsertLaneBefore') {\n                    this.diagram.addLanes(swimlane, [newLane], index);\n                } else {\n                    this.diagram.addLanes(swimlane, [newLane], index + 1);\n                }\n                this.diagram.clearSelection();\n            }\n        } else if (args.item.id === 'Cut') {\n            this.diagram.cut();\n        } else if (args.item.id === 'Clone') {\n            this.diagram.copy();\n        }else if (args.item.id === 'Paste') {\n            this.diagram.paste();\n        }\n    }\n    public diagramCreate(args: Object): void {\n        paletteIconClick();\n    }\n}\n"
    }
  ]
}