{"id":26948806,"url":"https://github.com/mickamy/frappe-gantt-react-wrapper","last_synced_at":"2025-04-02T21:35:24.456Z","repository":{"id":285034392,"uuid":"956868641","full_name":"mickamy/frappe-gantt-react-wrapper","owner":"mickamy","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-29T03:25:21.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T03:27:31.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mickamy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-29T02:34:46.000Z","updated_at":"2025-03-29T03:25:25.000Z","dependencies_parsed_at":"2025-03-29T03:37:37.299Z","dependency_job_id":null,"html_url":"https://github.com/mickamy/frappe-gantt-react-wrapper","commit_stats":null,"previous_names":["mickamy/frappe-gantt-react-wrapper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Ffrappe-gantt-react-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Ffrappe-gantt-react-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Ffrappe-gantt-react-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickamy%2Ffrappe-gantt-react-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mickamy","download_url":"https://codeload.github.com/mickamy/frappe-gantt-react-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246897905,"owners_count":20851698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T21:35:23.853Z","updated_at":"2025-04-02T21:35:24.449Z","avatar_url":"https://github.com/mickamy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# frappe-gantt-react-wrapper\n\nA minimal React wrapper component for [frappe-gantt](https://github.com/frappe/gantt), built with TypeScript.\n\n## Features\n\n- 🧩 Simple React wrapper for `frappe-gantt`\n- 🔧 Written in TypeScript\n- 📦 Compatible with React 18+\n- 🎯 Minimal, easily extensible\n\n## Installation\n\n```\nnpm install frappe-gantt-react-wrapper frappe-gantt\n```\n\n\u003e react and react-dom are required as peer dependencies.\n\u003e\n\n## Usage\n\n```\nimport React from 'react';\nimport FrappeGantt, { Task } from 'frappe-gantt-react-wrapper';\nimport 'frappe-gantt/dist/frappe-gantt.css';\n\nconst tasks: Task[] = [\n  {\n    id: 'Task-1',\n    name: 'Design',\n    start: '2025-04-01',\n    end: '2025-04-05',\n    progress: 80\n  },\n  {\n    id: 'Task-2',\n    name: 'Development',\n    start: '2025-04-06',\n    end: '2025-04-15',\n    progress: 20,\n    dependencies: 'Task-1'\n  }\n];\n\nexport default function App() {\n  return \u003cFrappeGantt tasks={tasks} viewMode=\"Month\" /\u003e;\n}\n```\n\n## Props\n\n| Prop | Type | Required | Description |\n| --- | --- | --- | --- |\n| `tasks` | `Task[]` | ✅ | List of Gantt tasks |\n| `viewMode` | `'Day' | 'Week' | ...` | ❌ | Initial view mode (default: Day) |\n| `onClickTask` | `(task: Task) =\u003e void` | ❌ | Callback for task click events |\n\n## Task Shape\n\n```\nexport interface Task {\n  id?: string;\n  name: string;\n  start: string;\n  end?: string;\n  duration?: string;\n  progress: number;\n  dependencies?: string | string[];\n  color?: string;\n  custom_class?: string;\n}\n```\n\n## Internal Logic\n\nThe component uses `useEffect` and `ref` to manage the chart lifecycle.\n\n```\nuseEffect(() =\u003e {\n  if (!containerRef.current) return;\n\n  if (!ganttRef.current) {\n    ganttRef.current = new Gantt(containerRef.current, tasks, {\n      view_mode: viewMode,\n      on_click: onClickTask,\n    });\n  } else {\n    ganttRef.current.refresh(tasks);\n    ganttRef.current.change_view_mode(viewMode);\n  }\n\n  return () =\u003e {\n    containerRef.current.innerHTML = '';\n    ganttRef.current = null;\n  };\n}, [tasks, viewMode, onClickTask]);\n```\n\n## Build and Publish\n\n```\nnpm run build\nnpm publish --access public\n```\n\nMake sure your `package.json` includes the appropriate fields:\n\n```\n{\n  \"main\": \"dist/frappe-gantt-react-wrapper.umd.js\",\n  \"module\": \"dist/frappe-gantt-react-wrapper.es.js\",\n  \"types\": \"dist/index.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \"./dist/frappe-gantt-react-wrapper.es.js\",\n      \"require\": \"./dist/frappe-gantt-react-wrapper.umd.js\",\n      \"types\": \"./dist/index.d.ts\"\n    }\n  },\n  \"files\": [\"dist\", \"src\"]\n}\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickamy%2Ffrappe-gantt-react-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickamy%2Ffrappe-gantt-react-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickamy%2Ffrappe-gantt-react-wrapper/lists"}