A Gantt chart for the browser. Tasks sit in a tree beside a timeline: drag a bar to move it, pull an end to make it longer, slide its progress, or draw a link from one task to another, and every task waiting on it moves later. The critical path shows which tasks decide the end date, and every change can be undone. Charts like this are usually sold per developer; this one is MIT licensed, plain TypeScript, with no dependencies.
Install
- Clone
git clone https://github.com/drkxbt/gantt- Install
npm install github:drkxbt/gantt- Use
gantt(element, { tasks, links, onChange })
Features
- Drag a bar to move it, pull either end, slide its progress; a summary task moves with everything in it
- Draw a link from one task to the next and every task waiting on it moves later; a link that would loop is refused
- The critical path: the tasks with no slack, the ones that move the end date if they slip
- Tasks in a tree with summaries and milestones, edited in place, every change one step to undo
- Days, weeks or months, a keyboard for everything, touch that still scrolls, and a strict Content Security Policy
How it works
- A date is a whole number of days since 1970, read as a calendar date with no time zone, so a task is two integers and a clock change never shifts it.
- Links to and from summary tasks are spread out to the tasks inside them; tasks are then visited after everything they wait for, and each starts no earlier than its latest predecessor ends plus the lag.
- Tasks only ever move later, so one with room to spare keeps its date; tasks caught in a loop are left where they are, and a new link that would close one is refused.
- The critical path works back from the plan's last day: a task whose latest possible finish is its own end has no slack.
- While a bar is held the plan is worked out again from where the drag began, so pulling back undoes the push; letting go makes it one step in the history.
Where it shows here
Only in its own demo for now.
Screenshots
Stack
- TypeScript
- SVG
- Pointer Events
- Node test runner
Run it locally
git clone https://github.com/drkxbt/ganttcd ganttnpm installnpm run demo



