@taylorwong/ichartjs 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/LICENSE +201 -0
  3. package/README.md +194 -0
  4. package/agent-recipes/diagrams/agent-orchestration.json +18 -0
  5. package/agent-recipes/diagrams/approval-process.json +16 -0
  6. package/agent-recipes/diagrams/responsibility-mapping.json +13 -0
  7. package/agent-recipes/diagrams/workflow.json +19 -0
  8. package/agent-recipes/foundational-analysis.json +18 -0
  9. package/agent-recipes/project-management.json +47 -0
  10. package/agent-recipes/trend-line.json +21 -0
  11. package/docs/agent/README.md +62 -0
  12. package/docs/agent/charting-scenario.md +82 -0
  13. package/docs/agent/coding-agent-integration.md +88 -0
  14. package/docs/agent/development/2.0-release-readiness.md +65 -0
  15. package/docs/agent/development/iteration-2.md +9 -0
  16. package/docs/agent/development/iteration-3.md +142 -0
  17. package/docs/agent/development/iteration-4.md +261 -0
  18. package/docs/agent/development/iteration-5.md +43 -0
  19. package/docs/agent/development/iteration-6.md +130 -0
  20. package/docs/agent/development/iteration-7.md +117 -0
  21. package/docs/agent/development/iteration-8-acceptance.md +68 -0
  22. package/docs/agent/development/iteration-8.md +116 -0
  23. package/docs/agent/development/iteration-9.md +44 -0
  24. package/docs/agent/development/playground-plan.md +143 -0
  25. package/docs/agent/development/prompt-contract.md +22 -0
  26. package/docs/agent/development/rc-1-acceptance.md +43 -0
  27. package/docs/agent/development/roadmap.md +259 -0
  28. package/docs/agent/development-guide.md +60 -0
  29. package/docs/agent/diagram-scenario.md +82 -0
  30. package/docs/agent/editing-contract.md +71 -0
  31. package/docs/agent/frontend-integration.md +66 -0
  32. package/docs/agent/project-scenario.md +89 -0
  33. package/docs/agent/quickstart.md +205 -0
  34. package/docs/agent/runtime-contract.md +132 -0
  35. package/docs/agent/theme-guide.md +59 -0
  36. package/docs/agent/zh-CN/README.md +26 -0
  37. package/docs/agent/zh-CN/charting-scenario.md +62 -0
  38. package/docs/agent/zh-CN/coding-agent-integration.md +36 -0
  39. package/docs/agent/zh-CN/development-guide.md +31 -0
  40. package/docs/agent/zh-CN/diagram-scenario.md +37 -0
  41. package/docs/agent/zh-CN/editing-contract.md +27 -0
  42. package/docs/agent/zh-CN/frontend-integration.md +31 -0
  43. package/docs/agent/zh-CN/project-scenario.md +40 -0
  44. package/docs/agent/zh-CN/quickstart.md +84 -0
  45. package/docs/agent/zh-CN/runtime-contract.md +85 -0
  46. package/docs/agent/zh-CN/theme-guide.md +50 -0
  47. package/docs/manifests/capabilities.json +79 -0
  48. package/docs/manifests/commands.json +30 -0
  49. package/docs/manifests/schemas.json +13 -0
  50. package/examples/agent-workflow.mjs +94 -0
  51. package/package.json +55 -0
  52. package/skills/ichartjs/SKILL.md +72 -0
  53. package/skills/ichartjs/agents/openai.yaml +4 -0
  54. package/skills/ichartjs/references/agent-contract.md +39 -0
  55. package/skills/ichartjs/references/chart-selection.md +22 -0
  56. package/src/capabilities.mjs +190 -0
  57. package/src/charts.mjs +234 -0
  58. package/src/command.mjs +93 -0
  59. package/src/data.mjs +75 -0
  60. package/src/diagram-interaction.mjs +195 -0
  61. package/src/diagram.mjs +135 -0
  62. package/src/edit-controller.mjs +192 -0
  63. package/src/edit.mjs +369 -0
  64. package/src/format.mjs +19 -0
  65. package/src/history.mjs +14 -0
  66. package/src/index.mjs +562 -0
  67. package/src/plugin.mjs +18 -0
  68. package/src/project-analytics.mjs +357 -0
  69. package/src/project-linking.mjs +72 -0
  70. package/src/project.mjs +370 -0
  71. package/src/recipes.mjs +18 -0
  72. package/src/renderer.mjs +77 -0
  73. package/src/scale.mjs +9 -0
  74. package/src/scene.mjs +18 -0
  75. package/src/schema.mjs +142 -0
  76. package/src/spec.mjs +127 -0
  77. package/src/theme.mjs +232 -0
  78. package/src/transforms.mjs +34 -0
  79. package/src/validation.mjs +106 -0
  80. package/types/index.d.ts +134 -0
@@ -0,0 +1,116 @@
1
+ # Iteration 8 — Chart Completeness and Agent Experience
2
+
3
+ ## Goal
4
+
5
+ Turn the existing chart catalog into a dependable, commonly complete, and Agent-native product surface. Iteration 8 prioritizes finishing expected chart behavior, making capabilities machine-discoverable and outputs explainable, then closing browser, packaging, performance, and 2.0 release gates.
6
+
7
+ ## Current Delivery
8
+
9
+ Iteration 8A–8D is complete. The runtime exposes per-chart capability profiles, deterministic Agent planning and explanation, richer data inspection and diagnostics, common chart presentation behavior, corrected chart geometry, dedicated interaction/accessibility/performance labs, and a maintained full Gallery. Automated, Chromium, Firefox, WebKit, native Safari, 390 px responsive, lifecycle, and local performance acceptance passed. Physical iOS/Android checks remain a recorded host/device follow-up. See `docs/agent/development/iteration-8-acceptance.md`.
10
+
11
+ ## Scope Policy
12
+
13
+ - Do not add public chart types in Iteration 8.
14
+ - Improve the existing 16 public types: Line, Area, Bar, Column, Pie, Scatter, Funnel, Gauge, Heatmap, Radar, Gantt, Timeline, Milestone, Burndown, Flow, and Swimlane.
15
+ - A common feature is required only where its semantics are meaningful. Unsupported behavior must be declared explicitly rather than silently ignored.
16
+ - Prefer reusable runtime, interaction, transform, formatting, and accessibility contracts over chart-specific branches.
17
+ - Preserve deterministic output, stable source record IDs, JSON-safe Specs, and SVG/Canvas semantic parity.
18
+ - Agent recommendations must remain explainable suggestions, not hidden decisions or fabricated data.
19
+
20
+ ## 8A — Existing Chart Feature Completeness
21
+
22
+ 1. Create a chart-by-feature matrix covering title/subtitle, legend, axes, grid, tooltip, labels, formatters, theme, responsive sizing, animation, reduced motion, selection, zoom, pan, keyboard access, empty states, invalid-data states, export, and renderer support.
23
+ 2. Audit every public chart type against the matrix and classify each cell as supported, not applicable, degraded, or missing.
24
+ 3. Complete common presentation behavior: number/date/category formatting, label placement and collision policy, legend visibility and series toggling, axis domains and ticks, theme tokens, and deterministic layout defaults.
25
+ 4. Complete common state behavior: loading, empty data, partial data, invalid values, no-result filters, disabled series, and structured warning display.
26
+ 5. Complete chart-family behavior where applicable: positive/negative stacking, percentage totals, dual axes, pie zero totals, heatmap missing cells, radar domain handling, project schedule overlays, and diagram group/port hit policies.
27
+ 6. Define large-data degradation rules for marks, labels, tooltips, animation, and renderer selection without changing source data.
28
+ 7. Add focused regression tests for every capability newly marked supported.
29
+
30
+ ### Checkpoint
31
+
32
+ - Every public chart has a reviewed feature profile and no declared capability is a placeholder.
33
+ - Common formatting, legend, tooltip, selection, responsive, empty-state, and export behavior is consistent where applicable.
34
+ - Missing or unsupported options produce structured diagnostics instead of silent no-ops.
35
+
36
+ ## 8B — Interaction, Renderer, and Runtime Correctness
37
+
38
+ 1. Systematically verify hover, tooltip, click, selection, wheel zoom, pinch zoom, zoom out, pan, drag, keyboard traversal, keyboard editing, and port connection across applicable chart families.
39
+ 2. Define interaction conflict rules, including drag versus pan, click versus collapse, selection versus background hits, and touch gesture cancellation.
40
+ 3. Align SVG and Canvas geometry, hit testing, semantic data references, focus order, and export-visible state.
41
+ 4. Complete accessibility behavior: chart summaries, roles and labels, keyboard-only operation, focus visibility, reduced motion, contrast themes, and meaningful fallback descriptions.
42
+ 5. Replace ad hoc development cache query keys with one coherent module-version and asset-cache strategy.
43
+ 6. Audit public exports, module boundaries, circular dependencies, package entry points, direct browser loading, and destroy-time cleanup.
44
+ 7. Add browser regression fixtures for previously observed Gallery and Diagram Editor failures.
45
+
46
+ ### Checkpoint
47
+
48
+ - Zoom can both enter and return to the full domain, including from boundary windows.
49
+ - Background clicks never trigger unrelated chart or diagram actions.
50
+ - SVG and Canvas expose equivalent record identity and interaction results.
51
+ - Direct HTTP module loading does not depend on manually changing import query strings.
52
+ - Repeated create/destroy cycles do not retain listeners, observers, tooltips, or plugin state.
53
+
54
+ ## 8C — Agent-Native Planning and Diagnostics
55
+
56
+ 1. Expand the machine-readable capability manifest from global lists to per-chart profiles with supported data shapes, required encodings, compatible interactions, renderer constraints, defaults, limits, and export behavior.
57
+ 2. Define a versioned Agent planning result that includes recommended chart, alternatives, confidence, reasons, required fields, assumptions, warnings, unsupported requests, and safe next actions.
58
+ 3. Improve data inspection so an Agent can identify field roles, units, cardinality, temporal coverage, missingness, invalid values, and ambiguity before producing a Spec.
59
+ 4. Improve Spec validation with stable error codes, precise JSON paths, expected values, actionable repair suggestions, and separation of errors, warnings, and normalizations.
60
+ 5. Add deterministic chart description and explanation output covering selected chart semantics, encodings, transforms, filters, derived values, data lineage, assumptions, warnings, and accessibility summary.
61
+ 6. Add option-level discoverability so an Agent can ask what a chart supports without loading implementation files or guessing configuration names.
62
+ 7. Add compact, intent-oriented recipes for comparison, trend, composition, distribution, relationship, matrix, multidimensional profile, schedule, release, risk, workflow, and responsibility scenarios.
63
+ 8. Add negative recipes and guardrails for misleading choices, including excessive pie categories, mixed-unit radar without domains, truncated axes, invalid stacking, insufficient forecasting data, and unsupported interactions.
64
+ 9. Add Agent contract tests proving capability discovery, recommendation, validation, normalization, explanation, and recipe output are deterministic and mutually consistent.
65
+
66
+ ### Checkpoint
67
+
68
+ - An Agent can discover, plan, validate, render, explain, and self-check a chart through public contracts alone.
69
+ - Capability profiles match actual runtime behavior for every chart and renderer.
70
+ - Recommendations explain tradeoffs and never invent missing fields, units, dates, domains, or business meaning.
71
+ - Diagnostics are stable enough for automated repair loops and concise enough for tool responses.
72
+
73
+ ## 8D — Compatibility, Performance, and 2.0 Release Closure
74
+
75
+ 1. Run the full Gallery and editor acceptance suite in current Chrome, Safari, and Firefox, recording browser-specific limitations.
76
+ 2. Verify responsive layouts at representative 390 px, 768 px, and desktop widths, then perform physical-device touch checks on iOS and Android.
77
+ 3. Establish repeatable performance budgets for representative Line, Heatmap, Gantt, and Diagram datasets, including initial render, interaction latency, memory, and export.
78
+ 4. Verify lifecycle stability under repeated update, resize, renderer switch, plugin enable/disable, and destroy operations.
79
+ 5. Tighten TypeScript declarations for public Specs, chart-specific options, capability profiles, planning results, diagnostics, state, events, and exports.
80
+ 6. Complete 2.0 adoption guidance, API reference, bilingual Agent documentation, versioned manifests, visual baselines, changelog, and release checklist. A 1.x-to-2.0 migration guide is intentionally out of scope because 2.0 is a new Agent-first product line rather than a compatible upgrade.
81
+ 7. Run final package-consumer smoke tests for ESM import, browser module import, representative Agent workflows, and all exact preview URLs.
82
+
83
+ ## Verification
84
+
85
+ - `npm run agent:check` and `git diff --check` pass.
86
+ - The chart-by-feature matrix is backed by automated or recorded browser evidence.
87
+ - All 16 chart types render in the full Gallery with no uncaught errors.
88
+ - Capability, recommendation, validation, runtime state, documentation, and TypeScript declarations agree.
89
+ - SVG and Canvas parity is verified for supported common features and semantic record references.
90
+ - Chrome, Safari, Firefox, mobile viewport, physical-device, performance, and lifecycle gates have explicit results.
91
+ - No new public chart type is introduced during Iteration 8.
92
+
93
+ ## Preview and Acceptance
94
+
95
+ - The target Playground information architecture, page responsibilities, migration decisions, and delivery order are defined in `docs/agent/development/playground-plan.md`.
96
+ - Full chart Gallery: `http://localhost:3000/playground/project-gallery.html`
97
+ - Foundational chart Gallery: `http://localhost:3000/playground/foundational-gallery.html`
98
+ - Project intelligence: `http://localhost:3000/playground/project-intelligence.html`
99
+ - Diagram editor: `http://localhost:3000/playground/diagram-editor.html`
100
+ - Business editing: `http://localhost:3000/playground/editing.html`
101
+ - Start the no-cache server from the repository root with `npm run playground`.
102
+ - Every phase delivery report must state changed capabilities, exact preview URLs, automated results, manual acceptance steps, and deferred environment checks.
103
+
104
+ ## Deliverables
105
+
106
+ - Audited chart-by-feature capability matrix for all 16 public chart types.
107
+ - Completed common chart behavior and chart-family-specific gap fixes.
108
+ - Per-chart machine-readable capability and option metadata.
109
+ - Agent planning, diagnostics, explanation, and self-check contracts.
110
+ - Expanded positive and negative Agent recipes with deterministic contract tests.
111
+ - Browser, mobile, accessibility, performance, lifecycle, packaging, and release acceptance records.
112
+ - Updated runtime, TypeScript declarations, manifests, bilingual documentation, demos, tests, and 2.0 release checklist.
113
+
114
+ ## Completion Definition
115
+
116
+ Iteration 8 is complete when all existing chart types provide their applicable common features reliably; unsupported behavior is explicitly discoverable; an Agent can select, configure, validate, render, explain, and verify charts without reading source code; SVG and Canvas semantics are consistent; browser, mobile, accessibility, performance, lifecycle, packaging, and preview gates are recorded; and the repository is ready for a final iChart.js 2.0 release decision without adding new chart types.
@@ -0,0 +1,44 @@
1
+ # Iteration 9 — Visual Style System and Adaptive Theming
2
+
3
+ Iteration 9 remains part of the `2.0.0` source line. It adds no public chart type and no external runtime dependency.
4
+
5
+ ## Goal
6
+
7
+ Provide a small, consistent built-in visual language that Agents can select by semantic intent, users can override, and both SVG and Canvas can render without separate theme implementations.
8
+
9
+ ## 9A — Tokens and Presets
10
+
11
+ - Add shared color, typography, layout, mark, focus, selection, missing-value, and status tokens.
12
+ - Add `analysis`, `dashboard`, `report`, `presentation`, `project`, and `diagram` presets.
13
+ - Add categorical, sequential, diverging, and status palettes.
14
+ - Preserve custom `colors`, `background`, and `padding` overrides.
15
+
16
+ ## 9B — Adaptive Resolution
17
+
18
+ - Resolve `auto`, `light`, `dark`, and `contrast` modes.
19
+ - Select presets by chart family and host context.
20
+ - Select palettes from data semantics.
21
+ - Expose deterministic reasons and warnings through planning and explanation APIs.
22
+ - Follow host color-scheme changes when mode is automatic.
23
+
24
+ ## 9C — Runtime and Renderer Integration
25
+
26
+ - Add `planStyle()`, `resolveTheme()`, `validateThemeContrast()`, `Chart#setTheme()`, and `Chart#getTheme()`.
27
+ - Apply tokens to generic charts, Heatmap, Radar, project views, diagrams, tooltips, axes, labels, legends, and empty states.
28
+ - Keep SVG and Canvas on the same resolved Spec and Scene Graph.
29
+
30
+ ## 9D — Agent Guidance and Acceptance
31
+
32
+ - Add English and Chinese theme guides.
33
+ - Extend README, quickstarts, Skill guidance, capabilities, and TypeScript declarations.
34
+ - Add the Theme Gallery and controls to the Complete Gallery.
35
+ - Add unit, contract, contrast, and switching regression tests.
36
+
37
+ ## Acceptance
38
+
39
+ - `npm run agent:check` passes without changing package version `2.0.0`.
40
+ - Built-in modes pass the declared contrast checks.
41
+ - Automatic style recommendations are deterministic and explainable.
42
+ - User overrides win and live switching does not recreate charts.
43
+ - Theme behavior is visually inspectable at `http://localhost:3000/playground/theme-gallery.html`.
44
+
@@ -0,0 +1,143 @@
1
+ # Playground Information Architecture
2
+
3
+ ## Purpose
4
+
5
+ The `playground/` directory is the browser-visible product and acceptance surface for iChart.js. It must let a human reviewer browse capabilities, let an Agent integration developer exercise public contracts, and let maintainers reproduce interaction and release failures without reading implementation code.
6
+
7
+ The Playground is not a collection of iteration snapshots. Active pages are organized by stable user task; historical iteration pages should be retired after their unique coverage moves to a maintained page.
8
+
9
+ ## Page Classes
10
+
11
+ ### Entry and Catalog
12
+
13
+ | Page | Role | Required content |
14
+ | --- | --- | --- |
15
+ | `index.html` | Unified Playground home and acceptance entry point. | Runtime version, available chart count, links grouped by catalog/workbench/lab, server instructions, page readiness status, and exact acceptance URLs. |
16
+ | `project-gallery.html` | Canonical full catalog and first visual smoke test for all 16 public chart types. Keep this URL stable despite the historical filename. | Search and category filters, every public chart type, SVG/Canvas coverage, theme and viewport controls, enlarged preview, visible initialization status, Spec inspection, diagnostics, and links to specialized pages. |
17
+ | `foundational-gallery.html` | Focused regression gallery for reusable foundational features introduced in Iteration 7. | Grouped/stacked/percent charts, Donut, Combo, Histogram/Bin, Heatmap, Radar, renderer coverage, source record identity, and expected warnings. |
18
+
19
+ ### Agent and Business Workbenches
20
+
21
+ | Page | Role | Required content |
22
+ | --- | --- | --- |
23
+ | `agent-workbench.html` | Primary Agent integration workbench and Iteration 8 Agent acceptance page. | Editable JSON data and intent, `inspectData`, per-chart capabilities, recommendation and alternatives, planning reasons/confidence, generated or editable Spec, validation/repair diagnostics, render result, chart explanation, normalized state, data lineage, and export. |
24
+ | `project-intelligence.html` | Project analytics and linked-view workbench. | Schedule assumptions/warnings, critical path and slack, baseline/actual variance, capacity, velocity, release forecast, risk, issue aging, linked filters, linked selection, and derived output inspection. |
25
+ | `editing.html` | Safe business-data editing workflow. | Schema inspection, typed command, deterministic preview, affected records, warnings, confirmation boundary, commit, undo/redo, revision, audit metadata, and explicit local-only persistence notice. |
26
+ | `diagram-editor.html` | Diagram authoring and editing workbench. | Node/group/lane/port editing, pointer and keyboard connections, routing, multi-select, clipboard, collapse, validation, normalized DiagramSpec, history, and visible interaction state. |
27
+
28
+ ### Acceptance Labs
29
+
30
+ | Page | Role | Required content |
31
+ | --- | --- | --- |
32
+ | `interaction-lab.html` | Reproduce and verify common interaction behavior independently of Gallery layout. | Hover, tooltip, click, selection, wheel/pinch zoom in and out, pan, drag, keyboard traversal, touch cancellation, event/state log, reset controls, and boundary cases. |
33
+ | `accessibility-lab.html` | Keyboard and semantic acceptance for all applicable chart families. | Focus order, accessible names and summaries, keyboard-only tasks, contrast themes, reduced motion, missing-data descriptions, SVG/Canvas fallback differences, and a visible checklist. |
34
+ | `performance-lab.html` | Repeatable local performance and lifecycle measurements. | Deterministic dataset sizes, renderer switch, render/update/resize/export timing, mark counts, repeated create/destroy cycles, listener/observer status, memory notes, and downloadable result JSON. |
35
+
36
+ ## Existing Page Decisions
37
+
38
+ | Current page | Decision |
39
+ | --- | --- |
40
+ | `project-gallery.html` | Keep as the stable full-gallery URL and improve it; do not rename during 2.0 release closure. |
41
+ | `foundational-gallery.html` | Keep as a focused foundational regression page; avoid adding unrelated future features. |
42
+ | `project-intelligence.html` | Keep as the project analytics workbench. |
43
+ | `editing.html` | Keep as the business editing workbench. |
44
+ | `diagram-editor.html` | Keep as the diagram editing workbench. |
45
+ | `iteration-2.html` | Migrate any unique examples into the full Gallery or interaction lab, then move out of the active Playground or replace it with a compatibility link. Do not continue extending it. |
46
+
47
+ ## Responsibilities and Boundaries
48
+
49
+ - `project-gallery.html` answers: "What chart types exist, and do they render?"
50
+ - `foundational-gallery.html` answers: "Do the shared composition and analysis foundations still work?"
51
+ - `agent-workbench.html` answers: "Can an Agent discover, choose, configure, validate, explain, and verify a chart?"
52
+ - Domain workbenches answer: "Can a user complete this business workflow?"
53
+ - Acceptance labs answer: "Does one cross-cutting quality contract work across chart families?"
54
+ - A page must not duplicate another page's full dataset and controls merely to provide navigation; link to the owning page instead.
55
+ - Release-critical behavior must not be demonstrated only in an old iteration page.
56
+
57
+ ## Shared Page Contract
58
+
59
+ Every active HTML page must:
60
+
61
+ 1. Load directly over HTTP without first visiting another page.
62
+ 2. Import public APIs through the single `playground/runtime.mjs` browser entry; per-page ad hoc cache-busting query strings are not part of the final contract.
63
+ 3. Include a consistent header with page purpose, runtime version, Home link, and related-page links.
64
+ 4. Show initialization, ready, warning, and error states in the page instead of relying on the console.
65
+ 5. Provide deterministic fixtures with stable IDs and no required external network requests.
66
+ 6. Provide a visible reset action for mutable interactions.
67
+ 7. State the exact actions and expected results needed for manual acceptance.
68
+ 8. Expose the relevant Spec, normalized state, diagnostics, events, or measurement output.
69
+ 9. Work at 390 px, 768 px, and desktop widths, with keyboard-visible focus and reduced-motion support.
70
+ 10. Destroy charts and listeners when examples are replaced or the page is unloaded.
71
+
72
+ ## Shared Implementation Direction
73
+
74
+ - Move repeated styles, navigation, status badges, fixture data, and chart-card setup into small shared Playground modules rather than copying them between pages.
75
+ - Serve Playground assets through `npm run playground`, which sends `Cache-Control: no-store`; keep HTML pages and source-module imports free of cache-busting query keys.
76
+ - Keep page-specific scenarios declarative and JSON-friendly so they can also drive automated browser checks.
77
+ - Support deterministic query parameters where useful, such as `renderer`, `theme`, `case`, `size`, and `seed`; ignore unknown parameters with a visible warning.
78
+ - Assign every scenario a stable ID so browser tests, screenshots, Agent explanations, and acceptance records refer to the same case.
79
+ - Keep test instrumentation optional and visually separated from the chart itself.
80
+ - The full Gallery remains lightweight; expensive stress datasets and lifecycle loops belong only in `performance-lab.html`.
81
+
82
+ ## Navigation Model
83
+
84
+ ```text
85
+ index.html
86
+ ├── project-gallery.html
87
+ │ └── foundational-gallery.html
88
+ ├── agent-workbench.html
89
+ ├── project-intelligence.html
90
+ ├── editing.html
91
+ ├── diagram-editor.html
92
+ ├── interaction-lab.html
93
+ ├── accessibility-lab.html
94
+ └── performance-lab.html
95
+ ```
96
+
97
+ All active pages link back to `index.html`. The full Gallery links to relevant focused pages, and focused pages link back to the full Gallery when they display chart output.
98
+
99
+ ## Iteration 8 Delivery Order
100
+
101
+ ### 8A — Catalog Foundation
102
+
103
+ 1. Add `index.html` and shared navigation/status utilities.
104
+ 2. Add the chart-by-feature matrix to the full Gallery or link it from the Gallery.
105
+ 3. Enhance the full Gallery with renderer, theme, viewport, diagnostics, and deterministic scenario controls.
106
+ 4. Migrate unique `iteration-2.html` coverage and freeze the historical page.
107
+
108
+ ### 8B — Interaction and Accessibility Labs
109
+
110
+ 1. Add `interaction-lab.html` with observable events and state.
111
+ 2. Add `accessibility-lab.html` with keyboard and semantic checklists.
112
+ 3. Convert previously fixed Gallery and Diagram Editor bugs into named regression scenarios.
113
+
114
+ ### 8C — Agent Workbench
115
+
116
+ 1. Add `agent-workbench.html` around the public capability, inspection, planning, validation, rendering, explanation, and export contracts.
117
+ 2. Ensure every diagnostic is visible and copyable as structured JSON.
118
+ 3. Add representative successful, ambiguous, invalid, and unsupported Agent scenarios.
119
+
120
+ ### 8D — Performance and Release Hub
121
+
122
+ 1. Add `performance-lab.html` with reproducible datasets and downloadable results.
123
+ 2. Make `index.html` show automated and manual acceptance status for every active page.
124
+ 3. Synchronize README, Agent docs, capability manifests, and release records with exact URLs.
125
+
126
+ ## Exact Target URLs
127
+
128
+ Start the cache-safe preview server with `npm run playground` before opening these URLs.
129
+
130
+ - Home: `http://localhost:3000/playground/index.html`
131
+ - Full Gallery: `http://localhost:3000/playground/project-gallery.html`
132
+ - Foundational Gallery: `http://localhost:3000/playground/foundational-gallery.html`
133
+ - Agent Workbench: `http://localhost:3000/playground/agent-workbench.html`
134
+ - Project Intelligence: `http://localhost:3000/playground/project-intelligence.html`
135
+ - Business Editing: `http://localhost:3000/playground/editing.html`
136
+ - Diagram Editor: `http://localhost:3000/playground/diagram-editor.html`
137
+ - Interaction Lab: `http://localhost:3000/playground/interaction-lab.html`
138
+ - Accessibility Lab: `http://localhost:3000/playground/accessibility-lab.html`
139
+ - Performance Lab: `http://localhost:3000/playground/performance-lab.html`
140
+
141
+ ## Completion Definition
142
+
143
+ The Playground plan is complete when every active page has one clear owner responsibility, all stable URLs are reachable from the Home page, the full catalog and specialized workflows do not conflict, Agent behavior is independently verifiable, cross-cutting quality has dedicated labs, historical iteration pages are no longer release dependencies, and every Iteration 8 delivery report identifies an exact URL and reproducible acceptance procedure.
@@ -0,0 +1,22 @@
1
+ # Agent Prompt Contract
2
+
3
+ ## Code and Documentation Contract
4
+
5
+ - Every active source module under `src/` must begin with a short file-level module comment.
6
+ - The comment states the module responsibility and its important public or behavioral constraints.
7
+ - Public APIs and complex algorithms may add focused JSDoc; line-by-line comments are not required.
8
+ - Agent-facing documentation must describe behavior and contracts, not duplicate implementation details.
9
+ - When a module responsibility changes, update its file-level comment in the same change.
10
+
11
+ When generating a chart, an Agent must:
12
+
13
+ 1. Inspect the input data.
14
+ 2. Identify dimensions and measures.
15
+ 3. Match the chart type to the user intent.
16
+ 4. Generate a JSON-serializable Chart Spec.
17
+ 5. Validate the Spec before rendering.
18
+ 6. Report missing or invalid values.
19
+ 7. Use `describe()` after rendering.
20
+ 8. Treat derived insights as calculations, not source facts.
21
+ 9. Preserve the user's data and avoid mutating input rows.
22
+ 10. Prefer an accessible renderer and non-color encodings when requested.
@@ -0,0 +1,43 @@
1
+ # iChart.js 2.0.0-rc.1 Acceptance Report
2
+
3
+ Date: 2026-09-14
4
+
5
+ ## Runtime gates
6
+
7
+ | Gate | Result | Evidence |
8
+ | --- | --- | --- |
9
+ | Unit tests | Pass | `npm test`, 33/33 tests |
10
+ | Syntax checks | Pass | `npm run check` |
11
+ | Diff whitespace | Pass | `git diff --check` |
12
+ | Combined RC command | Pass | `npm run rc:check` |
13
+ | Headless JSON export | Pass | `Chart.export({ type: 'json' })` |
14
+ | Headless raster export | Explicit unsupported result | `HEADLESS_EXPORT_UNSUPPORTED` |
15
+ | Guarded edit commit | Pass | Preview, confirmation, revision and audit tests |
16
+ | Undo/redo | Pass | History and stale-history tests |
17
+ | Recipe validation | Pass | `validateRecipe()` regression coverage |
18
+
19
+ ## HTTP demo gates
20
+
21
+ - `http://localhost:3000/playground/editing` loads over HTTP.
22
+ - Preview shows deterministic before/after values and affected records.
23
+ - Commit requires the exact preview and confirmation.
24
+ - Commit updates local chart state and revision.
25
+ - Undo and redo controls become available after commit.
26
+ - Demo states clearly that external persistence is not performed.
27
+ - `http://127.0.0.1:3000/playground/diagram-editor.html` exposes Iteration 5 group lifecycle, group resize, pointer/keyboard port connection, and shared history behavior.
28
+ - `http://127.0.0.1:3000/playground/project-gallery.html` exposes the Iteration 5 Flow model and links to the editor.
29
+
30
+ ## Deferred host/device gates
31
+
32
+ These are not claimed as complete by the local runtime:
33
+
34
+ - Physical-device touch testing across iOS and Android.
35
+ - Full browser matrix testing outside the current in-app browser.
36
+ - Host authentication, authorization, approval, and durable persistence.
37
+ - Durable server-side audit storage.
38
+ - Large-data performance budgets on representative hardware.
39
+ - Full ARIA audit and keyboard-only editing review.
40
+
41
+ ## Release decision
42
+
43
+ The repository is functionally ready for `2.0.0-rc.1` review. Do not label it a final production release until the deferred host/device gates are accepted by the integrating application.
@@ -0,0 +1,259 @@
1
+ # iChart.js 2.0 Roadmap
2
+
3
+ > Roadmap baseline: 2026-09-14. Geographic charts and 3D rendering remain out of scope until explicitly reintroduced.
4
+
5
+ ## Current Status
6
+
7
+ - Iteration 1: Agent-first core, Chart Spec, Scene Graph, Canvas/SVG renderers, basic chart types.
8
+ - Iteration 2: Data transforms, scales, multi-series axes, plugins, responsive behavior, touch basics, and chart gallery foundations.
9
+ - Iteration 3: Project management and process visualization foundations, including Gantt, timeline, milestone, burndown, flow, and swimlane.
10
+ - Iteration 3 core functionality is complete; browser/mobile gesture verification remains a release acceptance item.
11
+ - Iteration 6 project intelligence local runtime and browser acceptance are complete.
12
+ - Iteration 7 local runtime and browser acceptance are complete for foundational composition, Heatmap, and Radar; physical-device checks remain host integration evidence.
13
+ - Iteration 8A–8D is complete and accepted in automated tests, Chromium, Firefox 144, WebKit 26, native Safari 26.6.2, and a 390 px touch viewport. Physical iOS/Android and representative release-host measurements remain post-release host/device follow-up. No new public chart type was introduced.
14
+ - Iteration 9A–9D implements the lightweight visual style system, adaptive theme planning, runtime switching, renderer integration, and bilingual Agent guidance without adding a chart type or changing version `2.0.0`.
15
+ - Final `2.0.0` readiness is tracked in `docs/agent/development/2.0-release-readiness.md`; strict TypeScript, Node.js 18/20/22, GitHub Actions, package-consumer, browser, performance, and lifecycle checks pass. Only the final commit, `master` cutover, tag, and GitHub Release remain. npm publication is tracked separately.
16
+
17
+ ## Iteration 4 — Agent Data Contract and Business Editing
18
+
19
+ ### Current status
20
+
21
+ 4A–4E local runtime implementation is complete and included in `2.0.0`. See `docs/agent/development/rc-1-acceptance.md` for the historical RC evidence and `docs/agent/development/2.0-release-readiness.md` for final acceptance.
22
+
23
+ ### Goal
24
+
25
+ Make the runtime reliable for production Agent integrations and allow safe, explainable business-data edits. The complete task list is in `docs/agent/development/iteration-4.md`.
26
+
27
+ ### Tasks
28
+
29
+ 1. Define versioned Business Data Schema and project/diagram data models.
30
+ 2. Add field types, edit permissions, relationships, and cross-field business rules.
31
+ 3. Add typed commands for field, record, task, dependency, progress, node, and lane edits.
32
+ 4. Implement schema validation, data validation, command validation, and deterministic diff preview.
33
+ 5. Add affected-record analysis, dependency policy, critical-path warnings, and confirmation rules.
34
+ 6. Implement commit, rollback, undo, redo, optimistic version checks, and audit records.
35
+ 7. Add editing capability discovery, Agent response contract, and Recipe validation.
36
+ 8. Add TypeScript declarations and framework-neutral data-store adapters.
37
+ 9. Add headless preview/export and deterministic SVG, PNG, and JSON checks.
38
+ 10. Complete keyboard, ARIA, reduced-motion, and mobile editing behavior.
39
+ 11. Add preview/confirm/commit/undo demos for Gantt and Flow.
40
+ 12. Complete real-browser acceptance for desktop, mobile viewport, SVG, and Canvas.
41
+ 13. Retain public API stability, module boundaries, performance benchmarks, and lifecycle leak checks as RC release gates; track them as tasks 66–72 in the detailed plan.
42
+
43
+ ### Verification
44
+
45
+ - `npm test`, `npm run check`, and `git diff --check` pass.
46
+ - Type declarations compile against representative Agent editing examples.
47
+ - Headless preview and export work without a browser DOM.
48
+ - A schema and typed command can preview, confirm, commit, and undo a business edit.
49
+ - Failed or stale edits do not partially mutate source data.
50
+ - SVG and Canvas produce equivalent semantic node/data references.
51
+ - No listener, observer, tooltip, or plugin leak remains after `destroy()`.
52
+ - All public capabilities are discoverable and recipe validation is deterministic.
53
+ - Browser acceptance covers the full gallery and mobile gestures.
54
+
55
+ ### Deliverables
56
+
57
+ - `types/`
58
+ - `docs/agent/api-reference.md`
59
+ - `docs/agent/development/iteration-4.md`
60
+ - `http://localhost:3000/playground/editing` (source page: `playground/editing.html`)
61
+ - `agent-recipes/manifest.json`
62
+
63
+ ## Iteration 5 — Advanced Diagram and Editing Runtime
64
+
65
+ ### Current status
66
+
67
+ Iteration 5 local runtime scope is complete: normalized models, deterministic layouts, routing modes, node and member-derived group resizing, validation, capability discovery, shared history, group lifecycle operations, clipboard editing, pointer and keyboard port connections, typed edges, deterministic multi-obstacle orthogonal routing, recipes, and a viewable editor demo at `http://localhost:3000/playground/diagram-editor.html`. Cross-browser acceptance passed; physical-device behavior remains host integration evidence.
68
+
69
+ ### Goal
70
+
71
+ Turn Flow and Swimlane into a reusable diagram runtime with controlled editing, persistence, and collaboration-friendly patches.
72
+
73
+ ### Tasks
74
+
75
+ 1. Introduce a graph model with node, edge, lane, group, and port entities.
76
+ 2. Add orthogonal, straight, and curved edge routing modes.
77
+ 3. Add arrowhead, label, condition, and edge-status rendering.
78
+ 4. Add node drag, resize, alignment, snapping, and lane reassignment.
79
+ 5. Extend Iteration 4's command/history engine to advanced diagram operations; do not build a separate undo/redo stack.
80
+ 6. Add expand/collapse for groups and subprocesses.
81
+ 7. Add layout modes: layered, tree, radial, and manual.
82
+ 8. Add diagram validation for unreachable nodes, duplicate IDs, invalid ports, and cycles by policy.
83
+ 9. Add selection rectangle, multi-select, copy/paste, and keyboard shortcuts.
84
+ 10. Add diagram-specific SVG accessibility relationships.
85
+ 11. Add import/export of normalized DiagramSpec.
86
+ 12. Add recipes for workflow, approval process, Agent orchestration, and responsibility mapping.
87
+
88
+ ### Verification
89
+
90
+ - Same input graph produces stable layout output.
91
+ - Dragging and lane reassignment persist in normalized Spec.
92
+ - Undo/redo restores both geometry and relationships.
93
+ - Edge routing avoids node bodies in supported routing modes.
94
+ - Keyboard-only editing covers selection, movement, and deletion.
95
+ - Flow and Swimlane remain usable at mobile widths.
96
+
97
+ ### Deliverables
98
+
99
+ - Diagram Runtime package.
100
+ - `playground/diagram-editor.html`.
101
+ - Diagram API and editing guide.
102
+ - Flow/Swimlane recipe collection.
103
+
104
+ ## Iteration 6 — Project Intelligence and Business Views
105
+
106
+ ### Goal
107
+
108
+ Add higher-level project analytics that Agents can generate from task and delivery data. The phased plan and chart-type admission policy are defined in `docs/agent/development/iteration-6.md`.
109
+
110
+ ### Tasks
111
+
112
+ 1. Add critical-path and slack visualization controls to Gantt.
113
+ 2. Add baseline versus actual schedule comparison.
114
+ 3. Add dependency lag/lead and working-calendar support.
115
+ 4. Add resource load and capacity views.
116
+ 5. Add cumulative-flow diagram.
117
+ 6. Add velocity and release burndown views.
118
+ 7. Add risk matrix and issue aging views.
119
+ 8. Add milestone variance and forecast confidence indicators.
120
+ 9. Add filtering by owner, status, priority, sprint, and label.
121
+ 10. Add linked brushing between project views.
122
+ 11. Add natural-language intent recipes for schedule, risk, capacity, and release reporting.
123
+ 12. Add data quality warnings for incomplete dates, inconsistent status, and scope anomalies.
124
+
125
+ ### Verification
126
+
127
+ - Schedule calculations use explicit calendar and timezone rules.
128
+ - Baseline/actual variance is numerically reproducible.
129
+ - Forecasts expose assumptions and confidence limitations.
130
+ - Filters update all linked views consistently.
131
+ - Agent output includes warnings when source data is insufficient.
132
+ - All analytics have SVG and Canvas fallback behavior where applicable.
133
+
134
+ ### Deliverables
135
+
136
+ - Project Intelligence module.
137
+ - `playground/project-intelligence.html`.
138
+ - Project analytics recipes.
139
+ - Agent data-quality and assumption documentation.
140
+
141
+ ## Iteration 7 — Foundational Chart Coverage
142
+
143
+ ### Goal
144
+
145
+ Complete high-frequency foundational composition modes, then add Heatmap and Radar as fully supported public chart types. The phased implementation and admission policy are defined in `docs/agent/development/iteration-7.md`.
146
+
147
+ ### Tasks
148
+
149
+ 1. Add grouped, stacked, and percent-stacked modes to Bar, Column, and Area.
150
+ 2. Add Donut as `pie.innerRadius`, without creating a separate public type.
151
+ 3. Add mixed line/column multi-series composition and dual-axis rules.
152
+ 4. Add deterministic bin transforms for Histogram workflows.
153
+ 5. Add Heatmap with matrix encodings, color scales, missing-value semantics, and keyboard navigation.
154
+ 6. Add Radar with explicit indicator domains, multi-series comparison, and mixed-unit warnings.
155
+ 7. Complete SVG/Canvas parity, accessibility, responsive behavior, export, recipes, tests, and Gallery coverage.
156
+
157
+ ### Verification
158
+
159
+ - Composition modes preserve backward compatibility and stable source record references.
160
+ - Stack totals, percentage normalization, pie radii, and bin boundaries are deterministic.
161
+ - Heatmap distinguishes missing values from zero and supports semantic keyboard navigation.
162
+ - Radar requires explicit domains when inputs use mixed units.
163
+ - `npm run agent:check`, `git diff --check`, and browser acceptance pass.
164
+
165
+ ### Deliverables
166
+
167
+ - Reusable stack, mixed-mark, Donut, and bin-transform contracts.
168
+ - Public `heatmap` and `radar` chart types.
169
+ - `playground/foundational-gallery.html`.
170
+ - Updated capabilities, types, recipes, documentation, tests, and acceptance record.
171
+
172
+ ## Iteration 8 — Chart Completeness and Agent Experience
173
+
174
+ ### Goal
175
+
176
+ Finish the commonly expected behavior of the existing 16 chart types, improve machine-discoverable planning and diagnostics for Agents, and close the runtime, browser, packaging, performance, and 2.0 release gates. The phased plan is defined in `docs/agent/development/iteration-8.md`; the browser demo and acceptance-page architecture is defined in `docs/agent/development/playground-plan.md`.
177
+
178
+ ### Tasks
179
+
180
+ 1. Build and audit a per-chart feature matrix for common presentation, interaction, accessibility, responsive, state, export, and renderer behavior.
181
+ 2. Complete missing applicable behavior across existing charts without adding public chart types.
182
+ 3. Align interaction correctness, SVG/Canvas semantics, hit testing, keyboard behavior, lifecycle cleanup, and module loading.
183
+ 4. Expand capability discovery to per-chart data, option, interaction, renderer, limit, and export profiles.
184
+ 5. Add explainable Agent planning with alternatives, confidence, reasons, assumptions, warnings, unsupported requests, and safe next actions.
185
+ 6. Improve inspection, validation, repair diagnostics, chart descriptions, data lineage, recipes, and Agent self-check contracts.
186
+ 7. Complete cross-browser, mobile-device, accessibility, performance, package-consumer, documentation, and release acceptance.
187
+
188
+ ### Verification
189
+
190
+ - Every declared chart feature has automated or recorded browser evidence.
191
+ - An Agent can discover, plan, validate, render, explain, and self-check through public contracts alone.
192
+ - Capability manifests, runtime behavior, documentation, recipes, and TypeScript declarations agree.
193
+ - All 16 chart types pass full Gallery acceptance without uncaught errors.
194
+ - `npm run agent:check`, `git diff --check`, browser, mobile, lifecycle, and performance gates have explicit results.
195
+
196
+ ### Deliverables
197
+
198
+ - Chart-by-feature capability matrix and completed feature-gap fixes.
199
+ - Per-chart Agent capability and option metadata.
200
+ - Agent planning, diagnostics, explanation, recipes, and contract tests.
201
+ - Browser, mobile, accessibility, performance, lifecycle, packaging, and 2.0 release records.
202
+ - Updated full Gallery and exact preview acceptance instructions.
203
+
204
+ ## Iteration 9 — Visual Style System and Adaptive Theming
205
+
206
+ ### Goal
207
+
208
+ Give all existing chart families a consistent, accessible built-in visual language that Agents can select semantically and users can switch without chart recreation. The detailed 9A–9D plan is in `docs/agent/development/iteration-9.md`.
209
+
210
+ ### Tasks
211
+
212
+ 1. Define shared visual tokens, typography roles, layout density, mark styling, and semantic colors.
213
+ 2. Add automatic, light, dark, and contrast modes.
214
+ 3. Add analysis, dashboard, report, presentation, project, and diagram presets.
215
+ 4. Add categorical, sequential, diverging, and status palettes.
216
+ 5. Add deterministic Agent style planning, reasons, warnings, and capability discovery.
217
+ 6. Add live theme switching, host color-scheme following, and explicit override preservation.
218
+ 7. Apply resolved tokens across SVG, Canvas, charts, project views, diagrams, and tooltips.
219
+ 8. Add bilingual guidance, TypeScript declarations, regression tests, and Theme Gallery acceptance.
220
+
221
+ ### Verification
222
+
223
+ - Built-in modes satisfy declared contrast thresholds.
224
+ - Automatic choices are deterministic and visible in plan, state, and explanation output.
225
+ - User mode, preset, palette, and custom token overrides take precedence.
226
+ - Theme switching does not recreate a chart or lose explicit Spec overrides.
227
+ - `npm run agent:check`, `git diff --check`, and Theme Gallery acceptance pass.
228
+
229
+ ### Deliverables
230
+
231
+ - Lightweight style engine in `src/theme.mjs`.
232
+ - Public style-planning and runtime-switching APIs.
233
+ - English and Chinese theme guides.
234
+ - `playground/theme-gallery.html` and enhanced full Gallery controls.
235
+ - Iteration 9 remains within version `2.0.0` and adds no chart type.
236
+
237
+ ## Deferred Scope
238
+
239
+ The following remain deferred beyond this roadmap baseline:
240
+
241
+ - Geographic and map charts.
242
+ - 3D and perspective rendering.
243
+ - Fishbone / Ishikawa diagrams.
244
+ - Organization charts.
245
+ - Kanban boards.
246
+ - Full collaborative multi-user editing.
247
+
248
+ They should only be scheduled after the core runtime, diagram model, and project analytics contracts are stable.
249
+
250
+ ## Recommended Execution Order
251
+
252
+ 1. Finish Iteration 3 browser acceptance.
253
+ 2. Execute Iteration 4 before adding more chart types.
254
+ 3. Execute Iteration 5 if diagram editing is a primary product direction.
255
+ 4. Execute Iteration 6 if project analytics and Agent reporting are primary use cases.
256
+ 5. Execute Iteration 7 foundations before considering additional specialized chart types.
257
+ 6. Execute Iteration 8 to complete existing chart behavior, Agent adaptation, and the 2.0 release gates.
258
+ 7. Execute Iteration 9 to standardize adaptive visual styling without expanding chart count.
259
+ 8. Re-evaluate geographic and 3D scope only after usage data confirms demand.