跳转到主要内容

LoopGantt JSON 导入架构

使用我们简单的 JSON 格式,以编程方式创建甘特图

LoopGantt 是一款免费的 AI 驱动甘特图工具,同时支持 JSON 导入和导出。您可以在 loopgantt.com/import 从 JSON 导入项目,也可以将现有甘特图导出为 JSON、CSV、PDF 或 PNG 格式。非常适合程序化项目管理和 AI 生成的进度计划。

快速开始

要从 JSON 创建甘特图,请访问 loopgantt.com/import,并按以下格式粘贴项目数据:

{
  "name": "Website Redesign",
  "description": "Complete website redesign project with modern UI",
  "tasks": [
    {
      "name": "Requirements Gathering",
      "duration": 3,
      "dependencies": []
    },
    {
      "name": "Wireframe Design",
      "duration": 5,
      "dependencies": [
        0
      ]
    },
    {
      "name": "Visual Design",
      "duration": 7,
      "dependencies": [
        1
      ]
    },
    {
      "name": "Frontend Development",
      "duration": 10,
      "dependencies": [
        2
      ]
    },
    {
      "name": "Backend Integration",
      "duration": 8,
      "dependencies": [
        3
      ]
    },
    {
      "name": "Testing & QA",
      "duration": 5,
      "dependencies": [
        3,
        4
      ]
    },
    {
      "name": "Launch",
      "duration": 0,
      "dependencies": [
        5
      ],
      "isMilestone": true
    }
  ]
}

立即试用! 复制上面的示例,即刻创建您的甘特图。

打开导入工具 →

架构参考

项目对象

字段类型必填说明
namestring有项目名称
descriptionstring无项目描述
startDatestring(ISO 日期)无项目开始日期(默认为今天)
tasksTask[]有任务对象数组

任务对象

字段类型必填说明
namestring有任务名称
durationnumber有以天为单位的工期(里程碑填 0)
dependenciesnumber[]无此任务所依赖的任务索引数组
descriptionstring无任务描述或备注
isMilestoneboolean无标记为里程碑(工期应为 0)

示例

简单项目

{
  "name": "Product Launch",
  "tasks": [
    {
      "name": "Planning",
      "duration": 5,
      "dependencies": []
    },
    {
      "name": "Development",
      "duration": 10,
      "dependencies": [
        0
      ]
    },
    {
      "name": "Launch",
      "duration": 0,
      "dependencies": [
        1
      ],
      "isMilestone": true
    }
  ]
}

含并行任务的项目

{
  "name": "Marketing Campaign",
  "tasks": [
    {
      "name": "Strategy",
      "duration": 3,
      "dependencies": []
    },
    {
      "name": "Content Creation",
      "duration": 7,
      "dependencies": [
        0
      ]
    },
    {
      "name": "Design Assets",
      "duration": 5,
      "dependencies": [
        0
      ]
    },
    {
      "name": "Review",
      "duration": 2,
      "dependencies": [
        1,
        2
      ]
    },
    {
      "name": "Go Live",
      "duration": 0,
      "dependencies": [
        3
      ],
      "isMilestone": true
    }
  ]
}

配合 AI 使用

给 AI 用户的提示:您可以让 ChatGPT、Claude 或其他 AI 助手生成 LoopGantt 格式的项目 JSON。只需说:“用 LoopGantt 格式为[您的项目]创建一份甘特图 JSON”,然后把结果粘贴到 loopgantt.com/import。

API 集成

您也可以通过我们的导入 API 以编程方式创建项目。向 /api/import 发送带有 JSON 项目数据的 POST 请求:

POST /api/import
Content-Type: application/json

{
  "name": "My Project",
  "tasks": [...]
}

// Response:
{
  "success": true,
  "projectId": "uuid",
  "redirectUrl": "/dashboard/project/uuid"
}

免密钥 API 与 MCP 服务器——无需账户

AI 代理最快的途径:POST https://loopgantt.com/api/v1/gantt 无需任何密钥、无需任何账户即可创建图表——响应中包含计算好的进度计划、关键路径,以及可查看和导出(PNG/PDF)图表的分享链接。或者干脆跳过 HTTP:在 Claude、ChatGPT 或 Cursor 中把 https://loopgantt.com/api/mcp 添加为 MCP 连接器,然后用日常语言提出计划需求。完整详情请参阅 AI 代理与 MCP 页面和 OpenAPI 规范。

准备好创建您的甘特图了吗?

立即导入 JSON →