@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.
- package/CHANGELOG.md +69 -0
- package/LICENSE +201 -0
- package/README.md +194 -0
- package/agent-recipes/diagrams/agent-orchestration.json +18 -0
- package/agent-recipes/diagrams/approval-process.json +16 -0
- package/agent-recipes/diagrams/responsibility-mapping.json +13 -0
- package/agent-recipes/diagrams/workflow.json +19 -0
- package/agent-recipes/foundational-analysis.json +18 -0
- package/agent-recipes/project-management.json +47 -0
- package/agent-recipes/trend-line.json +21 -0
- package/docs/agent/README.md +62 -0
- package/docs/agent/charting-scenario.md +82 -0
- package/docs/agent/coding-agent-integration.md +88 -0
- package/docs/agent/development/2.0-release-readiness.md +65 -0
- package/docs/agent/development/iteration-2.md +9 -0
- package/docs/agent/development/iteration-3.md +142 -0
- package/docs/agent/development/iteration-4.md +261 -0
- package/docs/agent/development/iteration-5.md +43 -0
- package/docs/agent/development/iteration-6.md +130 -0
- package/docs/agent/development/iteration-7.md +117 -0
- package/docs/agent/development/iteration-8-acceptance.md +68 -0
- package/docs/agent/development/iteration-8.md +116 -0
- package/docs/agent/development/iteration-9.md +44 -0
- package/docs/agent/development/playground-plan.md +143 -0
- package/docs/agent/development/prompt-contract.md +22 -0
- package/docs/agent/development/rc-1-acceptance.md +43 -0
- package/docs/agent/development/roadmap.md +259 -0
- package/docs/agent/development-guide.md +60 -0
- package/docs/agent/diagram-scenario.md +82 -0
- package/docs/agent/editing-contract.md +71 -0
- package/docs/agent/frontend-integration.md +66 -0
- package/docs/agent/project-scenario.md +89 -0
- package/docs/agent/quickstart.md +205 -0
- package/docs/agent/runtime-contract.md +132 -0
- package/docs/agent/theme-guide.md +59 -0
- package/docs/agent/zh-CN/README.md +26 -0
- package/docs/agent/zh-CN/charting-scenario.md +62 -0
- package/docs/agent/zh-CN/coding-agent-integration.md +36 -0
- package/docs/agent/zh-CN/development-guide.md +31 -0
- package/docs/agent/zh-CN/diagram-scenario.md +37 -0
- package/docs/agent/zh-CN/editing-contract.md +27 -0
- package/docs/agent/zh-CN/frontend-integration.md +31 -0
- package/docs/agent/zh-CN/project-scenario.md +40 -0
- package/docs/agent/zh-CN/quickstart.md +84 -0
- package/docs/agent/zh-CN/runtime-contract.md +85 -0
- package/docs/agent/zh-CN/theme-guide.md +50 -0
- package/docs/manifests/capabilities.json +79 -0
- package/docs/manifests/commands.json +30 -0
- package/docs/manifests/schemas.json +13 -0
- package/examples/agent-workflow.mjs +94 -0
- package/package.json +55 -0
- package/skills/ichartjs/SKILL.md +72 -0
- package/skills/ichartjs/agents/openai.yaml +4 -0
- package/skills/ichartjs/references/agent-contract.md +39 -0
- package/skills/ichartjs/references/chart-selection.md +22 -0
- package/src/capabilities.mjs +190 -0
- package/src/charts.mjs +234 -0
- package/src/command.mjs +93 -0
- package/src/data.mjs +75 -0
- package/src/diagram-interaction.mjs +195 -0
- package/src/diagram.mjs +135 -0
- package/src/edit-controller.mjs +192 -0
- package/src/edit.mjs +369 -0
- package/src/format.mjs +19 -0
- package/src/history.mjs +14 -0
- package/src/index.mjs +562 -0
- package/src/plugin.mjs +18 -0
- package/src/project-analytics.mjs +357 -0
- package/src/project-linking.mjs +72 -0
- package/src/project.mjs +370 -0
- package/src/recipes.mjs +18 -0
- package/src/renderer.mjs +77 -0
- package/src/scale.mjs +9 -0
- package/src/scene.mjs +18 -0
- package/src/schema.mjs +142 -0
- package/src/spec.mjs +127 -0
- package/src/theme.mjs +232 -0
- package/src/transforms.mjs +34 -0
- package/src/validation.mjs +106 -0
- package/types/index.d.ts +134 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# iChart.js 2.0 Agent Guide
|
|
2
|
+
|
|
3
|
+
This is the user-facing Agent entry point for iChart.js 2.0. Read this file first, then load one scenario guide as needed.
|
|
4
|
+
|
|
5
|
+
## Language
|
|
6
|
+
|
|
7
|
+
- English technical contract: current documents.
|
|
8
|
+
- Chinese companion guide: [`zh-CN/README.md`](zh-CN/README.md).
|
|
9
|
+
- APIs, fields, commands, error codes, and manifests use English identifiers. The English documents define the canonical technical contract; Chinese documents provide equivalent guidance.
|
|
10
|
+
|
|
11
|
+
## Start Here
|
|
12
|
+
|
|
13
|
+
- [Agent Quickstart](quickstart.md): install, import, plan, validate, render, explain, and self-check.
|
|
14
|
+
- [Coding Agent Integration](coding-agent-integration.md): use from Codex and similar code-editing Agents.
|
|
15
|
+
- [Frontend Integration](frontend-integration.md): use from ordinary JavaScript applications.
|
|
16
|
+
- [Visual Style and Themes](theme-guide.md): automatic matching, presets, palettes, switching, and contrast checks.
|
|
17
|
+
- [Data Charting](charting-scenario.md): generic data analysis charts.
|
|
18
|
+
- [Project Management](project-scenario.md): Gantt, Timeline, Milestone, and Burndown.
|
|
19
|
+
- [Interactive Diagrams](diagram-scenario.md): Flow, Swimlane, Groups, Ports, and editing.
|
|
20
|
+
- [Runtime Contract](runtime-contract.md): shared Spec, renderer, interaction, and export rules.
|
|
21
|
+
- [Editing Contract](editing-contract.md): schemas, commands, preview, commit, and undo/redo.
|
|
22
|
+
- Machine-readable capability manifests are in `docs/manifests/` and should be loaded on demand.
|
|
23
|
+
|
|
24
|
+
The 2.0 API is Spec-first. Import from `ichartjs`, inspect data, plan a chart, create a JSON-friendly Spec, validate it, render it, and self-check the explanation and runtime state.
|
|
25
|
+
|
|
26
|
+
## Recommended flow
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
const report = ichart.inspectData(data);
|
|
30
|
+
const recommendation = ichart.planChart(data, { intent: 'trend' });
|
|
31
|
+
const spec = {
|
|
32
|
+
type: recommendation.primary,
|
|
33
|
+
renderer: 'svg',
|
|
34
|
+
container: '#chart',
|
|
35
|
+
data: { values: data },
|
|
36
|
+
encoding: { x: { field: 'month' }, y: { field: 'sales' } }
|
|
37
|
+
};
|
|
38
|
+
const validation = ichart.validateSpec(spec);
|
|
39
|
+
if (!validation.valid) return validation.errors;
|
|
40
|
+
const chart = ichart.createChart(validation.spec);
|
|
41
|
+
chart.explain();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Use `getCapabilities()` to discover supported chart types, project-management views, diagrams, renderers, interactions, exports, and data operations. Use `chart.getSpec()`, `chart.getState()`, `chart.getSelectedData()`, and `chart.toDataTable()` to inspect a live chart.
|
|
45
|
+
|
|
46
|
+
For a visual overview of all supported chart types, open `playground/project-gallery.html`. For style-system acceptance, open `playground/theme-gallery.html`.
|
|
47
|
+
|
|
48
|
+
## Selection rules
|
|
49
|
+
|
|
50
|
+
- Use `line` or `area` for temporal trends.
|
|
51
|
+
- Use `bar` for category comparison or long labels.
|
|
52
|
+
- Use `column` for compact category comparison.
|
|
53
|
+
- Use `pie` only for a small part-to-whole view.
|
|
54
|
+
- Prefer `svg` when DOM interaction or accessibility is important.
|
|
55
|
+
- Prefer `canvas` when rendering many marks or targeting lower-power devices.
|
|
56
|
+
- Use `gantt`, `timeline`, `milestone`, or `burndown` for project delivery views.
|
|
57
|
+
- Use `flow` or `swimlane` for process, ownership, and responsibility views.
|
|
58
|
+
- Do not generate `map` or `3d` Specs unless `getCapabilities()` declares them.
|
|
59
|
+
|
|
60
|
+
## Error handling
|
|
61
|
+
|
|
62
|
+
Always call `validateSpec()` before rendering. Validation errors contain `code`, `path`, `message`, and `suggestion`.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Scenario: Data Charting
|
|
2
|
+
|
|
3
|
+
Agent usage and development guide for generic data analysis and metric visualization.
|
|
4
|
+
|
|
5
|
+
## Supported Types
|
|
6
|
+
|
|
7
|
+
| Type | Typical intent | Recommended renderer |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `line` | Trends and time changes | `svg` |
|
|
10
|
+
| `area` | Trends and cumulative volume | `svg` |
|
|
11
|
+
| `bar` | Category comparison and long labels | `svg` |
|
|
12
|
+
| `column` | Compact category comparison | `canvas` or `svg` |
|
|
13
|
+
| `pie` | Small part-to-whole views | `svg` |
|
|
14
|
+
| `scatter` | Relationship between two numeric variables | `canvas` |
|
|
15
|
+
| `funnel` | Conversion stages | `svg` |
|
|
16
|
+
| `gauge` | Single-metric completion | `canvas` |
|
|
17
|
+
| `heatmap` | Matrix intensity and calendar patterns | `canvas` or `svg` |
|
|
18
|
+
| `radar` | Multidimensional profile comparison | `svg` |
|
|
19
|
+
|
|
20
|
+
## Foundational Modes
|
|
21
|
+
|
|
22
|
+
- Use `stack: "stacked"` or `stack: "percent"` with Bar, Column, or Area rather than a separate stacked type.
|
|
23
|
+
- Use `type: "pie"` with `innerRadius` for Donut charts.
|
|
24
|
+
- Use per-series `mark: "column"` or `mark: "line"` and optional `axis: "right"` for Combo charts.
|
|
25
|
+
- Use `transform: { type: "bin", field, thresholds | step, extent }` for Histogram workflows.
|
|
26
|
+
- Heatmap treats missing values separately from numeric zero through `colorScale.missing`.
|
|
27
|
+
- Radar should declare `min` and `max` for every indicator; omitted or mixed-unit domains produce warnings.
|
|
28
|
+
|
|
29
|
+
## Agent Workflow
|
|
30
|
+
|
|
31
|
+
1. Call `inspectData(data)` to identify fields and missing values.
|
|
32
|
+
2. Select a chart type from the business intent; use `recommend(data, { intent })` for automated selection.
|
|
33
|
+
3. Create a JSON-serializable Chart Spec.
|
|
34
|
+
4. Call `validateSpec(spec)` before `createChart(spec)`.
|
|
35
|
+
5. Inspect the result with `chart.describe()` and `chart.getState()`.
|
|
36
|
+
|
|
37
|
+
## Minimal Spec
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
{
|
|
41
|
+
type: 'line',
|
|
42
|
+
renderer: 'svg',
|
|
43
|
+
container: '#chart',
|
|
44
|
+
data: { values: [{ month: 'Jan', sales: 120 }] },
|
|
45
|
+
encoding: {
|
|
46
|
+
x: { field: 'month', type: 'category' },
|
|
47
|
+
y: { field: 'sales', type: 'quantitative' }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Renderer Rules
|
|
53
|
+
|
|
54
|
+
- Use `svg` for DOM interaction, accessibility, element inspection, or fewer marks.
|
|
55
|
+
- Use `canvas` for many marks and rendering performance when individual DOM elements are unnecessary.
|
|
56
|
+
- Layout and data semantics must remain independent of the renderer.
|
|
57
|
+
|
|
58
|
+
## Implementation Map
|
|
59
|
+
|
|
60
|
+
- Spec and chart types: `src/spec.mjs`
|
|
61
|
+
- Data inspection and transforms: `src/data.mjs`
|
|
62
|
+
- Scene construction: `src/charts.mjs`
|
|
63
|
+
- Scales: `src/scale.mjs`
|
|
64
|
+
- Canvas/SVG renderers: `src/renderer.mjs`
|
|
65
|
+
- Tests: `tests/core.test.mjs`
|
|
66
|
+
- Full gallery: `playground/project-gallery.html`
|
|
67
|
+
- Iteration 7 gallery: `playground/foundational-gallery.html`
|
|
68
|
+
|
|
69
|
+
## Development Checklist
|
|
70
|
+
|
|
71
|
+
- Update `src/spec.mjs` and `src/charts.mjs`.
|
|
72
|
+
- Add data, Scene, and renderer-independence tests for the new type.
|
|
73
|
+
- Add the chart to `playground/project-gallery.html`.
|
|
74
|
+
- Update `docs/manifests/capabilities.json`.
|
|
75
|
+
- Update this guide's type table and limitations.
|
|
76
|
+
|
|
77
|
+
## Acceptance
|
|
78
|
+
|
|
79
|
+
- The Spec passes `validateSpec()`.
|
|
80
|
+
- The Gallery creates the chart with a `ready` status.
|
|
81
|
+
- Canvas and SVG expose the same Scene structure.
|
|
82
|
+
- Declared capabilities such as tooltip, selection, and zoom match actual behavior.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Coding Agent Integration
|
|
2
|
+
|
|
3
|
+
Use this guide with Codex, WorkBuddy, and similar Agents that can read a repository, edit JavaScript, execute tests, and open a local browser preview.
|
|
4
|
+
|
|
5
|
+
## Responsibility Boundary
|
|
6
|
+
|
|
7
|
+
iChart.js is a JavaScript UI component library. The coding Agent writes or updates the host application and calls the public `ichartjs` ESM API. The optional Skill provides workflow guidance only; it does not introduce a second runtime or service.
|
|
8
|
+
|
|
9
|
+
Do not add a CLI, MCP server, HTTP API, or Python adapter to complete an ordinary charting task.
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
Inside a consumer project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @taylorwong/ichartjs@^2
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Do not install the unscoped npm registry package named `ichartjs`; it is currently an npm security holding package. Use the GitHub source until the project publishes under a confirmed npm scope.
|
|
20
|
+
|
|
21
|
+
Inside this repository:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
npm run playground
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The same official Skill can be imported by Codex, WorkBuddy, and other Agent Skills-compatible hosts from `skills/ichartjs`. Install it into Codex from a repository checkout with:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
cp -R skills/ichartjs "${CODEX_HOME:-$HOME/.codex}/skills/"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Agent Request Pattern
|
|
35
|
+
|
|
36
|
+
A useful request is explicit about data, intent, output, and acceptance:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
Use iChart.js to inspect this dataset, choose and validate an appropriate chart,
|
|
40
|
+
add it to the current web page, run the focused tests, and return the exact preview URL.
|
|
41
|
+
Keep assumptions and data-quality warnings visible.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If the host supports named Skill invocation, the request may start with `Use $ichartjs`; otherwise select or name the `ichartjs` Skill through the host interface.
|
|
45
|
+
|
|
46
|
+
## Required Workflow
|
|
47
|
+
|
|
48
|
+
1. Inspect existing application structure and local instructions.
|
|
49
|
+
2. Import public APIs from `ichartjs`.
|
|
50
|
+
3. Call `getCapabilities()`, `inspectData()`, and `planChart()`.
|
|
51
|
+
4. Stop or ask for input when required fields are missing.
|
|
52
|
+
5. Build a JSON-friendly Spec and call `validateSpec()`.
|
|
53
|
+
6. Mount the chart through the application's normal component lifecycle.
|
|
54
|
+
7. Verify `chart.explain()`, `chart.getState()`, warnings, and record lineage.
|
|
55
|
+
8. Destroy replaced charts and event handlers.
|
|
56
|
+
9. Run focused tests, then broader checks.
|
|
57
|
+
10. Return the exact local preview URL and manual acceptance actions.
|
|
58
|
+
|
|
59
|
+
## Minimal Coding-Agent Example
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
import { createChart, inspectData, planChart, validateSpec } from '@taylorwong/ichartjs';
|
|
63
|
+
|
|
64
|
+
const inspection = inspectData(rows);
|
|
65
|
+
const plan = planChart(rows, { intent: 'comparison' });
|
|
66
|
+
const candidate = {
|
|
67
|
+
type: plan.primary,
|
|
68
|
+
data: { values: rows },
|
|
69
|
+
encoding: {
|
|
70
|
+
x: { field: plan.suggestedEncodings.dimension },
|
|
71
|
+
y: { field: plan.suggestedEncodings.measure }
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const validation = validateSpec(candidate);
|
|
75
|
+
if (!validation.valid) throw new Error(JSON.stringify(validation.errors));
|
|
76
|
+
const chart = createChart({ ...validation.spec, container: '#chart' });
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Use `examples/agent-workflow.mjs` for the full executable lifecycle.
|
|
80
|
+
|
|
81
|
+
## Acceptance
|
|
82
|
+
|
|
83
|
+
- The application imports only `ichartjs`, not source internals.
|
|
84
|
+
- The chosen chart exists in capabilities.
|
|
85
|
+
- Validation passes before rendering.
|
|
86
|
+
- Warnings and assumptions remain visible.
|
|
87
|
+
- Stable source IDs remain in explanation lineage.
|
|
88
|
+
- The user receives a working preview URL.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# iChart.js 2.0 Final Release Readiness
|
|
2
|
+
|
|
3
|
+
Date: 2026-09-16
|
|
4
|
+
|
|
5
|
+
## Decision
|
|
6
|
+
|
|
7
|
+
The repository runtime is accepted for the `2.0.0` GitHub source release. npm publication remains separately deferred.
|
|
8
|
+
|
|
9
|
+
iChart.js 2.0 is a new Agent-first product line. Compatibility with 1.x and a 1.x-to-2.0 migration guide are intentionally outside the release scope.
|
|
10
|
+
|
|
11
|
+
## Passed Gates
|
|
12
|
+
|
|
13
|
+
- `npm run agent:check`: passed.
|
|
14
|
+
- `npm run example:agent`: passed.
|
|
15
|
+
- `npm run rc:check`: passed.
|
|
16
|
+
- Core tests: 51 passed, 0 failed.
|
|
17
|
+
- Agent documentation check: 16 charts, 24 commands, and 7 schemas.
|
|
18
|
+
- Official iChart.js Skill validation: passed.
|
|
19
|
+
- GitHub Actions CI: Node.js 18, 20, and 22 run Agent checks, the executable workflow, and tarball verification.
|
|
20
|
+
- GitHub Actions run `35117247851` completed successfully for release-preparation commit `9df8f14`.
|
|
21
|
+
- Node.js 18.20.8, 20.20.2, and 22.22.2: Agent checks and the executable Agent workflow passed locally.
|
|
22
|
+
- Project governance: contribution and private vulnerability-reporting guidance are present.
|
|
23
|
+
- Markdown local-link audit: passed.
|
|
24
|
+
- Package tarball: 77 files, 129.2 kB packed and 467.7 kB unpacked, with an explicit allowlist and root license.
|
|
25
|
+
- External consumer installation: root ESM import, capability discovery, planning, chart creation, capability manifest, and recipes resolved successfully.
|
|
26
|
+
- TypeScript consumer compilation: passed in strict NodeNext mode against the packed tarball.
|
|
27
|
+
- Package boundary: undeclared subpaths such as `ichartjs/agent` are rejected.
|
|
28
|
+
- Chromium browser regression: Home, Full Gallery, Agent Workbench, Project Intelligence, Diagram Editor, Interaction Lab, Accessibility Lab, and Performance Lab rendered without visible runtime errors.
|
|
29
|
+
- Firefox 144 and WebKit 26 regression: 22/22 desktop and 390 x 844 touch-viewport scenarios passed without page errors or horizontal overflow.
|
|
30
|
+
- Native Safari 26.6.2 regression: 11/11 desktop and 390 x 844 scenarios passed without horizontal overflow.
|
|
31
|
+
- Performance regression: 5,000-row Line and Heatmap, 1,000-task Gantt, 300-node Diagram, SVG/Canvas, and 25-cycle lifecycle samples passed in Firefox and WebKit.
|
|
32
|
+
- Full Gallery: all 16 public chart types rendered across 6 Canvas and 10 SVG examples.
|
|
33
|
+
|
|
34
|
+
## Remaining Release Actions
|
|
35
|
+
|
|
36
|
+
1. **Final commit and tag.** Commit the consistent `2.0.0` package, runtime, Playground, documentation, and changelog versions, then create `v2.0.0` from that exact commit.
|
|
37
|
+
2. **Default branch cutover.** GitHub still uses `master`, which currently points to the archived 1.x project and its legacy development dependencies. Fast-forward `master` to the final 2.0 commit before creating the GitHub Release.
|
|
38
|
+
|
|
39
|
+
## Deferred npm Publication
|
|
40
|
+
|
|
41
|
+
The public npm name `ichartjs` currently resolves to an npm security holding package, and this machine has no authenticated publisher. Per the release decision, npm publication is deferred and does not block the GitHub source release.
|
|
42
|
+
|
|
43
|
+
## Finalization Order
|
|
44
|
+
|
|
45
|
+
1. Re-run all automated and package-consumer gates against `2.0.0`.
|
|
46
|
+
2. Commit the final version and fast-forward `master` to the same commit.
|
|
47
|
+
3. Create and push the `v2.0.0` tag, then create the GitHub Release from that exact commit.
|
|
48
|
+
4. Record physical-device and representative release-host evidence as post-release integration follow-up.
|
|
49
|
+
|
|
50
|
+
## Preview
|
|
51
|
+
|
|
52
|
+
Start the no-cache server from the repository root:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run playground
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Home: `http://localhost:3000/playground/index.html`
|
|
59
|
+
- Full Gallery: `http://localhost:3000/playground/project-gallery.html`
|
|
60
|
+
- Agent Workbench: `http://localhost:3000/playground/agent-workbench.html`
|
|
61
|
+
- Project Intelligence: `http://localhost:3000/playground/project-intelligence.html`
|
|
62
|
+
- Diagram Editor: `http://localhost:3000/playground/diagram-editor.html`
|
|
63
|
+
- Interaction Lab: `http://localhost:3000/playground/interaction-lab.html`
|
|
64
|
+
- Accessibility Lab: `http://localhost:3000/playground/accessibility-lab.html`
|
|
65
|
+
- Performance Lab: `http://localhost:3000/playground/performance-lab.html`
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Iteration 2 Capabilities
|
|
2
|
+
|
|
3
|
+
The beta runtime adds category, time, and log scale primitives; data transforms; selection and zoom state APIs; themes; accessibility metadata; plugins; responsive resize; and scatter, funnel, and gauge chart types.
|
|
4
|
+
|
|
5
|
+
Multi-series encodings may use `encoding.y` as an array. The second encoding is mapped to the right axis, for example `{ field: 'margin', axis: 'right' }`. Temporal x encodings use `type: 'temporal'` and generate adaptive year, month, or day labels.
|
|
6
|
+
|
|
7
|
+
Use `getCapabilities()` before generating a Spec. Use `inspectData()` before choosing fields. Use `chart.describe()` and `chart.getState()` after rendering to verify the result.
|
|
8
|
+
|
|
9
|
+
The browser validation page is `playground/iteration-2.html`. It must be served over HTTP because it imports the ESM runtime.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Iteration 3 — Project and Business Visualization
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Extend iChart.js 2.0 from a statistical chart runtime into an Agent-first visualization runtime that can represent project plans, delivery progress, milestones, and business processes.
|
|
6
|
+
|
|
7
|
+
This iteration explicitly **does not include geographic charts or 3D rendering**. The architecture may be upgraded when needed; compatibility with the legacy 1.x implementation is not a constraint.
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
|
|
11
|
+
### P0 — Project management charts
|
|
12
|
+
|
|
13
|
+
1. **Gantt chart (`gantt`)**
|
|
14
|
+
- Tasks with `id`, `name`, `start`, `end`, `duration`, `progress`, and `status`.
|
|
15
|
+
- Task dependencies and dependency validation.
|
|
16
|
+
- Milestone tasks with zero duration.
|
|
17
|
+
- Today marker, working-area layout, task labels, and status styling.
|
|
18
|
+
- Time-axis zoom, horizontal pan, task selection, and tooltip details.
|
|
19
|
+
- SVG and Canvas rendering where the interaction model is shared.
|
|
20
|
+
|
|
21
|
+
2. **Timeline / milestone chart (`timeline`, `milestone`)**
|
|
22
|
+
- Chronological events with dates, titles, descriptions, categories, and status.
|
|
23
|
+
- Milestone emphasis, event grouping, and compact/mobile layouts.
|
|
24
|
+
- Click, hover, keyboard navigation, and accessible event descriptions.
|
|
25
|
+
- ISO-8601 dates are validated before rendering.
|
|
26
|
+
|
|
27
|
+
3. **Burndown chart (`burndown`)**
|
|
28
|
+
- Ideal line, actual remaining work, completed work, and scope-change markers.
|
|
29
|
+
- Sprint or release date range.
|
|
30
|
+
- Support for story points, task count, or another quantitative measure.
|
|
31
|
+
- Highlight overdue work and projected completion when data is sufficient.
|
|
32
|
+
- Scope-change rows may provide `scopeChange`; the runtime renders change markers and keeps actual remaining work separate.
|
|
33
|
+
|
|
34
|
+
### P1 — Process visualization
|
|
35
|
+
|
|
36
|
+
4. **Flow chart (`flow`)**
|
|
37
|
+
- Nodes, directed edges, labels, node kinds, and status.
|
|
38
|
+
- Automatic layout with deterministic output for the same Spec.
|
|
39
|
+
- Node/edge hit testing, selection, focus navigation, and viewport pan/zoom.
|
|
40
|
+
- SVG-first output for semantic DOM interaction, with Canvas fallback for large graphs.
|
|
41
|
+
- Nodes may be dragged when `interaction.drag` is enabled; `drag` and `dragend` events expose the active node.
|
|
42
|
+
|
|
43
|
+
5. **Swimlane chart (`swimlane`)**
|
|
44
|
+
- Lanes representing people, teams, systems, or Agents.
|
|
45
|
+
- Flow nodes positioned within lanes and cross-lane transitions.
|
|
46
|
+
- Lane labels, grouping, selection, and accessible relationships.
|
|
47
|
+
|
|
48
|
+
### P2 — Deferred extensions
|
|
49
|
+
|
|
50
|
+
The following remain outside the Iteration 3 delivery target:
|
|
51
|
+
|
|
52
|
+
- Geographic and map charts.
|
|
53
|
+
- 3D and perspective chart variants.
|
|
54
|
+
- Fishbone / Ishikawa diagrams.
|
|
55
|
+
- Organization charts.
|
|
56
|
+
- Dependency networks and resource-load views.
|
|
57
|
+
- Kanban boards.
|
|
58
|
+
|
|
59
|
+
These can be evaluated after the Diagram Runtime and editing model have stabilized.
|
|
60
|
+
|
|
61
|
+
## Technical work items
|
|
62
|
+
|
|
63
|
+
1. Define a common `ProjectSpec` and `DiagramSpec` contract.
|
|
64
|
+
2. Add `gantt`, `timeline`, `milestone`, `burndown`, `flow`, and `swimlane` to capability discovery.
|
|
65
|
+
3. Add validation schemas and actionable validation suggestions for each type.
|
|
66
|
+
4. Add temporal interval, dependency, node, edge, and lane data models.
|
|
67
|
+
5. Add reusable project timeline layout primitives.
|
|
68
|
+
6. Add reusable graph layout and routing primitives.
|
|
69
|
+
7. Render project and diagram scene graphs through the existing renderer abstraction.
|
|
70
|
+
8. Add shared interaction state for selection, focus, pan, zoom, and tooltip.
|
|
71
|
+
9. Add plugin hooks for annotations, labels, data zoom, and accessibility.
|
|
72
|
+
10. Add Agent recommendations based on intents such as `schedule`, `progress`, `milestone`, `workflow`, and `responsibility`.
|
|
73
|
+
11. Add JSON Recipes for every Iteration 3 chart type.
|
|
74
|
+
12. Add a dedicated project-management and process gallery.
|
|
75
|
+
13. Add mobile interaction coverage and responsive layout rules.
|
|
76
|
+
14. Add export and serialization checks for SVG, PNG, and normalized Spec output.
|
|
77
|
+
15. Preserve Flow node positions after drag by writing them to `node.position`.
|
|
78
|
+
|
|
79
|
+
## Agent API expectations
|
|
80
|
+
|
|
81
|
+
Capability discovery should expose separate groups:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"charts": ["line", "area", "bar", "column", "pie", "donut", "scatter", "bubble", "heatmap", "funnel", "gauge", "waterfall"],
|
|
86
|
+
"projectManagement": ["gantt", "timeline", "milestone", "burndown"],
|
|
87
|
+
"diagrams": ["flow", "swimlane"],
|
|
88
|
+
"excluded": ["map", "3d"]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The Agent guide must include one minimal Spec and one data-shape example for each supported type. The Agent should be able to discover the appropriate type without relying on legacy class names such as `Column2D` or `Column3D`.
|
|
93
|
+
|
|
94
|
+
## Demo deliverables
|
|
95
|
+
|
|
96
|
+
The following viewable demos are required before Iteration 3 is considered complete:
|
|
97
|
+
|
|
98
|
+
- `playground/project-gallery.html` with Gantt, timeline, milestone, burndown, flow, and swimlane examples.
|
|
99
|
+
- At least one SVG and one Canvas scenario where each renderer is appropriate.
|
|
100
|
+
- A responsive/mobile scenario showing timeline or Gantt pan and zoom.
|
|
101
|
+
- A workflow scenario showing lane ownership and cross-lane transitions.
|
|
102
|
+
- Inline links to the corresponding Agent Recipes and normalized Specs.
|
|
103
|
+
|
|
104
|
+
When a demo is available for acceptance, report the exact HTTP URL and the command used to serve it. These demos must not depend on opening ESM files directly through `file://`.
|
|
105
|
+
|
|
106
|
+
## Verification criteria
|
|
107
|
+
|
|
108
|
+
### Functional
|
|
109
|
+
|
|
110
|
+
- Each P0 and P1 type validates, normalizes, renders, and exposes `describe()` and `getState()`.
|
|
111
|
+
- Invalid dates, intervals, dependencies, node references, and lane references produce structured validation errors.
|
|
112
|
+
- Gantt dependencies render in the correct direction and report missing or cyclic dependencies.
|
|
113
|
+
- Burndown calculations remain correct when scope changes are present.
|
|
114
|
+
- Flow and swimlane layouts are deterministic and do not lose nodes or edges.
|
|
115
|
+
|
|
116
|
+
### Interaction
|
|
117
|
+
|
|
118
|
+
- Hover, click, selection, keyboard focus, tooltip, pan, and zoom work consistently across supported types.
|
|
119
|
+
- Project tooltips show task dates/progress, milestone dates, and burndown remaining/scope changes.
|
|
120
|
+
- Dependency arrows use arrowheads; entries on `criticalPath` use emphasized styling.
|
|
121
|
+
- Touch drag and pinch zoom work on timeline-based charts.
|
|
122
|
+
- Single-finger touch drag moves Flow nodes when `interaction.drag` is enabled; two-finger touch remains reserved for pinch zoom.
|
|
123
|
+
- Keyboard users can traverse tasks, milestones, nodes, and lanes with visible focus state.
|
|
124
|
+
|
|
125
|
+
### Rendering and accessibility
|
|
126
|
+
|
|
127
|
+
- SVG output exposes meaningful labels and relationships where possible.
|
|
128
|
+
- Canvas output retains equivalent hit testing and accessible chart metadata.
|
|
129
|
+
- Responsive layouts remain usable at desktop and mobile widths.
|
|
130
|
+
- SVG, PNG, and normalized JSON exports are available or explicitly reported unsupported per chart type.
|
|
131
|
+
|
|
132
|
+
### Quality gate
|
|
133
|
+
|
|
134
|
+
- `npm test` passes.
|
|
135
|
+
- `npm run check` passes.
|
|
136
|
+
- `git diff --check` passes.
|
|
137
|
+
- Browser acceptance covers every Iteration 3 demo panel through an HTTP-served page.
|
|
138
|
+
- Agent Recipes parse successfully and match capability discovery.
|
|
139
|
+
|
|
140
|
+
## Completion definition
|
|
141
|
+
|
|
142
|
+
Iteration 3 is complete when all P0 and P1 types are implemented, tested, documented, discoverable by an Agent, and demonstrated in `playground/project-gallery.html`. P2 items are not blockers for the iteration.
|