{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-swimlane",
  "framework": "vue",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "swimlane",
  "dependencies": [
    "@syncfusion/ej2-vue-diagrams"
  ],
  "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/vue/llms.txt",
    "skillPack": "syncfusion/vue-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/vue/diagram-swimlane.md"
  },
  "files": [
    {
      "target": "src/components/diagram-swimlane/Diagram.vue",
      "content": "<template>\n  <div class=\"control-section diagram-swimlane\">\n    <link href=\"https://ej2.syncfusion.com/javascript/demos/src/diagram/styles/diagram-common.css\" rel=\"stylesheet\">\n    <div id=\"swimlaneDiagram\" style=\"width: 100%;\">\n      <div class=\"sb-mobile-palette-bar\" ref=\"paletteIcon\">\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\" ref=\"paletteSpace\">\n        <!-- Configures the symbolpalette with dynamic properties and settings -->\n        <ejs-symbolpalette id=\"symbolpalette\" :expandMode='expandMode' :palettes='palettes' :width='palettewidth' :height='paletteheight' :symbolMargin='symbolMargin' :symbolHeight='symbolHeight' :symbolWidth='symbolWidth' :getConnectorDefaults='getConnectorDefaults' :getNodeDefaults='getNodeDefaults'></ejs-symbolpalette>\n      </div>\n      <div id=\"diagram-space\" class=\"sb-mobile-diagram\">\n          <!-- Configures the diagram with dynamic properties and settings -->\n        <ejs-diagram style='display:block' ref=\"diagramObject\" id=\"diagram\" :width='width' :height='height' :nodes='nodes' :connectors='connectors' :getConnectorDefaults='getConnectorDefaults'  :snapSettings='snapSettings' :getNodeDefaults='getNodeDefaults'  :contextMenuSettings='contextMenuSettings' :dragEnter='dragEnter'  :contextMenuOpen='contextMenuOpen'\n      :contextMenuClick='contextMenuClick'></ejs-diagram>\n      </div>\n    </div>\n  </div>\n</template>\n    <style scoped>\n        .diagram-swimlane .e-toggle-palette::before {\n            content: \"\\e700\"\n        }\n\n    /* These styles are used for aligning palette and diagram */\n        .diagram-swimlane .sb-mobile-palette {\n            width: 195px;\n            height: 559px;\n            float: left;\n        }\n\n        .diagram-swimlane .sb-mobile-palette-bar {\n            display: none;\n        }\n\n        .diagram-swimlane .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            .diagram-swimlane .sb-mobile-palette {\n                z-index: 19;\n                position: absolute;\n                display: none;\n                transition: transform 300ms linear, visibility 0s linear 300ms;\n                width: 39%;\n                height: 100%;\n            }\n            .diagram-swimlane .sb-mobile-diagram {\n                width: 100%;\n                /* height: 100%;\n                float: left;\n                left: 0px; */\n            }\n            .diagram-swimlane .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            .diagram-swimlane #palette-icon {\n                font-size: 20px;\n            }\n        }\n        .diagram-swimlane .sb-mobile-palette-open {\n          position: absolute;\n          display: block;\n          right: 15px;\n        }\n    </style>\n<script>\nimport { Browser } from \"@syncfusion/ej2-base\";\nimport {\n  DiagramComponent,\n  SymbolPaletteComponent,\n  SnapConstraints,\n  Node,\n  PortVisibility,\n  PortConstraints,\n  SelectorConstraints,\n  //private method\n   randomId,\n  cloneObject,\n} from \"@syncfusion/ej2-vue-diagrams\";\nlet paletteSpace;\nlet paletteIcon;\nlet pathData = '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//Create and add ports for node.\nlet port = [\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]\nlet diagram;\n//Initialize nodes for the diagram.\nlet nodes = [\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: 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: 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: 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: 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: 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: 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: 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: 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: 440, offsetY: 320,\n            height: 100,\n            width: 650\n        },\n];\n//Initialize connectors for the diagram.\nlet connectors = [\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\nlet selectedItems = { constraints: SelectorConstraints.All & ~SelectorConstraints.Rotate }\n//Define custom menu items\nlet contextMenuSettings = {\n  show: true, items: [\n    {\n      text: 'Clone', id: 'Clone', target: '.e-diagramcontent', iconCss: 'e-menu-icon e-icons e-copy'\n    },\n    {\n      text: 'Cut', id: 'Cut', target: '.e-diagramcontent',iconCss: 'e-menu-icon e-icons e-cut'\n    },\n    {\n      text: 'Paste', id: 'Paste', target: '.e-diagramcontent', iconCss: 'e-menu-icon 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//Handle click event for menu items.\nfunction contextMenuClick(args) {\n  if (args.item.id === 'InsertLaneBefore' || args.item.id === 'InsertLaneAfter') {\n    if (diagram.selectedItems.nodes.length > 0 && (diagram.selectedItems.nodes[0]).isLane) {\n      let index;\n      let node = diagram.selectedItems.nodes[0];\n      let swimlane = diagram.getObject((diagram.selectedItems.nodes[0]).parentId);\n      let shape = swimlane.shape;\n      let existingLane = cloneObject(shape.lanes[0]);\n\n      let newLane = {\n        id: randomId(),\n        header: {\n          width: existingLane.header.width, height: existingLane.header.height,\n          style: existingLane.header.style\n        },\n        style: existingLane.style,\n        height: existingLane.height, width: existingLane.width,\n      };\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        diagram.addLanes(swimlane, [newLane], index);\n      } else {\n        diagram.addLanes(swimlane, [newLane], index + 1);\n      }\n      diagram.clearSelection();\n    }\n  } else if (args.item.id === 'Cut') {\n    diagram.cut();\n  } else if (args.item.id === 'Clone') {\n    diagram.copy();\n  }else if (args.item.id === 'Paste') {\n    diagram.paste();\n  }\n}\n//Open the context menu \nfunction contextMenuOpen(args) {\n  for (let item of args.items) {\n    if ((diagram.selectedItems.connectors.length + diagram.selectedItems.nodes.length) > 0) {\n      if (item.id === 'InsertLaneBefore' || item.id === 'InsertLaneAfter') {\n        if (diagram.selectedItems.connectors.length || (diagram.selectedItems.nodes.length && !(diagram.selectedItems.nodes[0]).isLane)) {\n          args.hiddenItems.push(item.text);\n        }\n      }\n    } else {\n      args.hiddenItems.push(item.text);\n    }\n  }\n}\n// Initializes the palettes to be displayed in the symbol palette.\nlet palettes = [\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: port\n                },\n                {\n                    id: 'Process',  addInfo: { tooltip: 'Process' }, width: 50, height: 60, shape: { type: 'Flow', shape: 'Process' },  ports: port\n                },\n                {\n                    id: 'Decision', addInfo: { tooltip: 'Decision' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Decision' },  ports: port\n                },\n                {\n                    id: 'Document', addInfo: { tooltip: 'Document' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Document' },  ports: port\n                },\n                {\n                    id: 'Predefinedprocess', addInfo: { tooltip: 'Predefined process' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'PreDefinedProcess' }, ports: port\n                },\n                {\n                    id: 'Data', addInfo: { tooltip: 'Data' }, width: 50, height: 50, shape: { type: 'Flow', shape: 'Data' }, ports: 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      }, {\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  {\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        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         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 //Sets the node properties for DragEnter element.\nfunction dragEnter(arg) {\n  if (arg.element instanceof Node) {\n    let shape = arg.element.shape;\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//Set the default values for a node.\nfunction getNodeDefaults(node) {\n  node.style.strokeColor = \"#717171\";\n  return node;\n}\n//Set the default values for a Connector.\nfunction getConnectorDefaults(connector) {\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  setConnectorStyles(connector, '#717171');\n  return connector;\n}\n    //set styles for connector\n    function setConnectorStyles(connector, color) {\n      connector.targetDecorator.style.strokeColor = color;\n      connector.targetDecorator.style.fill = color;\n      connector.style.strokeColor = color;\n      connector.style.strokeWidth = 1;\n  } \n\nfunction getSymbolInfo(symbol) {\n  return { tooltip: symbol.addInfo ? symbol.addInfo.tooltip : symbol.id };\n}\n\nexport default {\n  components: {\n    // Defines components for the diagram and symbol palette\n    'ejs-diagram': DiagramComponent,\n    'ejs-symbolpalette': SymbolPaletteComponent\n  },\n  data: function() {\n    return {\n      // Initialize component data\n      width: \"100%\",\n      height: \"100%\",\n      nodes: nodes,\n      connectors: connectors,\n      getConnectorDefaults: getConnectorDefaults,\n      getNodeDefaults: getNodeDefaults,\n      snapSettings: {\n        constraints: SnapConstraints.All & ~SnapConstraints.ShowLines\n      },\n      contextMenuSettings: contextMenuSettings,\n      contextMenuOpen: contextMenuOpen,\n      contextMenuClick: contextMenuClick,\n      getSymbolInfo:getSymbolInfo,\n      dragEnter:dragEnter,\n      selectedItems: selectedItems,\n      expandMode: \"Multiple\",\n      palettes: palettes,\n      palettewidth: \"100%\",\n      paletteheight: '100%',\n      symbolMargin: { left: 8, right: 8, top: 8, bottom: 8 },\n      symbolHeight: 48, symbolWidth: 48,\n    };\n  }, mounted: function() {\n    diagram = this.$refs.diagramObject.ej2Instances;\n    paletteIcon = this.$refs.paletteIcon;\n    paletteSpace = this.$refs.paletteSpace;\n    diagram.fitToPage();\n    addEvents();\n  }\n}\n//Adds EventListener based on device's viewport width.\nfunction addEvents() {\n  var isMobile = window.matchMedia(\"(max-width:550px)\").matches;\n  if (isMobile) {\n    if (paletteIcon) {\n      paletteIcon.addEventListener(\"click\", openPalette, false);\n    }\n  }\n}\n\n//Toggles the visibility of the palette space on mobile devices when the palette icon is clicked.\nfunction openPalette() {\n  var isMobile = window.matchMedia(\"(max-width:550px)\").matches;\n  if (isMobile) {\n    if (!paletteSpace.classList.contains(\"sb-mobile-palette-open\")) {\n      paletteSpace.classList.add(\"sb-mobile-palette-open\");\n    } else {\n      paletteSpace.classList.remove(\"sb-mobile-palette-open\");\n    }\n  }\n}\n</script>\n"
    }
  ]
}