|
2 | 2 |
|
3 | 3 | A lightweight, browser-native Gantt chart tool. No server, no dependencies, no build step — just open `index.html`. |
4 | 4 |
|
| 5 | +**[Live demo →](https://grantim.github.io/gantt)** |
| 6 | + |
5 | 7 | --- |
6 | 8 |
|
7 | 9 | ## Features |
8 | 10 |
|
9 | | -- **CSV Import** — drag-and-drop, file browse, or paste directly |
| 11 | +- **CSV Import** — drag-and-drop, file browse, or paste directly; chart auto-updates on change |
10 | 12 | - **Task Editor** — spreadsheet-style table that syncs both ways with the CSV |
11 | 13 | - **Auto-duration parents** — leave duration blank and the tool calculates it from children |
12 | | -- **Thread rows** — tasks sharing a Thread Id are grouped into a single row |
13 | | -- **Sublayers** — nested tasks stack visually within their row by depth |
14 | | -- **Resizable sidebar** — drag the divider to give more room to the chart |
| 14 | +- **Thread rows** — tasks sharing a Thread Id are grouped into a single row with sublayers |
| 15 | +- **Dependency-order scheduling** — topological sort ensures correct ordering regardless of CSV row order |
15 | 16 | - **Hover tooltips** — start, end, duration, depth, parent, and requirements on every bar |
| 17 | +- **Light / dark theme** — toggle in the topbar; preference persisted to localStorage |
16 | 18 | - **CSV export** — download the current task list at any time |
| 19 | +- **SVG export** — download a self-contained, fully styled SVG (transparent background, fills container width) |
| 20 | +- **Mobile responsive** — bottom-nav tab layout, touch tooltips, auto re-render on rotation |
| 21 | +- **LocalStorage persistence** — CSV content saved automatically and restored on reload |
17 | 22 |
|
18 | 23 | --- |
19 | 24 |
|
20 | 25 | ## CSV Format |
21 | 26 |
|
22 | | -| Column | Description | |
23 | | -|---|---| |
24 | | -| **Task Name** | Unique identifier for the task | |
25 | | -| **Task Duration** | Duration in any consistent unit (days, seconds…). Leave blank to auto-compute from children | |
26 | | -| **Parent Task** | Name of the parent task (for grouping / sublayers) | |
27 | | -| **Required Tasks** | Semicolon-separated list of tasks that must finish before this one starts | |
28 | | -| **Thread Id** | Tasks with the same Thread Id share a row and run sequentially within the same parent | |
| 27 | +| Column | Required | Description | |
| 28 | +|---|---|---| |
| 29 | +| **Task Name** | ✓ | Unique identifier for the task | |
| 30 | +| **Task Duration** | ✓ | Duration in any consistent unit (seconds, days…). Leave blank to auto-compute from children | |
| 31 | +| **Parent Task** | | Name of the parent task — for grouping and sublayer nesting | |
| 32 | +| **Required Tasks** | | Semicolon-separated tasks that must finish before this one starts | |
| 33 | +| **Thread Id** | | Tasks with the same Thread Id share a row and are chained sequentially within the same parent | |
29 | 34 |
|
30 | 35 | --- |
31 | 36 |
|
@@ -55,55 +60,60 @@ Production Deploy,1,Release & Deploy,QA Sign-off,Ops |
55 | 60 | Post-deploy Monitor,2,Release & Deploy,Production Deploy,Ops |
56 | 61 | ``` |
57 | 62 |
|
58 | | -This produces a 26-day timeline across three threads: |
| 63 | +Three threads running in parallel across a 26-day timeline. Parent tasks (`Release v2.4`, `Design & Planning`, etc.) have blank durations — resolved automatically from their children. |
| 64 | + |
| 65 | +--- |
59 | 66 |
|
60 | | -- **Backend** — Design & Planning (days 0–6) → parallel Auth/Payments/Notifications → Integration Tests |
61 | | -- **Frontend** — runs in parallel with Backend Work after planning; UI Components → Auth Flow + Checkout Flow → E2E Tests |
62 | | -- **Ops** — Release & Deploy phase begins once both Backend Work and Frontend Work are complete |
| 67 | +## Scheduling Rules |
63 | 68 |
|
64 | | -The five parent tasks (`Release v2.4`, `Design & Planning`, `Backend Work`, `Frontend Work`, `Release & Deploy`) all have blank durations — the tool resolves them automatically from their children. |
| 69 | +1. A task starts after all its **Required Tasks** have finished. |
| 70 | +2. A task starts no earlier than its **Parent Task** starts. |
| 71 | +3. Tasks on the same **Thread Id** with the same parent are topologically sorted then linked sequentially — works correctly regardless of CSV row order. |
| 72 | +4. **Null-duration parents** are resolved iteratively: the scheduler reruns until each parent's span converges to the actual max end of its children, handling arbitrarily deep nesting. |
65 | 73 |
|
66 | 74 | --- |
67 | 75 |
|
68 | | -## Files |
| 76 | +## File Structure |
69 | 77 |
|
70 | 78 | ``` |
71 | | -index.html — markup only; links to gantt.css and gantt.js |
72 | | -gantt.css — all styles and design tokens |
73 | | -gantt.js — parsing, scheduling, rendering, and UI logic |
74 | | -favicon.svg — app icon |
75 | | -example.csv — the software release pipeline above |
76 | | -README.md — this file |
| 79 | +index.html — app shell; loads gantt-core.js + gantt-ui.js |
| 80 | +gantt-core.js — pure logic: CSV parsing, scheduling, SVG export (no DOM) |
| 81 | +gantt-ui.js — DOM: tooltips, panels, table editor, export, theme, auto-render |
| 82 | +gantt.css — styles and design tokens (light + dark theme) |
| 83 | +favicon.svg — app icon |
| 84 | +example.csv — the software release pipeline above |
| 85 | +svg/ |
| 86 | + index.html — SVG-only endpoint: ?csv=<b64>&w=&h=&theme= → raw SVG |
| 87 | +README.md — this file |
77 | 88 | ``` |
78 | 89 |
|
79 | 90 | --- |
80 | 91 |
|
81 | | -## Scheduling Rules |
82 | | - |
83 | | -1. A task starts after all its **Required Tasks** have finished. |
84 | | -2. A task starts no earlier than its **Parent Task** starts. |
85 | | -3. Tasks on the same **Thread Id** with the same parent are linked sequentially (the tool injects the dependency automatically). |
86 | | -4. **Null-duration parents** are resolved iteratively: the scheduler runs until each parent's span converges to the actual max end of its children — handling arbitrarily deep nesting correctly. |
| 92 | +## SVG Export |
87 | 93 |
|
88 | | ---- |
| 94 | +Click **↓ SVG** in the topbar to download a self-contained SVG of the current chart. |
89 | 95 |
|
90 | | -## Disclaimer |
| 96 | +The SVG uses `width="100%"` with a `viewBox`, so it scales to any container. The export function also accepts options programmatically: |
91 | 97 |
|
92 | | -This tool was built in collaboration with **Claude** (Anthropic), an AI assistant. |
| 98 | +```js |
| 99 | +buildGanttSVG(tasks, threadOrder, { |
| 100 | + width: 1600, // internal coordinate width (default: 1600) |
| 101 | + height: null, // null = auto-fit to row count |
| 102 | + theme: 'dark', // 'dark' | 'light' | null (reads live CSS vars) |
| 103 | +}) |
| 104 | +``` |
93 | 105 |
|
94 | | -The scheduling engine, null-duration resolution algorithm, visual depth computation, CSV parser, and the iterative convergence loop were all designed and debugged through an extended conversation with Claude — including several subtle bugs that Claude caught, reasoned through, and fixed: |
| 106 | +To embed in a GitHub README, download the SVG, commit it to your repo, and link the raw URL: |
95 | 107 |
|
96 | | -- Thread injection creating false cross-subtree dependencies |
97 | | -- Null-duration parents not covering their grandchildren |
98 | | -- Two-pass scheduling underestimating parallel child spans |
99 | | -- Iterative convergence needed for deeply nested null-duration tasks |
| 108 | +```markdown |
| 109 | + |
| 110 | +``` |
100 | 111 |
|
101 | | -The UI, color palette, layout, and overall design were also shaped by Claude's suggestions. |
| 112 | +--- |
102 | 113 |
|
103 | | -Claude's contributions here go well beyond autocomplete — it acted as a genuine engineering partner, holding the full context of the scheduling logic across many iterations and proposing architecturally sound fixes rather than patches. |
| 114 | +## Disclaimer |
104 | 115 |
|
105 | | -> *"The best code review is one where the reviewer understands the problem better than you do."* |
106 | | -> Claude understood this problem very well. |
| 116 | +Built in collaboration with **Claude** (Anthropic). The scheduling engine, null-duration resolution, topological sort, visual depth computation, CSV parser, SVG renderer, mobile layout, and iterative convergence logic were all designed and debugged through an extended conversation with Claude — including several subtle bugs caught, reasoned through, and fixed along the way. |
107 | 117 |
|
108 | 118 | --- |
109 | 119 |
|
|
0 commit comments