aw-spec-cli 0.1.4 → 0.1.6
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/assets/.agents/agent.json +28 -0
- package/assets/.agents/skills/appweaver/SKILL.md +56 -0
- package/assets/.agents/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.claude/agent.json +27 -0
- package/assets/.claude/skills/appweaver/SKILL.md +55 -0
- package/assets/.claude/skills/appweaver-demo/SKILL.md +59 -0
- package/assets/.kilocode/agent.json +28 -0
- package/assets/.kilocode/workflows/appweaver-demo.md +59 -0
- package/assets/.kilocode/workflows/appweaver.md +55 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -54
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/assets/.agents/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.agents/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.agents/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.agents/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.agents/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.agents/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.agents/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.agents/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.agents/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.agents/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.agents/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.agents/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.agents/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.agents/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.agents/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -34
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -23
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -17
- package/assets/.aw-spec/integrations/claude.manifest.json +0 -17
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/scripts/bash/check-prerequisites.sh +0 -189
- package/assets/.aw-spec/scripts/bash/common.sh +0 -582
- package/assets/.aw-spec/scripts/bash/create-new-feature.sh +0 -299
- package/assets/.aw-spec/scripts/bash/setup-plan.sh +0 -84
- package/assets/.aw-spec/scripts/bash/setup-tasks.sh +0 -91
- package/assets/.aw-spec/templates/checklist-template.md +0 -40
- package/assets/.aw-spec/templates/constitution-template.md +0 -57
- package/assets/.aw-spec/templates/plan-template.md +0 -113
- package/assets/.aw-spec/templates/spec-template.md +0 -131
- package/assets/.aw-spec/templates/tasks-template.md +0 -252
- package/assets/.aw-spec/workflows/aw-spec/workflow.yml +0 -77
- package/assets/.aw-spec/workflows/workflow-registry.json +0 -13
- package/assets/.claude/skills/aw-spec-addcomponent/SKILL.md +0 -129
- package/assets/.claude/skills/aw-spec-agent-context-update/SKILL.md +0 -31
- package/assets/.claude/skills/aw-spec-analyze/SKILL.md +0 -296
- package/assets/.claude/skills/aw-spec-checklist/SKILL.md +0 -374
- package/assets/.claude/skills/aw-spec-clarify/SKILL.md +0 -320
- package/assets/.claude/skills/aw-spec-constitution/SKILL.md +0 -194
- package/assets/.claude/skills/aw-spec-fast-implement/SKILL.md +0 -268
- package/assets/.claude/skills/aw-spec-foundation/SKILL.md +0 -358
- package/assets/.claude/skills/aw-spec-implement/SKILL.md +0 -279
- package/assets/.claude/skills/aw-spec-minimal-implementation/SKILL.md +0 -209
- package/assets/.claude/skills/aw-spec-plan/SKILL.md +0 -221
- package/assets/.claude/skills/aw-spec-select-domain/SKILL.md +0 -73
- package/assets/.claude/skills/aw-spec-specify/SKILL.md +0 -382
- package/assets/.claude/skills/aw-spec-tasks/SKILL.md +0 -259
- package/assets/.claude/skills/aw-spec-taskstoissues/SKILL.md +0 -107
- package/assets/.kilocode/rules/specify-rules.md +0 -4
- package/assets/.kilocode/workflows/aw-spec-addcomponent.md +0 -129
- package/assets/.kilocode/workflows/aw-spec-agent-context.update.md +0 -31
- package/assets/.kilocode/workflows/aw-spec-analyze.md +0 -296
- package/assets/.kilocode/workflows/aw-spec-checklist.md +0 -374
- package/assets/.kilocode/workflows/aw-spec-clarify.md +0 -320
- package/assets/.kilocode/workflows/aw-spec-constitution.md +0 -194
- package/assets/.kilocode/workflows/aw-spec-fast-implement.md +0 -263
- package/assets/.kilocode/workflows/aw-spec-foundation.md +0 -358
- package/assets/.kilocode/workflows/aw-spec-implement.md +0 -279
- package/assets/.kilocode/workflows/aw-spec-minimal-implementation.md +0 -204
- package/assets/.kilocode/workflows/aw-spec-plan.md +0 -221
- package/assets/.kilocode/workflows/aw-spec-select-domain.md +0 -73
- package/assets/.kilocode/workflows/aw-spec-specify.md +0 -382
- package/assets/.kilocode/workflows/aw-spec-tasks.md +0 -259
- package/assets/.kilocode/workflows/aw-spec-taskstoissues.md +0 -107
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/UI.Visualization/PACKAGING.md +0 -191
- package/assets/docs/UI.Visualization/UI.Visualization.Reference.pack.txt +0 -11768
- package/assets/docs/UI.Visualization/UI.Visualization.pack.txt +0 -11214
- package/assets/docs/UI.Visualization/pack-foundation.ps1 +0 -165
- package/assets/docs/UI.Visualization/pack-foundation.sh +0 -206
- package/assets/docs/UI.Visualization/pack-reference-foundation.ps1 +0 -159
- package/assets/docs/UI.Visualization/pack-reference-foundation.sh +0 -205
- package/assets/docs/UI.Visualization/unpack-foundation.ps1 +0 -126
- package/assets/docs/UI.Visualization/unpack-foundation.sh +0 -217
- package/assets/docs/UI.Visualization/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/UI.Visualization/unpack-reference-foundation.sh +0 -218
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/command.txt +0 -295
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/UIVisualization/chart-bubble.md +0 -70
- package/assets/docs/domainspecs/UIVisualization/chart-dimred.md +0 -58
- package/assets/docs/domainspecs/UIVisualization/chart-heatmap.md +0 -62
- package/assets/docs/domainspecs/UIVisualization/chart-network.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-parallel.md +0 -75
- package/assets/docs/domainspecs/UIVisualization/chart-scurve.md +0 -66
- package/assets/docs/domainspecs/UIVisualization/chart-survival.md +0 -69
- package/assets/docs/domainspecs/UIVisualization/chart-trellis.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/chart-violin.md +0 -61
- package/assets/docs/domainspecs/UIVisualization/chart-volcano.md +0 -63
- package/assets/docs/domainspecs/UIVisualization/charting-standards.domain.md +0 -80
- package/assets/docs/domainspecs/UIVisualization/clean-architecture.domain.md +0 -87
- package/assets/docs/domainspecs/UIVisualization/coding-standards.domain.md +0 -47
- package/assets/docs/domainspecs/UIVisualization/comandrulemap.md +0 -130
- package/assets/docs/domainspecs/UIVisualization/component-contracts.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/data-source.domain.md +0 -68
- package/assets/docs/domainspecs/UIVisualization/domain-requirements.md +0 -110
- package/assets/docs/domainspecs/UIVisualization/folder-structure.domain.md +0 -55
- package/assets/docs/domainspecs/UIVisualization/state-management.domain.md +0 -67
- package/assets/docs/domainspecs/UIVisualization/testing.domain.md +0 -52
- package/assets/docs/domainspecs/UIVisualization/ui-viz-terms.md +0 -39
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -29
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -166
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -26
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -186
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/security/auditing.md +0 -117
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Charting Standards — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> The base Plotly wrapper, theme, and rendering rules every chart depends on. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
5
|
-
|
|
6
|
-
## Single base wrapper
|
|
7
|
-
|
|
8
|
-
- **All** charts render through one component: `components/charts/PlotlyChart.tsx`. No chart imports
|
|
9
|
-
`plotly.js` directly.
|
|
10
|
-
- Plotly is loaded via **dynamic import inside `useEffect`** (SSR-safe — Plotly touches `window`).
|
|
11
|
-
Never import it at module top level; never render it in a Server Component.
|
|
12
|
-
- The wrapper exposes a shared `BASE_LAYOUT`, `BASE_CONFIG`, and `PHARMA_COLORS` palette that every
|
|
13
|
-
generic chart spreads over its own layout.
|
|
14
|
-
- **Responsive fill:** when a chart is given no explicit `height`, it passes `fillHeight` and the
|
|
15
|
-
wrapper sizes to the parent (`height: 100%`); when given a number, that wins. Charts therefore
|
|
16
|
-
fill a flex card without manual measuring.
|
|
17
|
-
|
|
18
|
-
## Canonical base wrapper (agent reference)
|
|
19
|
-
|
|
20
|
-
```tsx
|
|
21
|
-
// components/charts/PlotlyChart.tsx
|
|
22
|
-
'use client'
|
|
23
|
-
import { useEffect, useRef } from 'react'
|
|
24
|
-
|
|
25
|
-
export const PHARMA_COLORS = ['#00d4b4','#3b82f6','#8b5cf6','#f59e0b','#ef4444','#10b981','#f97316','#ec4899']
|
|
26
|
-
export const BASE_LAYOUT = {
|
|
27
|
-
paper_bgcolor: '#0a1628', plot_bgcolor: '#0a1628',
|
|
28
|
-
font: { color: '#8ba3c7', family: 'Inter, system-ui, sans-serif', size: 11 },
|
|
29
|
-
margin: { t: 30, r: 20, b: 50, l: 60 },
|
|
30
|
-
xaxis: { gridcolor: 'rgba(59,130,246,0.10)', zerolinecolor: 'rgba(59,130,246,0.10)' },
|
|
31
|
-
yaxis: { gridcolor: 'rgba(59,130,246,0.10)', zerolinecolor: 'rgba(59,130,246,0.10)' },
|
|
32
|
-
hoverlabel: { bgcolor: '#0f1e38', bordercolor: 'rgba(0,212,180,0.3)', font: { color: '#e2ecff' } },
|
|
33
|
-
}
|
|
34
|
-
export const BASE_CONFIG = { displayModeBar: true, displaylogo: false, responsive: true }
|
|
35
|
-
|
|
36
|
-
interface Props { data: unknown[]; layout?: Record<string, unknown>; config?: Record<string, unknown>; className?: string; fillHeight?: boolean }
|
|
37
|
-
|
|
38
|
-
export default function PlotlyChart({ data, layout = {}, config = {}, className, fillHeight = false }: Props) {
|
|
39
|
-
const ref = useRef<HTMLDivElement>(null)
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (!ref.current) return
|
|
42
|
-
const el = ref.current; let cancelled = false
|
|
43
|
-
import('plotly.js-dist-min').then(Plotly => {
|
|
44
|
-
if (cancelled || !el) return
|
|
45
|
-
Plotly.react(el, data, { ...BASE_LAYOUT, ...layout }, { ...BASE_CONFIG, ...config })
|
|
46
|
-
})
|
|
47
|
-
return () => { cancelled = true; import('plotly.js-dist-min').then(P => { try { P.purge(el) } catch {} }) }
|
|
48
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
-
}, [JSON.stringify(data), JSON.stringify(layout)])
|
|
50
|
-
return <div ref={ref} className={className} style={{ width: '100%', height: fillHeight ? '100%' : undefined }} />
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Generic-chart contract (every chart in `generic/`)
|
|
55
|
-
|
|
56
|
-
1. `'use client'` at the top; renders only via `PlotlyChart`.
|
|
57
|
-
2. Accepts an **optional `height?: number`**; spreads `height` into layout only when defined,
|
|
58
|
-
else passes `fillHeight={height === undefined}` and adds `h-full` to the className.
|
|
59
|
-
3. Builds `data` + `layout` from props, spreading `BASE_LAYOUT`.
|
|
60
|
-
4. **No domain vocabulary** — all labels/units/colours come from props
|
|
61
|
-
(see [[component-contracts.domain]]).
|
|
62
|
-
5. Colours default from `PHARMA_COLORS` (rename palette per project; keep the export name stable).
|
|
63
|
-
|
|
64
|
-
## Theme tokens
|
|
65
|
-
|
|
66
|
-
- Dark "glass" theme: `bg-mesh` background, `glass-card` + `gradient-border` chart cards,
|
|
67
|
-
accent teal `#00d4b4` / purple `#7c3aed`. Tokens live in `globals.css` and `tailwind.config.ts`.
|
|
68
|
-
- Chart text/grid colours come from `BASE_LAYOUT` so every chart matches the shell automatically.
|
|
69
|
-
|
|
70
|
-
## Rules
|
|
71
|
-
|
|
72
|
-
- Purge the Plotly instance on unmount (the wrapper does this) to avoid leaks on route change.
|
|
73
|
-
- Re-render keys off `JSON.stringify(data/layout)` — keep prop objects stable or memoised for
|
|
74
|
-
large datasets.
|
|
75
|
-
- Never set a fixed pixel height in a page card; let `fillHeight` size to the flex parent.
|
|
76
|
-
|
|
77
|
-
## Related
|
|
78
|
-
- [[component-contracts.domain]] — the per-chart prop contract built on this base
|
|
79
|
-
- [[clean-architecture.domain]] — the generic ring depends only on this wrapper
|
|
80
|
-
- All `chart-*` rule files build on this base.
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Clean Architecture — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> Front-end layering for the visualization app. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
5
|
-
|
|
6
|
-
## Dependency direction
|
|
7
|
-
|
|
8
|
-
Dependencies flow **inward only**, toward the generic chart library:
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
Page (app/*/page.tsx)
|
|
12
|
-
│ composes
|
|
13
|
-
▼
|
|
14
|
-
Adapter (components/charts/<Domain>Chart.tsx) ── maps domain data → generic props
|
|
15
|
-
│ depends on
|
|
16
|
-
▼
|
|
17
|
-
Generic Chart (components/charts/generic/*) ← innermost ring; depends on nothing domain-specific
|
|
18
|
-
▲
|
|
19
|
-
│ provides data (never imports a chart)
|
|
20
|
-
Data Layer (lib/*, store/*)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
The **generic chart library** is the innermost ring — every layer may depend on it; it depends on
|
|
24
|
-
nothing but `PlotlyChart` + the shared palette/theme.
|
|
25
|
-
|
|
26
|
-
## Layer responsibilities
|
|
27
|
-
|
|
28
|
-
- **Page** (`app/*/page.tsx`) — route surface. Reads data from the store, lays out the chart card,
|
|
29
|
-
passes props to an adapter (or directly to a generic chart). MUST NOT contain Plotly trace
|
|
30
|
-
construction.
|
|
31
|
-
- **Adapter** (`components/charts/<Domain>Chart.tsx`) — translates a **project/domain type**
|
|
32
|
-
(e.g. `Compound[]`, `TrialArm[]`) into a generic chart's props. The **only** place domain
|
|
33
|
-
vocabulary meets a chart (see [[component-contracts.domain]]).
|
|
34
|
-
- **Generic chart** (`components/charts/generic/*`) — builds Plotly traces/layout from
|
|
35
|
-
**caller-supplied data, labels, colours**. Domain-agnostic and reusable across projects.
|
|
36
|
-
- **Data layer** (`lib/*`, `store/*`) — types, parsing, formatting, state. Feeds data **into**
|
|
37
|
-
pages; MUST NOT import chart components.
|
|
38
|
-
|
|
39
|
-
## Forbidden patterns
|
|
40
|
-
|
|
41
|
-
- Domain logic, project types, or hard-coded domain labels inside `components/charts/generic/`.
|
|
42
|
-
- A page constructing Plotly `data`/`layout` arrays directly (that belongs in a chart/adapter).
|
|
43
|
-
- A generic chart importing from `lib/sample-data`, the store, or any `app/*` route.
|
|
44
|
-
- The data layer importing a chart component (inversion of the dependency rule).
|
|
45
|
-
|
|
46
|
-
## Canonical example (agent reference)
|
|
47
|
-
|
|
48
|
-
The adapter is the dependency seam — the **page** depends on the **adapter**, the **adapter**
|
|
49
|
-
depends on the **generic chart**; the generic chart knows nothing about the domain:
|
|
50
|
-
|
|
51
|
-
```tsx
|
|
52
|
-
// Page — app/compounds/page.tsx (composition only)
|
|
53
|
-
'use client'
|
|
54
|
-
import CompoundScatterPlot from '@/components/charts/CompoundScatterPlot'
|
|
55
|
-
import { useDataStore } from '@/store/data-store'
|
|
56
|
-
|
|
57
|
-
export default function CompoundsPage() {
|
|
58
|
-
const { compounds } = useDataStore()
|
|
59
|
-
return <CompoundScatterPlot compounds={compounds} />
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Adapter — components/charts/CompoundScatterPlot.tsx (domain → generic props)
|
|
63
|
-
'use client'
|
|
64
|
-
import { BubbleChart } from '@/components/charts/generic'
|
|
65
|
-
import type { Compound } from '@/lib/types/pharma'
|
|
66
|
-
|
|
67
|
-
export default function CompoundScatterPlot({ compounds }: { compounds: Compound[] }) {
|
|
68
|
-
const targets = [...new Set(compounds.map(c => c.target))]
|
|
69
|
-
return (
|
|
70
|
-
<BubbleChart
|
|
71
|
-
series={targets.map(t => ({
|
|
72
|
-
seriesLabel: t,
|
|
73
|
-
points: compounds.filter(c => c.target === t).map(c => ({
|
|
74
|
-
x: c.molecularWeight, y: Math.log10(c.ic50_nM),
|
|
75
|
-
size: c.selectivityRatio, label: c.name,
|
|
76
|
-
})),
|
|
77
|
-
}))}
|
|
78
|
-
xLabel="Molecular Weight (Da)" yLabel="log₁₀(IC₅₀, nM)" sizeLabel="Selectivity"
|
|
79
|
-
/>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Related
|
|
85
|
-
- [[component-contracts.domain]] — adapter prop contract
|
|
86
|
-
- [[charting-standards.domain]] — the `PlotlyChart` base + theme the generic ring depends on
|
|
87
|
-
- [[folder-structure.domain]] · [[state-management.domain]]
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Coding Standards — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> TypeScript / React / Next.js conventions for the viz front-end. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`, `/aw-spec-analyze`.
|
|
5
|
-
|
|
6
|
-
## TypeScript
|
|
7
|
-
|
|
8
|
-
- `strict: true`. No implicit `any`; for Plotly's loose trace objects use a single
|
|
9
|
-
`as never[]` / `Record<string, unknown>` at the wrapper boundary, never sprinkled through code.
|
|
10
|
-
- Data contracts are `interface`s in `lib/types/`; chart prop types are exported from each
|
|
11
|
-
generic chart and re-exported from `generic/index.ts`.
|
|
12
|
-
- Prefer `type` unions for closed sets (`'sample' | 'excel' | 'api'`).
|
|
13
|
-
|
|
14
|
-
## React / Next.js
|
|
15
|
-
|
|
16
|
-
- Any component using hooks, Plotly, the store, or browser APIs is a **Client Component**
|
|
17
|
-
(`'use client'`). Pages that only compose may still be client when they read the store.
|
|
18
|
-
- Charts and Plotly are **never** in Server Components (SSR-unsafe — see [[charting-standards.domain]]).
|
|
19
|
-
- Keep render pure: no `set`/fetch in render bodies; mutations go through store actions
|
|
20
|
-
(see [[state-management.domain]]).
|
|
21
|
-
- Memoise large derived datasets (`useMemo`) before passing to a chart so the wrapper's
|
|
22
|
-
`JSON.stringify` diff stays cheap.
|
|
23
|
-
|
|
24
|
-
## Naming & layout
|
|
25
|
-
|
|
26
|
-
- Generic charts: PascalCase noun (`Heatmap`, `BubbleChart`). Adapters: domain concept
|
|
27
|
-
(`CompoundScatterPlot`). Routes: kebab-case folder (`dose-response/`).
|
|
28
|
-
- One component per file; co-locate a route's page in `app/<route>/page.tsx`.
|
|
29
|
-
- Import charts from the barrel: `import { Heatmap } from '@/components/charts/generic'`.
|
|
30
|
-
|
|
31
|
-
## Styling
|
|
32
|
-
|
|
33
|
-
- Tailwind utility classes + the shared `cn()` helper (`clsx`). Theme tokens (glass, gradient,
|
|
34
|
-
accent) come from `globals.css` / `tailwind.config.ts` — don't inline ad-hoc colours that
|
|
35
|
-
fight the chart theme.
|
|
36
|
-
- Chart text/grid colour comes from `BASE_LAYOUT`, not per-page overrides.
|
|
37
|
-
|
|
38
|
-
## Forbidden patterns
|
|
39
|
-
|
|
40
|
-
- `plotly.js` imported anywhere except inside `PlotlyChart`'s `useEffect`.
|
|
41
|
-
- Domain strings/types inside `components/charts/generic/`.
|
|
42
|
-
- A component calling Zustand `set` directly (use a named action).
|
|
43
|
-
- Fixed pixel chart heights in page cards (use `fillHeight`).
|
|
44
|
-
|
|
45
|
-
## Related
|
|
46
|
-
- [[charting-standards.domain]] · [[component-contracts.domain]] · [[state-management.domain]] ·
|
|
47
|
-
[[testing.domain]]
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# UI Visualization Domain — Command → Rule-File Map
|
|
2
|
-
|
|
3
|
-
Per-AW-Spec-command list of the **UIVisualization domain** rule files in this folder.
|
|
4
|
-
Technology standards already auto-load inside each command; the files below are the
|
|
5
|
-
domain-specific ones to load **in addition** for a data-visualization front-end project.
|
|
6
|
-
|
|
7
|
-
- All paths are workspace-relative and live in this folder: `docs/domainspecs/UIVisualization/`.
|
|
8
|
-
- A skill reads this file and loads every path under the matching command heading.
|
|
9
|
-
- `/aw-spec-select-domain UIVisualization` selects this folder as active.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## ⚠️ Chart-selection rule (applies to every command below)
|
|
14
|
-
|
|
15
|
-
The `chart-*.md` files are **conditional**. Load the **core** rule files unconditionally; load a
|
|
16
|
-
`chart-<name>.md` **only if that chart is in the developer's selection** (see
|
|
17
|
-
[[domain-requirements]] → *Chart Selection*).
|
|
18
|
-
|
|
19
|
-
- If the requirement says **"all plots" / "all charts" / "all"** → load **all 10** `chart-*` files.
|
|
20
|
-
- If it names a subset → load only those `chart-*` files (match via the selection-token table in
|
|
21
|
-
[[domain-requirements]]).
|
|
22
|
-
- If selection is **unspecified** → `/aw-spec-specify` / `/aw-spec-clarify` MUST ask which charts
|
|
23
|
-
before planning; do not assume "all".
|
|
24
|
-
|
|
25
|
-
The 10 chart files: `chart-heatmap.md` · `chart-bubble.md` · `chart-scurve.md` ·
|
|
26
|
-
`chart-survival.md` · `chart-volcano.md` · `chart-dimred.md` · `chart-parallel.md` ·
|
|
27
|
-
`chart-violin.md` · `chart-network.md` · `chart-trellis.md`.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## /aw-spec-constitution
|
|
32
|
-
- docs/domainspecs/UIVisualization/domain-requirements.md
|
|
33
|
-
|
|
34
|
-
## /aw-spec-specify
|
|
35
|
-
- docs/domainspecs/UIVisualization/domain-requirements.md
|
|
36
|
-
- docs/domainspecs/UIVisualization/ui-viz-terms.md
|
|
37
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
38
|
-
- docs/domainspecs/UIVisualization/data-source.domain.md
|
|
39
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md ← per selection, or ask
|
|
40
|
-
|
|
41
|
-
## /aw-spec-clarify
|
|
42
|
-
- docs/domainspecs/UIVisualization/domain-requirements.md
|
|
43
|
-
- docs/domainspecs/UIVisualization/ui-viz-terms.md
|
|
44
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
45
|
-
- (resolve the chart selection here if not yet specified)
|
|
46
|
-
|
|
47
|
-
## /aw-spec-plan
|
|
48
|
-
- docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
49
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
50
|
-
- docs/domainspecs/UIVisualization/state-management.domain.md
|
|
51
|
-
- docs/domainspecs/UIVisualization/data-source.domain.md
|
|
52
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
53
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
54
|
-
- docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
55
|
-
- docs/domainspecs/UIVisualization/testing.domain.md
|
|
56
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md ← one per selected chart
|
|
57
|
-
|
|
58
|
-
## /aw-spec-tasks
|
|
59
|
-
- docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
60
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
61
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
62
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
63
|
-
- docs/domainspecs/UIVisualization/state-management.domain.md
|
|
64
|
-
- docs/domainspecs/UIVisualization/data-source.domain.md
|
|
65
|
-
- docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
66
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md
|
|
67
|
-
|
|
68
|
-
## /aw-spec-analyze
|
|
69
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
70
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
71
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
72
|
-
- docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
73
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md
|
|
74
|
-
|
|
75
|
-
## /aw-spec-implement
|
|
76
|
-
- docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
77
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
78
|
-
- docs/domainspecs/UIVisualization/state-management.domain.md
|
|
79
|
-
- docs/domainspecs/UIVisualization/data-source.domain.md
|
|
80
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
81
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
82
|
-
- docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
83
|
-
- docs/domainspecs/UIVisualization/testing.domain.md
|
|
84
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md ← one per selected chart
|
|
85
|
-
|
|
86
|
-
## /aw-spec-fast-implement
|
|
87
|
-
|
|
88
|
-
> Fast path collapsing plan + tasks + analyze + implement into one pass. Deduplicated union of
|
|
89
|
-
> those headings. Load **once** for the whole pass — do not reload per phase.
|
|
90
|
-
|
|
91
|
-
- docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
92
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
93
|
-
- docs/domainspecs/UIVisualization/state-management.domain.md
|
|
94
|
-
- docs/domainspecs/UIVisualization/data-source.domain.md
|
|
95
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
96
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
97
|
-
- docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
98
|
-
- docs/domainspecs/UIVisualization/testing.domain.md
|
|
99
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md
|
|
100
|
-
|
|
101
|
-
## /aw-spec-minimal-implementation
|
|
102
|
-
|
|
103
|
-
> Single-step set — the per-domain knob. Loads the core charting rules + the selected chart files
|
|
104
|
-
> to implement in one pass. For an audited build use `## /aw-spec-fast-implement`.
|
|
105
|
-
|
|
106
|
-
- docs/domainspecs/UIVisualization/domain-requirements.md
|
|
107
|
-
- docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
108
|
-
- docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
109
|
-
- docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
110
|
-
- docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
111
|
-
- docs/domainspecs/UIVisualization/state-management.domain.md
|
|
112
|
-
- (+ selected) docs/domainspecs/UIVisualization/chart-<name>.md
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Quick reference (command → core file count, excluding per-chart)
|
|
117
|
-
|
|
118
|
-
| Command | Core domain rule files | + per selected chart |
|
|
119
|
-
|---|---|---|
|
|
120
|
-
| /aw-spec-constitution | 1 | — |
|
|
121
|
-
| /aw-spec-specify | 4 | 1 each |
|
|
122
|
-
| /aw-spec-clarify | 3 | resolve selection |
|
|
123
|
-
| /aw-spec-plan | 8 | 1 each |
|
|
124
|
-
| /aw-spec-tasks | 7 | 1 each |
|
|
125
|
-
| /aw-spec-analyze | 4 | 1 each |
|
|
126
|
-
| /aw-spec-implement | 8 | 1 each |
|
|
127
|
-
| /aw-spec-fast-implement | 8 | 1 each |
|
|
128
|
-
| /aw-spec-minimal-implementation | 6 | 1 each |
|
|
129
|
-
|
|
130
|
-
> "all plots" = +10 chart files. A 3-chart project = +3.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Component Contracts (Adapters) — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> The props-driven contract and the adapter pattern. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
5
|
-
|
|
6
|
-
## Props-driven, domain-agnostic
|
|
7
|
-
|
|
8
|
-
Every generic chart is **fully data-driven**: the caller supplies data, labels, colours, axis
|
|
9
|
-
types, and thresholds. A generic chart has **no** knowledge of the domain — the same `BubbleChart`
|
|
10
|
-
serves drug potency, portfolio risk, and product effort/impact.
|
|
11
|
-
|
|
12
|
-
Contract for a generic chart's props:
|
|
13
|
-
- **Data first** — required positional-feel props (`matrix`, `series`, `curves`, `arms`,
|
|
14
|
-
`points`, `panels`, `nodes`/`edges`, `groups`, `dimensions`/`traces`).
|
|
15
|
-
- **Labels explicit** — axis/legend/unit labels are required where the chart can't sensibly
|
|
16
|
-
default them; never hard-code a domain word.
|
|
17
|
-
- **Colours optional** — default from the shared palette; accept overrides per series.
|
|
18
|
-
- **`height?` optional** — omit for responsive fill (see [[charting-standards.domain]]).
|
|
19
|
-
- **`meta`/`metadata`** — open `Record<string,…>` for tooltip enrichment, never typed to a domain.
|
|
20
|
-
|
|
21
|
-
## The adapter pattern
|
|
22
|
-
|
|
23
|
-
A **thin adapter** is the only place domain types meet a chart. It maps a project type into the
|
|
24
|
-
generic chart's props and adds domain labels/colours. Adapters live in `components/charts/`
|
|
25
|
-
(NOT in `generic/`).
|
|
26
|
-
|
|
27
|
-
```tsx
|
|
28
|
-
// Adapter: domain TrialArm[] → SurvivalCurveChart
|
|
29
|
-
'use client'
|
|
30
|
-
import { SurvivalCurveChart } from '@/components/charts/generic'
|
|
31
|
-
import type { TrialArm } from '@/lib/types/pharma'
|
|
32
|
-
|
|
33
|
-
export default function KaplanMeierChart({ arms, height }: { arms: TrialArm[]; height?: number }) {
|
|
34
|
-
return (
|
|
35
|
-
<SurvivalCurveChart
|
|
36
|
-
arms={arms.map(a => ({
|
|
37
|
-
label: a.name, color: a.color, medianTime: a.medianSurvival,
|
|
38
|
-
points: a.points.map(p => ({ time: p.time, survival: p.survival,
|
|
39
|
-
ciLower: p.ciLower, ciUpper: p.ciUpper, nAtRisk: p.nAtRisk })),
|
|
40
|
-
}))}
|
|
41
|
-
timeLabel="Days" survivalLabel="Survival (%)" medianLabel="mOS"
|
|
42
|
-
curveType="OS" pValue="< 0.001" showCI height={height}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## When to skip the adapter
|
|
49
|
-
|
|
50
|
-
If a page already holds data in a generic shape (or the project is itself generic), call the
|
|
51
|
-
generic chart directly from the page with inline props — no adapter needed. Adapters exist to
|
|
52
|
-
keep **domain vocabulary out of pages** and **out of the generic ring**.
|
|
53
|
-
|
|
54
|
-
## Rules
|
|
55
|
-
|
|
56
|
-
- One adapter per (domain-type → chart) pairing; name it for the domain concept
|
|
57
|
-
(`CompoundScatterPlot`, `BiomarkerHeatmap`), not the chart.
|
|
58
|
-
- Adapters are **pure mapping** — no data fetching, no store mutation; they receive data as props.
|
|
59
|
-
- Never widen a generic chart's props with a domain field — add the field to `meta`/`metadata`
|
|
60
|
-
instead, or map it to an existing generic prop.
|
|
61
|
-
- Keep generic props **serialisable** (numbers, strings, arrays) so re-render diffing stays cheap
|
|
62
|
-
(see [[charting-standards.domain]]).
|
|
63
|
-
|
|
64
|
-
## Related
|
|
65
|
-
- [[charting-standards.domain]] — the base every chart builds on
|
|
66
|
-
- [[clean-architecture.domain]] — adapter is the dependency seam
|
|
67
|
-
- All `chart-*` files specify each chart's exact prop contract.
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Data Source Abstraction — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> How chart data enters the app. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`.
|
|
5
|
-
|
|
6
|
-
## Three source modes, one contract
|
|
7
|
-
|
|
8
|
-
The same dataset shape feeds the charts regardless of origin — the **repository/specification**
|
|
9
|
-
analog for the front-end:
|
|
10
|
-
|
|
11
|
-
| Mode | Phase | Origin | Wiring |
|
|
12
|
-
|---|---|---|---|
|
|
13
|
-
| `sample` | 1 | hard-coded `lib/sample-data` | default; renders on first paint |
|
|
14
|
-
| `excel` | 1 | client-side `.xlsx` upload (SheetJS) | `ExcelDropZone` → parser → `loadExcel` command |
|
|
15
|
-
| `api` | 2 | REST endpoint | `ApiDataSource` → `loadExcel`-shaped result |
|
|
16
|
-
|
|
17
|
-
Charts never know the source — they consume the store dataset. Swapping `sample`→`excel`→`api`
|
|
18
|
-
changes **no chart code** (see [[clean-architecture.domain]], [[state-management.domain]]).
|
|
19
|
-
|
|
20
|
-
## Excel ingest
|
|
21
|
-
|
|
22
|
-
- Parsing is **client-side only** (no server) via dynamic `import('xlsx')`.
|
|
23
|
-
- A generic parser returns raw rows per sheet (`Record<string, ParsedWorkbook>`); a
|
|
24
|
-
**project parser** maps those rows into the domain dataset and dispatches `loadExcel`.
|
|
25
|
-
- The drop-zone validates extension (`.xlsx/.xls`), shows parse state, and reports row counts.
|
|
26
|
-
- Sheet/column names are a **documented contract** shipped with the template
|
|
27
|
-
(`public/sample-data.xlsx` is the canonical example).
|
|
28
|
-
|
|
29
|
-
## Canonical example (agent reference)
|
|
30
|
-
|
|
31
|
-
```ts
|
|
32
|
-
// lib/excel/parse-excel.ts — generic: workbook → rows per sheet
|
|
33
|
-
import type { ExcelRow } from '@/lib/types'
|
|
34
|
-
export type ParsedWorkbook = Record<string, ExcelRow[]>
|
|
35
|
-
|
|
36
|
-
export async function parseExcelFile(file: File): Promise<ParsedWorkbook> {
|
|
37
|
-
const XLSX = await import('xlsx')
|
|
38
|
-
const wb = XLSX.read(await file.arrayBuffer(), { type: 'array' })
|
|
39
|
-
return Object.fromEntries(
|
|
40
|
-
wb.SheetNames.map(n => [n, XLSX.utils.sheet_to_json<ExcelRow>(wb.Sheets[n], { defval: null })]),
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
```tsx
|
|
46
|
-
// ExcelDropZone wires parse → command
|
|
47
|
-
const wb = await parseExcelFile(file) // generic rows
|
|
48
|
-
const dataset = mapWorkbookToDomain(wb) // project mapping
|
|
49
|
-
loadExcel(dataset) // store command (see [[state-management.domain]])
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Phase-2 API source (forward contract)
|
|
53
|
-
|
|
54
|
-
- Add `lib/data-source/ApiDataSource.ts` that fetches and returns the **same dataset shape** the
|
|
55
|
-
Excel mapper produces, then calls `loadExcel` (or `setSourceMode('api', …)`).
|
|
56
|
-
- Set `NEXT_PUBLIC_API_URL`; no chart or adapter changes.
|
|
57
|
-
|
|
58
|
-
## Rules
|
|
59
|
-
|
|
60
|
-
- No server-side Excel handling in Phase 1; keep ingest in the browser.
|
|
61
|
-
- The dataset shape is the single contract between source and charts — version it deliberately.
|
|
62
|
-
- Never parse domain meaning inside `components/charts/generic/` — mapping lives in the project
|
|
63
|
-
parser / adapter (see [[component-contracts.domain]]).
|
|
64
|
-
|
|
65
|
-
## Related
|
|
66
|
-
- [[state-management.domain]] — `loadExcel` command
|
|
67
|
-
- [[component-contracts.domain]] — adapters consume the dataset
|
|
68
|
-
- [[clean-architecture.domain]]
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# DOMAIN REQUIREMENTS (project-specific)
|
|
2
|
-
|
|
3
|
-
> Project-specific input for the **UI Data-Visualization** domain, **updated independently per
|
|
4
|
-
> project**. The engineering constitution stays domain-agnostic and supreme; this file holds the
|
|
5
|
-
> per-project chart enumeration and the headline tech profile. Detailed charting *rules* are
|
|
6
|
-
> expanded in the sibling files in this folder.
|
|
7
|
-
>
|
|
8
|
-
> This domain targets a **Next.js / React / Plotly** front-end (not the .NET backend). It composes
|
|
9
|
-
> with the technology base where applicable and overrides the runtime/stack sections below.
|
|
10
|
-
>
|
|
11
|
-
> Replace `<SampleProjectName>` and trim the **Chart Selection** list to the charts the project
|
|
12
|
-
> actually needs.
|
|
13
|
-
|
|
14
|
-
=====================================================================
|
|
15
|
-
[DOMAIN: Chart Catalog / Features]
|
|
16
|
-
=====================================================================
|
|
17
|
-
The visualization domain is organised as **one feature per chart type**. Each chart is a
|
|
18
|
-
**domain-agnostic, props-driven component** in the generic library, optionally wrapped by a thin
|
|
19
|
-
**adapter** that maps project data into its props (see [[clean-architecture.domain]],
|
|
20
|
-
[[component-contracts.domain]]). The 10 built-in charts:
|
|
21
|
-
|
|
22
|
-
- **Heatmap** — value matrix, colour-mapped by intensity. See [[chart-heatmap]].
|
|
23
|
-
- **BubbleChart** — multi-dimensional scatter (x · y · size · colour). See [[chart-bubble]].
|
|
24
|
-
- **SCurveChart** — sigmoidal / logistic growth with inflection markers. See [[chart-scurve]].
|
|
25
|
-
- **SurvivalCurveChart** — Kaplan-Meier step curves with CI shading. See [[chart-survival]].
|
|
26
|
-
- **VolcanoPlot** — magnitude vs. significance with threshold quadrants. See [[chart-volcano]].
|
|
27
|
-
- **DimRedPlot** — 2-D scatter of PCA / t-SNE / UMAP coordinates. See [[chart-dimred]].
|
|
28
|
-
- **ParallelCoordinatesPlot** — multi-axis polylines, one per observation. See [[chart-parallel]].
|
|
29
|
-
- **ViolinPlot** — KDE distribution + box per group. See [[chart-violin]].
|
|
30
|
-
- **NetworkGraph** — node-edge graph with built-in spring layout. See [[chart-network]].
|
|
31
|
-
- **TrellisGrid** — small multiples, same chart type per panel. See [[chart-trellis]].
|
|
32
|
-
|
|
33
|
-
=====================================================================
|
|
34
|
-
[DOMAIN: Chart Selection — REQUIRED INPUT]
|
|
35
|
-
=====================================================================
|
|
36
|
-
> **The developer specifies which charts the project needs when giving the requirement.**
|
|
37
|
-
|
|
38
|
-
- The requirement names a **subset** of the catalog (e.g. *"Heatmap, Volcano and Survival"*) or
|
|
39
|
-
says **"all plots"** to include every chart.
|
|
40
|
-
- A skill reads the selection and loads **only** the matching `chart-*` rule files
|
|
41
|
-
(see [[comandrulemap]]). Unselected charts are **not** scaffolded — their page route, adapter,
|
|
42
|
-
nav entry, and example data are omitted.
|
|
43
|
-
- Selection keywords are case-insensitive and accept either the **component name**
|
|
44
|
-
(`BubbleChart`) or the **friendly name** (`Bubble`, `bubble chart`). "all" / "all plots" /
|
|
45
|
-
"all charts" select the full catalog.
|
|
46
|
-
- Default when unspecified: **ask the developer**; do not assume "all".
|
|
47
|
-
|
|
48
|
-
| Selection token (any) | Rule file | Component |
|
|
49
|
-
|---|---|---|
|
|
50
|
-
| heatmap | [[chart-heatmap]] | `Heatmap` |
|
|
51
|
-
| bubble · bubble chart | [[chart-bubble]] | `BubbleChart` |
|
|
52
|
-
| s-curve · scurve · sigmoid · dose-response | [[chart-scurve]] | `SCurveChart` |
|
|
53
|
-
| survival · kaplan-meier · km · retention | [[chart-survival]] | `SurvivalCurveChart` |
|
|
54
|
-
| volcano | [[chart-volcano]] | `VolcanoPlot` |
|
|
55
|
-
| dimred · pca · tsne · umap · dimensionality | [[chart-dimred]] | `DimRedPlot` |
|
|
56
|
-
| parallel · parallel-coords · parcoords | [[chart-parallel]] | `ParallelCoordinatesPlot` |
|
|
57
|
-
| violin · distribution | [[chart-violin]] | `ViolinPlot` |
|
|
58
|
-
| network · graph · node-edge | [[chart-network]] | `NetworkGraph` |
|
|
59
|
-
| trellis · facet · small-multiples | [[chart-trellis]] | `TrellisGrid` |
|
|
60
|
-
|
|
61
|
-
=====================================================================
|
|
62
|
-
[DOMAIN: subsection pointers]
|
|
63
|
-
=====================================================================
|
|
64
|
-
[DOMAIN: Folder Structure Profile] -> docs/domainspecs/UIVisualization/folder-structure.domain.md
|
|
65
|
-
[DOMAIN: Clean Architecture / Layering] -> docs/domainspecs/UIVisualization/clean-architecture.domain.md
|
|
66
|
-
[DOMAIN: State / Data Flow (CQRS analog)] -> docs/domainspecs/UIVisualization/state-management.domain.md
|
|
67
|
-
[DOMAIN: Data Source Abstraction] -> docs/domainspecs/UIVisualization/data-source.domain.md
|
|
68
|
-
[DOMAIN: Charting Standards (base wrap)] -> docs/domainspecs/UIVisualization/charting-standards.domain.md
|
|
69
|
-
[DOMAIN: Component Contracts (adapters)] -> docs/domainspecs/UIVisualization/component-contracts.domain.md
|
|
70
|
-
[DOMAIN: Coding Standards Profile] -> docs/domainspecs/UIVisualization/coding-standards.domain.md
|
|
71
|
-
[DOMAIN: Testing Profile] -> docs/domainspecs/UIVisualization/testing.domain.md
|
|
72
|
-
[DOMAIN: Ubiquitous Language] -> docs/domainspecs/UIVisualization/ui-viz-terms.md
|
|
73
|
-
[DOMAIN: Per-chart rules] -> docs/domainspecs/UIVisualization/chart-<name>.md (load per selection)
|
|
74
|
-
|
|
75
|
-
=====================================================================
|
|
76
|
-
[DOMAIN: Tech Profile (overrides technology stack section)]
|
|
77
|
-
=====================================================================
|
|
78
|
-
- **Framework:** Next.js 16 (App Router, Turbopack); React 19; TypeScript 5 strict.
|
|
79
|
-
- **Charting:** Plotly.js (`plotly.js-dist-min`) loaded via a single SSR-safe base wrapper
|
|
80
|
-
(`PlotlyChart`) using dynamic import (see [[charting-standards.domain]]).
|
|
81
|
-
- **State:** Zustand 5 (see [[state-management.domain]]).
|
|
82
|
-
- **Data ingest:** SheetJS (`xlsx`) client-side; optional REST `ApiDataSource` for Phase 2
|
|
83
|
-
(see [[data-source.domain]]).
|
|
84
|
-
- **Styling:** Tailwind CSS 3 + dark "glass" theme (see [[charting-standards.domain]]).
|
|
85
|
-
- **Scaffold source:** `templates/AppWeaver.UI.Visualization` (generic) and
|
|
86
|
-
`templates/features/UIVisualization.PharmaReference` (reference); packed under
|
|
87
|
-
`docs/UI.Visualization/` (see PACKAGING.md there).
|
|
88
|
-
|
|
89
|
-
=====================================================================
|
|
90
|
-
[DOMAIN: Platform Topology]
|
|
91
|
-
=====================================================================
|
|
92
|
-
- Target runtime: static-export or Node SSR (Vercel, container, or any static host). No backend
|
|
93
|
-
required for Phase 1 — charts render from sample/Excel data fully client-side.
|
|
94
|
-
- Phase 2 wires a REST API behind the `data-source` abstraction with **zero chart changes**
|
|
95
|
-
(see [[data-source.domain]]).
|
|
96
|
-
- Performance targets: first chart interactive < 1.5 s on a warm cache; a single Plotly chart
|
|
97
|
-
re-render < 100 ms for typical (≤ 5k-point) datasets.
|
|
98
|
-
|
|
99
|
-
=====================================================================
|
|
100
|
-
[DOMAIN: Governance Overrides]
|
|
101
|
-
=====================================================================
|
|
102
|
-
- The **generic chart library is closed for domain logic** — additions/edits there require review
|
|
103
|
-
by a UI Principal Engineer (no project- or domain-specific code in `components/charts/generic/`).
|
|
104
|
-
- New chart types beyond the 10-chart catalog require a constitution amendment + a new
|
|
105
|
-
`chart-<name>.md` rule file authored to the same contract.
|
|
106
|
-
|
|
107
|
-
## Related
|
|
108
|
-
- [[folder-structure.domain]] · [[clean-architecture.domain]] · [[state-management.domain]] ·
|
|
109
|
-
[[data-source.domain]] · [[charting-standards.domain]] · [[component-contracts.domain]] ·
|
|
110
|
-
[[coding-standards.domain]] · [[testing.domain]] · [[ui-viz-terms]] · [[comandrulemap]]
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# Folder Structure — UI Visualization Domain
|
|
2
|
-
|
|
3
|
-
> Next.js App-Router layout for the visualization front-end. NON-NEGOTIABLE.
|
|
4
|
-
> Commands: `/aw-spec-plan`, `/aw-spec-tasks`, `/aw-spec-implement`. Replace `<SampleProjectName>`.
|
|
5
|
-
|
|
6
|
-
## Layout
|
|
7
|
-
|
|
8
|
-
```
|
|
9
|
-
<SampleProjectName>/ (sentinel: AppWeaver.UI.Visualization)
|
|
10
|
-
package.json · tsconfig.json · next.config.ts · tailwind.config.ts
|
|
11
|
-
public/ static assets + sample-data.xlsx
|
|
12
|
-
scripts/ generate-sample-excel.mjs (optional)
|
|
13
|
-
src/
|
|
14
|
-
app/ App Router — one route folder per SELECTED chart
|
|
15
|
-
layout.tsx root layout: <TopNav/> + bg-mesh
|
|
16
|
-
globals.css theme tokens, glass/gradient classes, animations
|
|
17
|
-
page.tsx catalog/dashboard landing
|
|
18
|
-
<chart-route>/page.tsx e.g. heatmap/ bubble/ volcano/ … (only selected)
|
|
19
|
-
components/
|
|
20
|
-
charts/
|
|
21
|
-
PlotlyChart.tsx SSR-safe Plotly base wrapper (see [[charting-standards.domain]])
|
|
22
|
-
generic/ ← DOMAIN-AGNOSTIC chart library (closed to domain logic)
|
|
23
|
-
index.ts barrel export
|
|
24
|
-
Heatmap.tsx · BubbleChart.tsx · SCurveChart.tsx · SurvivalCurveChart.tsx
|
|
25
|
-
VolcanoPlot.tsx · DimRedPlot.tsx · ParallelCoordinatesPlot.tsx
|
|
26
|
-
ViolinPlot.tsx · NetworkGraph.tsx · TrellisGrid.tsx
|
|
27
|
-
<DomainAdapter>.tsx thin adapters (project-specific) (see [[component-contracts.domain]])
|
|
28
|
-
layout/TopNav.tsx horizontal tab nav (one tab per selected chart)
|
|
29
|
-
excel-loader/ExcelDropZone.tsx drag-drop ingest (see [[data-source.domain]])
|
|
30
|
-
data-table/ · ui/ optional supporting components
|
|
31
|
-
lib/
|
|
32
|
-
types/ shared + domain data types
|
|
33
|
-
utils.ts cn(), formatters, curve generators
|
|
34
|
-
excel/ workbook parser (see [[data-source.domain]])
|
|
35
|
-
store/
|
|
36
|
-
data-store.ts Zustand store (see [[state-management.domain]])
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Rules
|
|
40
|
-
|
|
41
|
-
- The **generic chart library** lives only in `components/charts/generic/` and is
|
|
42
|
-
**domain-agnostic** — no project types, no business logic, no hard-coded labels
|
|
43
|
-
(see [[clean-architecture.domain]], [[component-contracts.domain]]).
|
|
44
|
-
- **One route folder per selected chart** under `src/app/`; unselected charts have **no**
|
|
45
|
-
route, no nav tab, no example data (see [[domain-requirements]] chart-selection).
|
|
46
|
-
- Domain **adapters** sit in `components/charts/` (NOT inside `generic/`) and map project data
|
|
47
|
-
to generic props.
|
|
48
|
-
- Cross-cutting files (`PlotlyChart.tsx`, `globals.css`, `TopNav.tsx`, `data-store.ts`,
|
|
49
|
-
the base config files) MUST stay where the AppWeaver template places them.
|
|
50
|
-
- `@/*` path alias maps to `./src/*` — import charts as
|
|
51
|
-
`@/components/charts/generic`.
|
|
52
|
-
|
|
53
|
-
## Related
|
|
54
|
-
- [[clean-architecture.domain]] · [[component-contracts.domain]] · [[charting-standards.domain]] ·
|
|
55
|
-
[[state-management.domain]] · [[data-source.domain]]
|