lucid_create_diagram_from_specification
ChatGPTCreates a Lucid document using the Standard Import format (.lucid file). The Standard Import format allows creating rich diagrams with shapes, lines, groups, layers, images, and data-backed elements. lucid_create_diagram_from_specification creates a .lucid ZIP file containing a document.json with your specification. Args: title: The title for the new document standard_import_json: JSON string in Lucid Standard Import format product: Target product - either "lucidchart" or "lucidspark" use_assisted_layout: When true (default), automatically arranges shapes with optimal spacing and alignment. Set to false when precise positioning matters, or when the diagram uses containers, swim lanes, BPMN pools, or other structures where shape placement within specific regions is meaningful — auto-layout may move shapes out of their intended containers. Example prompts for lucid_create_diagram_from_specification: - "Create a flowchart with a blue rectangle at the top labeled 'Start', connected to a yellow diamond below it labeled 'Decision'" - "Make a diagram with 3 boxes arranged horizontally: 'Input' on the left (green), 'Process' in the middle (blue), 'Output' on the right (red), with arrows connecting them" - "Create a swimlane diagram with lanes for Sales, Engineering, and Support" - "Build a BPMN process with a start event, two parallel tasks, and an end event" Standard Import JSON Format: The JSON must follow Lucid's Standard Import specification. Basic structure: { "version": 1, "pages": [ { "id": "page1", "title": "Page 1", "shapes": [ { "id": "shape1", "type": "rectangle", "boundingBox": {"x": 100, "y": 100, "w": 200, "h": 100}, "text": "Hello World" } ], "lines": [ { "id": "line1", "lineType": "straight", "endpoint1": { "type": "shapeEndpoint", "style": "none", "shapeId": "shape1", "position": {"x": 1, "y": 0.5} }, "endpoint2": { "type": "positionEndpoint", "style": "arrow", "position": {"x": 400, "y": 250} }, "stroke": { "color": "#000000", "width": 2, "style": "solid" }, "text": [ { "text": "connects to", "position": 0.5, "side": "middle" } ] } ] } ] } PAGE PROPERTIES: - id (required): Unique identifier for the page - title (optional): Title displayed on the page tab SHAPE TYPE REGISTRY: Use these exact type names in your Standard Import JSON: Standard Library: - "rectangle": Basic rectangular block (default block shape) - "text": Text-only shape (does NOT accept style property) - "hotspot": Interactive area (does NOT accept text property) - "image": Image block - "image" (required): {type: "image", url: "image_url"} - "stroke" (required): {color: "#000000", width: 1, style: "solid, dashed, or dotted"} - "stickyNote": Sticky note shape (requires style property) - "lucidCard": Project management card block with structured fields. Use to represent Tasks, Stories, and Epics. - "title" (optional): Card title text - "description" (optional): Card description text - "status" (optional): Status field value (string) - New, To Do, In Progress, Done, Not Doing, or Blocked - "estimate" (optional): Estimate field value (number) - "tshirtSize" (optional): T-shirt size field value (string) - XS, S, M, L, XL, XXL - "assignee" (optional): Assignee field value (string) - "startTime" (optional): Start time field value (number, Unix timestamp in milliseconds) - "endTime" (optional): End time field value (number, Unix timestamp in milliseconds) - Note: Does NOT accept a "text" property - use the field-specific properties instead Shape Library: - "circle": Circle shape - "rectangle": Rectangle shape - "diamond": Diamond shape - "hexagon": Hexagon shape - "pentagon": Pentagon shape - "octagon": Octagon shape - "cloud": Cloud shape - "cross": Cross/plus shape - "polyStar": Star shape with configurable points - "shape" (required): {"numPoints": 5, "innerRadius": 0.5} - "singleArrow": Arrow shape (has orientation property) - "doubleArrow": Double-headed arrow - "isoscelesTriangle": Isosceles triangle - "rightTriangle": Right triangle Container Library: NOTE: Containers are intended to contain other shapes, not text. Shapes can be added to a container by placing them within the boundaries of the container. CONTAINER TITLES: Some containers support an optional "containerTitle" property that displays a title above the container. Containers that support containerTitle: rectangleContainer, roundedRectangleContainer, circleContainer, pillContainer Containers that do NOT support containerTitle: braceContainer, bracketContainer, diamondContainer, swimLanes Example: {"type": "rectangleContainer", "boundingBox": {...}, "containerTitle": {"text": "My Container Title"}} Containers do not have a "text" property. - "braceContainer": Brace-style container (no container title support) - "bracketContainer": Bracket-style container (no container title support) - "circleContainer": Circular container (supports container title) - "diamondContainer": Diamond-shaped container (no container title support) - "pillContainer": Pill/rounded rectangle container (supports container title) - "rectangleContainer": Rectangular container (supports container title) - "roundedRectangleContainer": Rounded rectangle container (supports container title) - "swimLanes": Swim lanes container (no container title support) - "vertical" (required): Controls lane orientation: - vertical: true → lanes are COLUMNS (side-by-side, left-to-right). Each lane's "width" = horizontal width. Sum of lane widths must equal boundingBox.w - vertical: false → lanes are ROWS (stacked, top-to-bottom). Each lane's "width" = vertical height of the row. Sum of lane widths must equal boundingBox.h - "titleBar" (required): {"height": 50, "verticalText": true/false} - "lanes" (required): Array of {"title": "Swim lane 1", "width": 300, "headerFill": "#635DFF", "laneFill": "#F2F3F5"} - title, width, headerFill, and laneFill are REQUIRED for each lane - IMPORTANT: The "width" property represents the lane's size in the direction lanes are stacked: - If vertical: true (columns) → "width" is the horizontal width of each column - If vertical: false (rows) → "width" is the vertical HEIGHT of each row (despite being called "width") - Examples: // Vertical swim lanes (side-by-side columns) {"type": "swimLanes", "boundingBox": {"w": 1000, "h": 800}, "vertical": true, "lanes": [{"title": "Lane 1", "width": 500, ...}, {"title": "Lane 2", "width": 500, ...}]} // Sum: 500+500=1000 (matches boundingBox.w ✓) // Horizontal swim lanes (stacked rows) {"type": "swimLanes", "boundingBox": {"w": 1000, "h": 800}, "vertical": false, "lanes": [{"title": "Lane 1", "width": 400, ...}, {"title": "Lane 2", "width": 400, ...}]} // Sum: 400+400=800 (matches boundingBox.h ✓) - "width" here means row height! Flowchart Library: - "braceNote": Brace note shape - "rightFacing" (required): boolean, TOP-LEVEL property (not nested in "shape") - "braceWidth" (required): number, TOP-LEVEL property (not nested in "shape") Example: {"type": "braceNote", "rightFacing": true, "braceWidth": 15, "boundingBox": {...}, ...} - "connector": Connector shape - "database": Database symbol - "decision": Decision diamond - "process": Process rectangle - "terminator": Start/end oval - "manualInput": Manual input trapezoid - "offPageLink": Off-page connector - "document": Document shape - "multipleDocuments": Multiple documents - "internalStorage": Internal storage shape - "directAccessStorage": Direct access storage shape - "manualOperation": Manual operation shape - "preparation": Preparation hexagon - "predefinedProcess": Predefined process - "sideWidth" (required): number 0-0.33, TOP-LEVEL property (not nested in "shape") Example: {"type": "predefinedProcess", "sideWidth": 0.1, "boundingBox": {...}, ...} - "storedData": Stored data shape - "delay": Delay shape - "data": Data parallelogram - "merge": Merge triangle - "or": OR gate (no text property) - "summingJunction": Summing junction (no text property) - "display": Display shape - "note": Note shape - "paperTape": Paper tape shape Lucidspark Library: - "sparkCalloutSquare": Callout square - "sparkContainer": Spark container - "sparkFrame": Spark frame with title - "title" (required): use instead of "text" property UML Library: - "umlClass": UML Class block with three text sections for class diagrams. - "title" (optional): Class name text (e.g. "UserService") - "properties" (optional): List of attribute strings (e.g. ["- name: String", "- id: long"]) - "methods" (optional): List of method strings (e.g. ["+ getName(): String", "- setId(id: long): void"]) - "propertiesHeight" (optional): Ratio (0-1) controlling the vertical split between the properties and methods sections, where 0 gives all space to methods and 1 gives all space to properties (default 0.5) - Note: Does NOT accept a "text" property - use "title", "properties", and "methods" instead BPMN 2.0 Library: - "bpmnActivity": BPMN activity - activityType (required): may have values "task", "transaction", "eventSubProcess", or "callActivity" - "bpmnEvent": BPMN event - eventGroup (required): "start", "intermediate", or "end" - eventType (optional): "none", "message", "timer", "escalation", "conditional", "link", "error", "cancel", "compensation", "signal", "multiple", "parallelMultiple", or "terminate" - "bpmnGateway": BPMN gateway - gatewayType (optional): "none", "exclusive", "eventBased", "parallel", "inclusive", "exclusiveEventBased", "complex", or "parallelEventBased" - "bpmnPool": BPMN pool (horizontal/vertical with lanes) - title (required): "Pool Title" - lanes (required): Array of {"title": "Lane", "width": 300, "laneFill": "#0000"} - title, width, and laneFill are REQUIRED for each lane - IMPORTANT: "width" represents the lane's size in the stacking direction (same behavior as swimLanes): - If vertical: true → "width" is horizontal width of each column - If vertical: false → "width" is vertical HEIGHT of each row - vertical (required): true/false for orientation - vertical: true → lanes are columns. Sum of lane widths must equal boundingBox.w - vertical: false → lanes are rows. Sum of lane widths must equal boundingBox.h - "bpmnChoreography": BPMN choreography - choreographyType (required): "task", "subchoreography", or "call" - participants (required): Array of {"text": "Participant", "multipleParticipants": false} - name (optional): The name of the initiator - taskName (optional): The name of the task - "bpmnConversation": BPMN conversation - isCall (optional): makes the block into a call block, defaults to false - isSubConversation (optional): makes the block into a sub-conversation block, defaults to false - "bpmnDataObject": BPMN data object - dataType (optional): may have values "none", "collection", "input", or "output" - "bpmnDataStore": BPMN data store - "bpmnTextAnnotation": BPMN text annotation - "bpmnGroup": BPMN group - "bpmnBlackBoxPool": BPMN black box pool Table Library: - "table": Table with rows and columns - rowCount (required): Number of rows in the table - colCount (required): Number of columns in the table - cells (required): FLAT ARRAY of cell objects, each with: - xPosition (required): Column index starting at 0 - yPosition (required): Row index starting at 0 - text (optional): Cell content (string) - style (optional): Cell styling - fill: {type: "color", color: "#hexcolor"} - mergeCellsRight: Number of cells to merge horizontally (default 0) - mergeCellsDown: Number of cells to merge vertically (default 0) - Note: When using mergeCellsRight or mergeCellsDown, do not define cells that will be occupied by the merged cell. Only define the starting cell with the merge property. Common Shape Properties: - id (required): Unique identifier string - type (required): Shape type from registry above - boundingBox (required): {x: number, y: number, w: number, h: number} - text (optional): "text content" for display text - style (optional): {fill: {...}, stroke: {...}, textColor: "..."} - fill (optional): {type: "color", color: "#hexcolor"} - stroke (optional): {color: "#000000", width: 1, style: "solid, dashed, or dotted"} - textColor (optional): Hex color string for text color (e.g. "#ff0000"). Overrides automatic contrast color. - opacity (optional): Number between 0 (transparent) and 100 (opaque) - note (optional): Additional text note Shape Ordering (Z-Index): Shapes are rendered in the order they appear in the shapes array. Shapes defined LATER in the array appear IN FRONT OF (on top of) shapes defined earlier. If you need a shape to appear behind other shapes, place it earlier in the shapes array. Line Properties: - id (required): Unique identifier - lineType (required): "straight", "elbow", or "curved" - endpoint1 (required): Connection definition - endpoint2 (required): Connection definition - stroke: Line styling - text: Line labels (Array[LineText]) - LineText: {"text": "test", "position": 0.5, "side": "middle"} - "position" may be between 0 and 1 and indicates relative position along the line - "side" may be "top", "middle", or "bottom" and indicates how the text should be displayed on the line Endpoint Types: IMPORTANT: The "style" property on each endpoint specifies the line ending decoration that appears AT THAT ENDPOINT. For a directional arrow pointing from shape A to shape B: - endpoint1 (source/start): use style: "none" - endpoint2 (destination/end): use style: "arrow" Example: A line with an arrow pointing from shape1 to shape2: {"endpoint1": {"type": "shapeEndpoint", "style": "none", "shapeId": "shape1"}, "endpoint2": {"type": "shapeEndpoint", "style": "arrow", "shapeId": "shape2"}} - shapeEndpoint: Connect to a shape {type: "shapeEndpoint", style: "arrow", shapeId: "shape1", position: {x: 0.5, y: 0.5}} - type (required): "shapeEndpoint" - style (required): The decoration at this endpoint. Values: "none", "arrow", "hollowArrow", "openArrow", "aggregation", "async1", "async2", "closedSquare", "openSquare", "bpmnConditional", "bpmnDefault", "closedCircle", "openCircle", "composition", "exactlyOne", "generalization", "many", "nesting", "one", "oneOrMore", "zeroOrMore", "zeroOrOne" - shapeId (required): ID of the target shape - position (optional): RelativePosition object {x: 0-1, y: 0-1} for where on the shape to connect. (x: 0 is far left, x: 0.5 is middle, x: 1 is far right). IMPORTANT: Position must be specified on BOTH endpoints or NEITHER - specifying position on only one endpoint will fail. If neither endpoint on a line has a relative position provided, the line will be a "smart line", where the attachment points automatically adjust based on the relative placements of the shapes connected by the line. - positionEndpoint: Connect to an absolute position on the canvas {type: "positionEndpoint", style: "arrow", position: {x: 100, y: 100}} - type (required): "positionEndpoint" - style (required): The decoration at this endpoint. Values: "none", "arrow", "hollowArrow", "openArrow", "aggregation", "async1", "async2", "closedSquare", "openSquare", "bpmnConditional", "bpmnDefault", "closedCircle", "openCircle", "composition", "exactlyOne", "generalization", "many", "nesting", "one", "oneOrMore", "zeroOrMore", "zeroOrOne" - position (required): Position object - x (required): Absolute x coordinate - y (required): Absolute y coordinate - lineEndpoint: Connect to another line {type: "lineEndpoint", style: "arrow", lineId: "line1", position: 0.5} - type (required): "lineEndpoint" - style (required): The decoration at this endpoint. Values: "none", "arrow", "hollowArrow", "openArrow", "aggregation", "async1", "async2", "closedSquare", "openSquare", "bpmnConditional", "bpmnDefault", "closedCircle", "openCircle", "composition", "exactlyOne", "generalization", "many", "nesting", "one", "oneOrMore", "zeroOrMore", "zeroOrOne" - lineId (required): ID of the target line - position (required): NUMBER (0-1) representing position along the line (NOT an object!) Property Formats: - Color values must be hexcode color strings with prefix, in the format of a standard RGB, RGBA, RRGGBB, or RRGGBBAA hexcode color string (e.g., "#FF0000") - Boolean values must be true/false, not strings - Numbers must be numeric types, not strings - Text values must NOT contain emoji characters (they render as black boxes) Size Limits: - Total document.json: 2MB maximum - Use concise JSON without unnecessary whitespace for large diagrams