@invinite-org/chartlang-core 1.1.1 → 1.2.0
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 +226 -0
- package/README.md +2 -1
- package/dist/draw/buckets.d.ts.map +1 -1
- package/dist/draw/buckets.js +1 -0
- package/dist/draw/buckets.js.map +1 -1
- package/dist/draw/draw.d.ts +8 -1
- package/dist/draw/draw.d.ts.map +1 -1
- package/dist/draw/draw.js.map +1 -1
- package/dist/draw/drawingKind.d.ts +8 -8
- package/dist/draw/drawingKind.d.ts.map +1 -1
- package/dist/draw/drawingKind.js +5 -3
- package/dist/draw/drawingKind.js.map +1 -1
- package/dist/draw/drawingState.d.ts +27 -3
- package/dist/draw/drawingState.d.ts.map +1 -1
- package/dist/draw/drawingState.js.map +1 -1
- package/dist/draw/drawingStyle.d.ts +52 -9
- package/dist/draw/drawingStyle.d.ts.map +1 -1
- package/dist/draw/drawingStyle.js.map +1 -1
- package/dist/draw/index.d.ts +2 -2
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plot/plot.d.ts +15 -0
- package/dist/plot/plot.d.ts.map +1 -1
- package/dist/plot/plot.js.map +1 -1
- package/dist/request/index.d.ts +1 -1
- package/dist/request/index.d.ts.map +1 -1
- package/dist/request/index.js.map +1 -1
- package/dist/request/request.d.ts +82 -20
- package/dist/request/request.d.ts.map +1 -1
- package/dist/request/request.js +27 -26
- package/dist/request/request.js.map +1 -1
- package/dist/state/state.d.ts +17 -0
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +18 -0
- package/dist/state/state.js.map +1 -1
- package/dist/statefulPrimitives.d.ts +9 -5
- package/dist/statefulPrimitives.d.ts.map +1 -1
- package/dist/statefulPrimitives.js +17 -5
- package/dist/statefulPrimitives.js.map +1 -1
- package/dist/ta/ta.d.ts +39 -8
- package/dist/ta/ta.d.ts.map +1 -1
- package/dist/ta/ta.js +6 -0
- package/dist/ta/ta.js.map +1 -1
- package/dist/types.d.ts +166 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,231 @@
|
|
|
1
1
|
# @invinite-org/chartlang-core
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 850ae21: Add `bar.point(offset, price)` — index authoring sugar for anchoring drawings
|
|
8
|
+
by bar offset instead of an absolute timestamp.
|
|
9
|
+
|
|
10
|
+
`bar.point` resolves the offset to the existing time-based `WorldPoint`
|
|
11
|
+
(`{ time, price }`) at compute time, so it composes directly with every
|
|
12
|
+
`draw.*` anchor argument and introduces no new wire format or anchor union:
|
|
13
|
+
|
|
14
|
+
- `bar.point(0, price)` — the current bar.
|
|
15
|
+
- `bar.point(-n, price)` — `n` bars back, using the real historical timestamp
|
|
16
|
+
from the runtime's time ring buffer (`NaN` time past retained history; never
|
|
17
|
+
throws).
|
|
18
|
+
- `bar.point(n, price)` — a future bar, with the time extrapolated from the
|
|
19
|
+
median recent bar spacing (falling back to the parsed bar interval when
|
|
20
|
+
fewer than two bars are retained).
|
|
21
|
+
|
|
22
|
+
The compiler's max-lookback analysis now counts a negative integer-literal
|
|
23
|
+
`bar.point(-n, …)` offset toward `maxLookback` exactly like a `series[n]`
|
|
24
|
+
lookback, so the runtime sizes the time buffer deeply enough; positive (future)
|
|
25
|
+
offsets and dynamic offsets contribute no extra depth. The recogniser peels
|
|
26
|
+
parentheses, so the converter's emitted form `bar.point(-(n), …)` is sized
|
|
27
|
+
identically to a hand-written `bar.point(-n, …)` (without it, a converted
|
|
28
|
+
historical tracking line sized its buffer to 0 and resolved to a NaN anchor).
|
|
29
|
+
|
|
30
|
+
The Pine v6 converter now lowers `bar_index` drawing anchors to
|
|
31
|
+
`bar.point(<signed offset>, <price>)` and drops the dead `__BAR_INTERVAL_MS`
|
|
32
|
+
sentinel and its `bar.time ± (N * __BAR_INTERVAL_MS)` arithmetic — future
|
|
33
|
+
anchors resolve at runtime instead of needing a host-supplied bar interval.
|
|
34
|
+
|
|
35
|
+
- ca19e20: Bidirectional plot `offset` — negative offsets shift a plotted series left.
|
|
36
|
+
|
|
37
|
+
`offset` becomes a presentation-only **display shift** in bars with the
|
|
38
|
+
fixed sign convention `+n` = right (future), `−n` = left (past); the
|
|
39
|
+
numeric series value is unshifted. This replaces the old value-read model
|
|
40
|
+
(where a positive offset made `series.current` read the value N bars ago
|
|
41
|
+
and a negative offset resolved to `NaN`). The `*Opts` `offset` JSDoc (and
|
|
42
|
+
ALMA's `barShift`) now describe both directions and drop the old
|
|
43
|
+
"negative ⇒ NaN" wording (`AlmaOpts.offset`, the Gaussian-centre
|
|
44
|
+
position, is unchanged).
|
|
45
|
+
|
|
46
|
+
`PlotEmission` gains an optional presentation field `xShift?: number`
|
|
47
|
+
(signed integer bars; omitted/`0` ≡ no shift, so a no-shift emission is
|
|
48
|
+
byte-identical to today). `validateEmission` rejects a non-integer
|
|
49
|
+
`xShift`. The compiler no longer counts `offset` toward `maxLookback`
|
|
50
|
+
(the value is no longer read from a deeper slot). The runtime threads the
|
|
51
|
+
declared offset onto the emission as `xShift` (reading a
|
|
52
|
+
`WeakMap<Series, number>` offset tag set by `makeShiftedSeriesView`; ALMA
|
|
53
|
+
tags `opts.barShift`) and stops the old value-read shift so
|
|
54
|
+
`series.current` is unshifted; the reference adapter renders it by
|
|
55
|
+
projecting `xShift` onto the x-axis (extending the viewport for
|
|
56
|
+
future-shifted points).
|
|
57
|
+
|
|
58
|
+
The Pine converter now maps `plot(<ta.* call>, offset=N)` onto the
|
|
59
|
+
emitted `ta.*` call's `offset` opt (signed, both directions); a plot
|
|
60
|
+
whose value is not a direct `ta.*` call drops the offset and emits the
|
|
61
|
+
new `plot-offset-needs-ta-call` warning, and a plot-level offset
|
|
62
|
+
replacing the ta call's own `offset=` emits `plot-offset-overrides-ta-offset`.
|
|
63
|
+
|
|
64
|
+
The conformance harness's `plot-field` assertion gains an `xShift` field,
|
|
65
|
+
and a new scenario pins both shift directions plus the unshifted value
|
|
66
|
+
series.
|
|
67
|
+
|
|
68
|
+
- 6235ad7: Make the compute bar's OHLCV + derived fields directly indexable as a series.
|
|
69
|
+
|
|
70
|
+
`bar.close`, `bar.open`, `bar.high`, `bar.low`, `bar.volume`, and the derived
|
|
71
|
+
`bar.hl2` / `bar.hlc3` / `bar.ohlc4` / `bar.hlcc4` are now `PriceSeries` /
|
|
72
|
+
`VolumeSeries` (`number & Series<number>`) on the bar passed to `compute`
|
|
73
|
+
(`ComputeContext.bar`, typed as the new `BarSeries`). Each field is **both** a
|
|
74
|
+
scalar — `bar.close * 2`, `plot(bar.close)`, `ta.ema(bar.close, 20)` keep
|
|
75
|
+
working unchanged — **and** an indexable series, so a script can read prior
|
|
76
|
+
bars directly:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const sma5 =
|
|
80
|
+
(bar.close[0] + bar.close[1] + bar.close[2] + bar.close[3] + bar.close[4]) /
|
|
81
|
+
5;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This removes the `ta.ema(bar.close, 1)` identity-trick that scripts previously
|
|
85
|
+
needed to "republish" a scalar price as an indexable `Series`.
|
|
86
|
+
|
|
87
|
+
The adapter-supplied candle type `Bar` (and `request.lowerTf` intrabar bars) is
|
|
88
|
+
unchanged — it stays scalar OHLCV; only the streaming `compute` bar gains the
|
|
89
|
+
series shape. `request.security`'s higher-timeframe bar remains the separate
|
|
90
|
+
`SecurityBar`.
|
|
91
|
+
|
|
92
|
+
Migration note: because the field is now an object, `Number.isFinite(bar.close)`
|
|
93
|
+
is always `false` (it does not coerce) and `bar.close === 42` is `false` (object
|
|
94
|
+
vs number). Use `bar.close.current` or `+bar.close` in those raw-number
|
|
95
|
+
contexts. `bar.point(0, bar.close)` continues to work — the runtime coerces the
|
|
96
|
+
anchor price to a scalar.
|
|
97
|
+
|
|
98
|
+
- 3bf391a: Add the `draw.fillBetween(edgeA, edgeB, opts?)` drawing primitive — a
|
|
99
|
+
native filled ribbon between two edges (the closed polygon `edgeA`
|
|
100
|
+
forward then `edgeB` reversed). It is the chartlang equivalent of Pine's
|
|
101
|
+
`linefill.new(line1, line2, color)` / `fill(plot1, plot2)`. The
|
|
102
|
+
pine-converter now lowers static two-line `linefill.new` to it instead of
|
|
103
|
+
approximating with `draw.rotatedRectangle`, retiring the
|
|
104
|
+
`linefill-rotatedrect-approximated` diagnostic.
|
|
105
|
+
- 8086003: Add an optional presentation-only `z` (render-order / z-index) option to
|
|
106
|
+
`plot()` and every `draw.*` primitive. Default `0`; higher renders on
|
|
107
|
+
top, ties fall back to the existing group + declaration order. Finite
|
|
108
|
+
numbers only. Affects stacking only — values, alerts, and `state.*` are
|
|
109
|
+
unchanged.
|
|
110
|
+
|
|
111
|
+
Adapter kit: `PlotEmission` and `DrawingEmission` gain the matching
|
|
112
|
+
presentation-only `z?: number` wire field, validated by
|
|
113
|
+
`validateEmission` as a finite number (NaN / ±Infinity rejected;
|
|
114
|
+
fractional and negative allowed). Omitted/`0` stays byte-identical to a
|
|
115
|
+
pre-feature emission, so existing goldens and conformance hashes are
|
|
116
|
+
untouched.
|
|
117
|
+
|
|
118
|
+
Runtime: `plotImpl` reads `opts.z`, and the drawing-emit path
|
|
119
|
+
(`createDrawingHandle`) lifts `z` out of `state.style` — into a shallow
|
|
120
|
+
clone with `z` removed, where the per-kind `draw.*` impls fold the opts
|
|
121
|
+
bag — and threads it onto the top-level `PlotEmission.z` /
|
|
122
|
+
`DrawingEmission.z` with the same omit-when-`0` conditional spread used
|
|
123
|
+
for `xShift`. `z` is persisted **beside** the drawing slot's `state`
|
|
124
|
+
(never inside `DrawingState`), so an `update` retains the last value. A
|
|
125
|
+
no-`z` plot or drawing emits no `z` key — byte-identical to the
|
|
126
|
+
pre-feature baseline. `draw.table` / `draw.group` do not carry `z` in
|
|
127
|
+
v1.
|
|
128
|
+
|
|
129
|
+
Pine converter: `explicit_plot_zorder` is now a recognized no-op instead
|
|
130
|
+
of an unmapped warning. chartlang already layers marks by declaration
|
|
131
|
+
order within their group (the normative ordering contract), which is
|
|
132
|
+
exactly what Pine's `explicit_plot_zorder=true` makes authoritative — so
|
|
133
|
+
the flag is satisfied by default and needs no chartlang option.
|
|
134
|
+
`mapDeclarationArgs` no longer raises `indicator-arg-not-mapped` for it;
|
|
135
|
+
instead it emits a single `explicit-plot-zorder-default` info note
|
|
136
|
+
(covering both `explicit_plot_zorder=true` and the Pine-default
|
|
137
|
+
`=false`). The converter still never _emits_ a numeric `z` — Pine has no
|
|
138
|
+
per-element z source construct. Other unmapped `indicator(...)` args
|
|
139
|
+
(`timeframe`, etc.) keep warning.
|
|
140
|
+
|
|
141
|
+
Compiler: the ambient `@invinite-org/chartlang-core` `.d.ts` shim gains a
|
|
142
|
+
`ZOrdered { z?: number }` mixin intersected into `PlotOpts` and every
|
|
143
|
+
`draw.*` option type (mirroring core's `drawingStyle.ts`), so a compiled
|
|
144
|
+
script's `plot(value, { z })` **and** `draw.*(…, { z })` type-check (the
|
|
145
|
+
shim stays in lockstep with core).
|
|
146
|
+
|
|
147
|
+
Conformance: a new `z-order` scenario pins the plot `z` →
|
|
148
|
+
`PlotEmission.z` wire contract — a `plot(value, { z: -1 })` emits
|
|
149
|
+
`z: -1`, a no-`z` plot omits the field (omit-when-`0` byte-identity), and
|
|
150
|
+
a value-hash proves `z` never transforms the series. The `plot-field`
|
|
151
|
+
assertion's `field` union widens to also accept `"z"`.
|
|
152
|
+
|
|
153
|
+
- 073f41b: Add the higher-timeframe expression/callback overload to `request.security`.
|
|
154
|
+
Alongside the existing data form `request.security({ interval })` →
|
|
155
|
+
`SecurityBar`, scripts can now write `request.security({ interval }, (bar) =>
|
|
156
|
+
…)` → `Series<number>`, where the callback runs on the **higher-timeframe
|
|
157
|
+
clock** — `request.security({ interval: "1W" }, (bar) => ta.ema(bar.close, 20))`
|
|
158
|
+
is a true weekly EMA(20) (20 weekly bars), not 20 main bars of a weekly-stepped
|
|
159
|
+
series. The result is aligned no-lookahead down to the main timeline.
|
|
160
|
+
|
|
161
|
+
- **core** — the `SecurityExpr` callback type (re-exported from the package
|
|
162
|
+
root), the second `security` overload, and the shared `statefulPrimitives`
|
|
163
|
+
entry annotated as covering both arities.
|
|
164
|
+
- **compiler** — records one `SecurityExpressionDescriptor { slotId, interval,
|
|
165
|
+
paramName }` per expression callsite in `manifest.securityExpressions`
|
|
166
|
+
(sorted by `slotId`, omitted for the data-only form), and validates each
|
|
167
|
+
callback against the allowed subset — its `bar` parameter and body locals,
|
|
168
|
+
the ambient `ta` / `inputs`, safe `Math.*` globals, and literals — rejecting
|
|
169
|
+
any captured outer binding with the new
|
|
170
|
+
`request-security-expr-captures-local` diagnostic.
|
|
171
|
+
- **runtime** — mounts one `SecurityExprRunner` per manifest entry: the
|
|
172
|
+
callback is captured lazily on the first main compute, driven once per HTF bar
|
|
173
|
+
close through a dedicated fold `StreamState` so `ta.*` accumulate on the HTF
|
|
174
|
+
clock, and one sampled value per HTF bar feeds a per-slot output buffer that
|
|
175
|
+
`request.security(opts, expr)` returns aligned no-lookahead to the main
|
|
176
|
+
timeline. Capability / interval / stream fallbacks return an all-NaN series
|
|
177
|
+
with a deduped diagnostic.
|
|
178
|
+
- **host-worker / host-quickjs** — boot the expression form unchanged; the
|
|
179
|
+
`__manifest` sidecar already carries `securityExpressions`.
|
|
180
|
+
- **pine-converter** — Pine's `request.security(sym, "D", ta.ema(close, 9))`
|
|
181
|
+
now lowers to the chartlang callback form
|
|
182
|
+
`request.security({ interval: "1d" }, (bar) => ta.ema(bar.close, 9))` (a bare
|
|
183
|
+
OHLCV third arg keeps lowering to the data form).
|
|
184
|
+
- **conformance** — new scenarios prove the weekly expression value differs
|
|
185
|
+
from a same-length main-timeframe EMA, plus the `multiTimeframe: false` NaN
|
|
186
|
+
fallback.
|
|
187
|
+
|
|
188
|
+
- 5a9c24d: Add `state.series(init)` — a writable, indexable user series. Store an
|
|
189
|
+
arbitrary value each bar (`s.value = expr`) and read its history N bars
|
|
190
|
+
back (`s[1]`). Number-coercible (`+s`, `s.current`) and usable as a `ta.*`
|
|
191
|
+
source. The Pine converter lowers a history-indexed `var` to it.
|
|
192
|
+
- 08c536c: Add the `ta.highestbars` / `ta.lowestbars` primitives plus the cross-package
|
|
193
|
+
wiring that makes them usable as drawing anchors and Pine-converter targets.
|
|
194
|
+
|
|
195
|
+
- **core / runtime:** `ta.highestbars(source, length, opts?)` and
|
|
196
|
+
`ta.lowestbars(source, length, opts?)` return the bar OFFSET (≤ 0) to the
|
|
197
|
+
highest / lowest `source` value over the trailing `length` bars (window
|
|
198
|
+
INCLUDES the current bar). `0` → current bar is the extreme; `-k` → the
|
|
199
|
+
extreme occurred `k` bars ago. Ties resolve to the most recent bar; NaN
|
|
200
|
+
inputs are skipped; warmup is `length − 1` bars; tick-mode replays the
|
|
201
|
+
in-progress head as the offset-0 candidate. Registered in
|
|
202
|
+
`STATEFUL_PRIMITIVES` (now 174 entries) and `TA_REGISTRY` (now 96 entries).
|
|
203
|
+
- **compiler:** a literal-length `ta.highestbars` / `ta.lowestbars` call
|
|
204
|
+
contributes `length − 1` toward `maxLookback`, so the runtime sizes the time
|
|
205
|
+
ring buffer deep enough for a `bar.point(<that offset>, …)` anchor to resolve.
|
|
206
|
+
A non-literal length contributes 0.
|
|
207
|
+
- **pine-converter:** `ta.highestbars` / `ta.lowestbars` now map to the real
|
|
208
|
+
chartlang primitives (previously lossy passthroughs to `ta.highest` /
|
|
209
|
+
`ta.lowest`). **Behavior change:** a DYNAMIC `bar_index + <non-literal>`
|
|
210
|
+
drawing-x anchor no longer raises the hard `requires-bar-interval` error —
|
|
211
|
+
the offset is resolved by `bar.point` at runtime sign-agnostically (a
|
|
212
|
+
negative runtime offset, e.g. what `ta.highestbars` returns, resolves to the
|
|
213
|
+
historical timestamp via the time buffer). Only the literal `bar_index + N`
|
|
214
|
+
future case still requires a bar interval.
|
|
215
|
+
- **conformance:** new `TA_HIGHEST_LOWEST_BARS_SCENARIO` export pins both
|
|
216
|
+
primitives end-to-end through the compiler + runtime over the bundled
|
|
217
|
+
`goldenBars.json` fixture, and is added to `ALL_SCENARIOS`.
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- 850ae21: Expand the `request.security` / `request.lowerTf` JSDoc into narrative
|
|
222
|
+
descriptions with realistic examples (higher-timeframe `SecurityBar` reads
|
|
223
|
+
and lower-timeframe contained-bar arrays), and cross-link both generated
|
|
224
|
+
primitive pages to the multi-timeframe guide via their `seeAlso` entry in
|
|
225
|
+
`genPhase4Docs.ts`. The auto-generated `docs/primitives/request/*.md` pages
|
|
226
|
+
and the hover registry were regenerated from the new JSDoc — no runtime
|
|
227
|
+
behaviour change.
|
|
228
|
+
|
|
3
229
|
## 1.1.1
|
|
4
230
|
|
|
5
231
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -19,7 +19,8 @@ pnpm add @invinite-org/chartlang-core
|
|
|
19
19
|
- Stateful slots: `state.float`, `int`, `bool`, `string`, plus
|
|
20
20
|
`state.tick.*` for tick-persistent `varip` semantics.
|
|
21
21
|
- Views: `barstate`, `syminfo`, `timeframe`.
|
|
22
|
-
- Secondary stream: `request.security({ interval })`
|
|
22
|
+
- Secondary stream: `request.security({ interval })` (data) and
|
|
23
|
+
`request.security({ interval }, (bar) => …)` (HTF expression) typed surface.
|
|
23
24
|
- Emissions: `plot`, `hline`, `alert`, and the 61-kind `draw.*` namespace.
|
|
24
25
|
- Registry: `STATEFUL_PRIMITIVES` for compiler slot-id injection.
|
|
25
26
|
- Indicator composition (Phase 7): `CompiledScriptObject.output(title)` /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buckets.d.ts","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"buckets.d.ts","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,aAAa,CAmE9D,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,aAAa,CAM1D"}
|
package/dist/draw/buckets.js
CHANGED
package/dist/draw/buckets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buckets.js","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAsB/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,WAAW,GAA4C,IAAI,GAAG,CAGzE;IACE,CAAC,MAAM,EAAE,OAAO,CAAC;IACjB,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAC5B,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC3B,CAAC,eAAe,EAAE,OAAO,CAAC;IAC1B,CAAC,YAAY,EAAE,OAAO,CAAC;IACvB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,C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3B,CAAC,UAAU,EAAE,OAAO,CAAC;IACrB,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAC9B,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,UAAU,EAAE,OAAO,CAAC;IACrB,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,eAAe,EAAE,WAAW,CAAC;IAC9B,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC/B,CAAC,oBAAoB,EAAE,WAAW,CAAC;IACnC,CAAC,cAAc,EAAE,WAAW,CAAC;IAC7B,CAAC,kBAAkB,EAAE,WAAW,CAAC;IACjC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,yBAAyB,EAAE,WAAW,CAAC;IACxC,CAAC,uBAAuB,EAAE,WAAW,CAAC;IACtC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,cAAc,EAAE,OAAO,CAAC;IACzB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { DrawingKind } from \"./drawingKind.js\";\n\n/**\n * Canonical bucket name a {@link DrawingKind} maps to under the\n * `DrawingCounts` 5-bag budget (`{ lines, labels, boxes, polylines,\n * other }`). The adapter-kit `Capabilities.maxDrawingsPerScript` and\n * the script-side `ScriptManifest.maxDrawings?` both pin the same five\n * bucket names. The runtime budget enforcer counts emissions per\n * bucket and drops the overflow with `drawing-budget-exceeded`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * const b: DrawingBucket = \"lines\";\n * void b;\n */\nexport type DrawingBucket = \"lines\" | \"labels\" | \"boxes\" | \"polylines\" | \"other\";\n\n/**\n * Per-kind bucket assignment. Pinned table; every entry of\n * {@link DrawingKind} appears exactly once (asserted by\n * `buckets.test.ts`).\n *\n * Mapping rationale (Phase-3 task README §\"Architecture Decisions\"):\n * lines/rays/horizontalLine/verticalLine/crossLine/trendAngle → `lines`;\n * rectangle/rotatedRectangle/triangle/circle/ellipse → `boxes`;\n * path/polyline/curves/freehand/channels/pitchforks/patterns/elliott →\n * `polylines`; text/arrow/arrowMarker/arrowMarkUp/arrowMarkDown +\n * marker → `labels`; fib / gann / cycles / containers / table → `other`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { KIND_BUCKET } from \"@invinite-org/chartlang-core\";\n * const b = KIND_BUCKET.get(\"fib-retracement\"); // \"other\"\n * void b;\n */\nexport const KIND_BUCKET: ReadonlyMap<DrawingKind, DrawingBucket> = new Map<\n DrawingKind,\n DrawingBucket\n>([\n [\"line\", \"lines\"],\n [\"horizontal-line\", \"lines\"],\n [\"horizontal-ray\", \"lines\"],\n [\"vertical-line\", \"lines\"],\n [\"cross-line\", \"lines\"],\n [\"trend-angle\", \"lines\"],\n [\"rectangle\", \"boxes\"],\n [\"rotated-rectangle\", \"boxes\"],\n [\"triangle\", \"boxes\"],\n [\"polyline\", \"polylines\"],\n [\"circle\", \"boxes\"],\n [\"ellipse\", \"boxes\"],\n [\"path\", \"polylines\"],\n [\"marker\", \"labels\"],\n [\"arc\", \"polylines\"],\n [\"curve\", \"polylines\"],\n [\"double-curve\", \"polylines\"],\n [\"pen\", \"polylines\"],\n [\"highlighter\", \"polylines\"],\n [\"brush\", \"polylines\"],\n [\"text\", \"labels\"],\n [\"arrow\", \"labels\"],\n [\"arrow-marker\", \"labels\"],\n [\"arrow-mark-up\", \"labels\"],\n [\"arrow-mark-down\", \"labels\"],\n [\"trend-channel\", \"polylines\"],\n [\"flat-top-bottom\", \"polylines\"],\n [\"disjoint-channel\", \"polylines\"],\n [\"regression-trend\", \"polylines\"],\n [\"fib-retracement\", \"other\"],\n [\"fib-trend-extension\", \"other\"],\n [\"fib-channel\", \"other\"],\n [\"fib-time-zone\", \"other\"],\n [\"fib-wedge\", \"other\"],\n [\"fib-speed-fan\", \"other\"],\n [\"fib-speed-arcs\", \"other\"],\n [\"fib-spiral\", \"other\"],\n [\"fib-circles\", \"other\"],\n [\"fib-trend-time\", \"other\"],\n [\"gann-box\", \"other\"],\n [\"gann-square-fixed\", \"other\"],\n [\"gann-square\", \"other\"],\n [\"gann-fan\", \"other\"],\n [\"pitchfork\", \"polylines\"],\n [\"pitchfan\", \"polylines\"],\n [\"xabcd-pattern\", \"polylines\"],\n [\"cypher-pattern\", \"polylines\"],\n [\"head-and-shoulders\", \"polylines\"],\n [\"abcd-pattern\", \"polylines\"],\n [\"triangle-pattern\", \"polylines\"],\n [\"three-drives-pattern\", \"polylines\"],\n [\"elliott-impulse-wave\", \"polylines\"],\n [\"elliott-correction-wave\", \"polylines\"],\n [\"elliott-triangle-wave\", \"polylines\"],\n [\"elliott-double-combo\", \"polylines\"],\n [\"elliott-triple-combo\", \"polylines\"],\n [\"cyclic-lines\", \"other\"],\n [\"time-cycles\", \"other\"],\n [\"sine-line\", \"other\"],\n [\"group\", \"other\"],\n [\"frame\", \"other\"],\n [\"table\", \"other\"],\n]);\n\n/**\n * Return the {@link DrawingBucket} for a given {@link DrawingKind}.\n * Throws if the kind is not in the map — covers the defensive branch\n * for callers that pass an unverified string (e.g. a future kind\n * round-tripped from the wire before its bucket entry lands).\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { bucketFor } from \"@invinite-org/chartlang-core\";\n * const bucket = bucketFor(\"rectangle\"); // \"boxes\"\n * void bucket;\n */\nexport function bucketFor(kind: DrawingKind): DrawingBucket {\n const bucket = KIND_BUCKET.get(kind);\n if (bucket === undefined) {\n throw new Error(`No bucket assigned for drawing kind '${kind}'`);\n }\n return bucket;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"buckets.js","sourceRoot":"","sources":["../../src/draw/buckets.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAsB/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,WAAW,GAA4C,IAAI,GAAG,CAGzE;IACE,CAAC,MAAM,EAAE,OAAO,CAAC;IACjB,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAC5B,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC3B,CAAC,eAAe,EAAE,OAAO,CAAC;IAC1B,CAAC,YAAY,EAAE,OAAO,CAAC;IACvB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAC9B,CAAC,UAAU,EAAE,OAAO,CAAC;IACrB,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,QAAQ,EAAE,OAAO,CAAC;IACnB,CAAC,SAAS,EAAE,OAAO,CAAC;IACpB,CAAC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,CAAC,UAAU,EAAE,WAAW,CAAC;IACzB,CAAC,eAAe,EAAE,WAAW,CAAC;IAC9B,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC/B,CAAC,oBAAoB,EAAE,WAAW,CAAC;IACnC,CAAC,cAAc,EAAE,WAAW,CAAC;IAC7B,CAAC,kBAAkB,EAAE,WAAW,CAAC;IACjC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,yBAAyB,EAAE,WAAW,CAAC;IACxC,CAAC,uBAAuB,EAAE,WAAW,CAAC;IACtC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,sBAAsB,EAAE,WAAW,CAAC;IACrC,CAAC,cAAc,EAAE,OAAO,CAAC;IACzB,CAAC,aAAa,EAAE,OAAO,CAAC;IACxB,CAAC,WAAW,EAAE,OAAO,CAAC;IACtB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,GAAG,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { DrawingKind } from \"./drawingKind.js\";\n\n/**\n * Canonical bucket name a {@link DrawingKind} maps to under the\n * `DrawingCounts` 5-bag budget (`{ lines, labels, boxes, polylines,\n * other }`). The adapter-kit `Capabilities.maxDrawingsPerScript` and\n * the script-side `ScriptManifest.maxDrawings?` both pin the same five\n * bucket names. The runtime budget enforcer counts emissions per\n * bucket and drops the overflow with `drawing-budget-exceeded`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * const b: DrawingBucket = \"lines\";\n * void b;\n */\nexport type DrawingBucket = \"lines\" | \"labels\" | \"boxes\" | \"polylines\" | \"other\";\n\n/**\n * Per-kind bucket assignment. Pinned table; every entry of\n * {@link DrawingKind} appears exactly once (asserted by\n * `buckets.test.ts`).\n *\n * Mapping rationale (Phase-3 task README §\"Architecture Decisions\"):\n * lines/rays/horizontalLine/verticalLine/crossLine/trendAngle → `lines`;\n * rectangle/rotatedRectangle/triangle/circle/ellipse → `boxes`;\n * path/polyline/curves/freehand/channels/pitchforks/patterns/elliott →\n * `polylines`; text/arrow/arrowMarker/arrowMarkUp/arrowMarkDown +\n * marker → `labels`; fib / gann / cycles / containers / table → `other`.\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { KIND_BUCKET } from \"@invinite-org/chartlang-core\";\n * const b = KIND_BUCKET.get(\"fib-retracement\"); // \"other\"\n * void b;\n */\nexport const KIND_BUCKET: ReadonlyMap<DrawingKind, DrawingBucket> = new Map<\n DrawingKind,\n DrawingBucket\n>([\n [\"line\", \"lines\"],\n [\"horizontal-line\", \"lines\"],\n [\"horizontal-ray\", \"lines\"],\n [\"vertical-line\", \"lines\"],\n [\"cross-line\", \"lines\"],\n [\"trend-angle\", \"lines\"],\n [\"rectangle\", \"boxes\"],\n [\"rotated-rectangle\", \"boxes\"],\n [\"triangle\", \"boxes\"],\n [\"polyline\", \"polylines\"],\n [\"circle\", \"boxes\"],\n [\"ellipse\", \"boxes\"],\n [\"path\", \"polylines\"],\n [\"fill-between\", \"polylines\"],\n [\"marker\", \"labels\"],\n [\"arc\", \"polylines\"],\n [\"curve\", \"polylines\"],\n [\"double-curve\", \"polylines\"],\n [\"pen\", \"polylines\"],\n [\"highlighter\", \"polylines\"],\n [\"brush\", \"polylines\"],\n [\"text\", \"labels\"],\n [\"arrow\", \"labels\"],\n [\"arrow-marker\", \"labels\"],\n [\"arrow-mark-up\", \"labels\"],\n [\"arrow-mark-down\", \"labels\"],\n [\"trend-channel\", \"polylines\"],\n [\"flat-top-bottom\", \"polylines\"],\n [\"disjoint-channel\", \"polylines\"],\n [\"regression-trend\", \"polylines\"],\n [\"fib-retracement\", \"other\"],\n [\"fib-trend-extension\", \"other\"],\n [\"fib-channel\", \"other\"],\n [\"fib-time-zone\", \"other\"],\n [\"fib-wedge\", \"other\"],\n [\"fib-speed-fan\", \"other\"],\n [\"fib-speed-arcs\", \"other\"],\n [\"fib-spiral\", \"other\"],\n [\"fib-circles\", \"other\"],\n [\"fib-trend-time\", \"other\"],\n [\"gann-box\", \"other\"],\n [\"gann-square-fixed\", \"other\"],\n [\"gann-square\", \"other\"],\n [\"gann-fan\", \"other\"],\n [\"pitchfork\", \"polylines\"],\n [\"pitchfan\", \"polylines\"],\n [\"xabcd-pattern\", \"polylines\"],\n [\"cypher-pattern\", \"polylines\"],\n [\"head-and-shoulders\", \"polylines\"],\n [\"abcd-pattern\", \"polylines\"],\n [\"triangle-pattern\", \"polylines\"],\n [\"three-drives-pattern\", \"polylines\"],\n [\"elliott-impulse-wave\", \"polylines\"],\n [\"elliott-correction-wave\", \"polylines\"],\n [\"elliott-triangle-wave\", \"polylines\"],\n [\"elliott-double-combo\", \"polylines\"],\n [\"elliott-triple-combo\", \"polylines\"],\n [\"cyclic-lines\", \"other\"],\n [\"time-cycles\", \"other\"],\n [\"sine-line\", \"other\"],\n [\"group\", \"other\"],\n [\"frame\", \"other\"],\n [\"table\", \"other\"],\n]);\n\n/**\n * Return the {@link DrawingBucket} for a given {@link DrawingKind}.\n * Throws if the kind is not in the map — covers the defensive branch\n * for callers that pass an unverified string (e.g. a future kind\n * round-tripped from the wire before its bucket entry lands).\n *\n * @formula bucket = KIND_BUCKET.get(kind)\n * @anchors kind: DrawingKind → bucket: \"lines\"|\"labels\"|\"boxes\"|\"polylines\"|\"other\"\n * @since 0.3\n * @stable\n * @example\n * import { bucketFor } from \"@invinite-org/chartlang-core\";\n * const bucket = bucketFor(\"rectangle\"); // \"boxes\"\n * void bucket;\n */\nexport function bucketFor(kind: DrawingKind): DrawingBucket {\n const bucket = KIND_BUCKET.get(kind);\n if (bucket === undefined) {\n throw new Error(`No bucket assigned for drawing kind '${kind}'`);\n }\n return bucket;\n}\n"]}
|
package/dist/draw/draw.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Price, Time } from "../types.js";
|
|
2
|
-
import type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts } from "./drawingStyle.js";
|
|
2
|
+
import type { ArrowMarkerOpts, ArrowOpts, BrushStyle, FibOpts, FillBetweenStyle, FrameOpts, HighlighterStyle, LineDrawStyle, PathOpts, RegressionTrendOpts, ShapeStyle, TextOpts } from "./drawingStyle.js";
|
|
3
3
|
import type { DrawingHandle } from "./handle.js";
|
|
4
4
|
import type { TableOpts } from "./table.js";
|
|
5
5
|
import type { AnchorHept, AnchorQuad, AnchorQuint, AnchorTriple, WorldPoint } from "./worldPoint.js";
|
|
@@ -47,6 +47,13 @@ export type DrawNamespace = {
|
|
|
47
47
|
circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;
|
|
48
48
|
ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;
|
|
49
49
|
path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;
|
|
50
|
+
/**
|
|
51
|
+
* Fill the ribbon between two edges. Each edge is a list of world
|
|
52
|
+
* anchors; the filled region is the closed polygon `edgeA` forward
|
|
53
|
+
* then `edgeB` reversed. The native equivalent of Pine
|
|
54
|
+
* `linefill.new(line1, line2, color)` / `fill(plot1, plot2)`.
|
|
55
|
+
*/
|
|
56
|
+
fillBetween(edgeA: ReadonlyArray<WorldPoint>, edgeB: ReadonlyArray<WorldPoint>, opts?: FillBetweenStyle): DrawingHandle;
|
|
50
57
|
marker(anchor: WorldPoint, opts?: TextOpts & {
|
|
51
58
|
readonly text?: string;
|
|
52
59
|
readonly value?: number;
|
package/dist/draw/draw.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EACR,eAAe,EACf,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACb,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,aAAa,GAAG;IAExB,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IACxE,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAClE,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,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EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAC9E,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;IAE5E,KAAK,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;IAC5D,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAErE,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,aAAa,CAAC;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,IAAI,EAAE,aAAgC,CAAC"}
|
package/dist/draw/draw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.js","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAiJ/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,cAAc,EAAE,CAAC;AAEpD,SAAS,cAAc;IACnB,MAAM,OAAO,GAAgC;QACzC,GAAG,CAAC,OAAO,EAAE,QAAQ;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { DrawingHandle } from \"./handle.js\";\nimport type { TableOpts } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * The script-facing `draw.*` namespace. Each method is stateful across\n * calls — the compiler injects a callsite slot id so the runtime can\n * track the per-handle `DrawingState` across bars — and returns a\n * {@link DrawingHandle}. Adapters that omit a kind degrade silently\n * with `unsupported-drawing-kind`; excess emissions\n * drop with `drawing-budget-exceeded` once the per-script bucket is\n * full.\n *\n * Every kind lives as a FLAT method directly on `DrawNamespace` —\n * script authors call `draw.fibRetracement(a, b)` /\n * `draw.gannBox(a, b)` / `draw.elliottImpulseWave(anchors)` /\n * `draw.xabcdPattern(anchors)`, matching the flat camelCase names in\n * `STATEFUL_PRIMITIVES` and Pine + invinite parity. The wire format\n * keeps the kebab-case `DrawingKind`.\n *\n * Phase-3 implementations live in `@invinite-org/chartlang-runtime`;\n * this file ships the script-author type plus a throwing-stub `draw`\n * value (mirrors `plot/plot.ts:plot`). Tasks 5–18 land the runtime\n * impl per category.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import type { DrawNamespace } from \"@invinite-org/chartlang-core\";\n * const _ns: DrawNamespace | null = null;\n * void _ns;\n */\nexport type DrawNamespace = {\n // Lines / Rays (Task 5)\n line(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n horizontalLine(price: Price, opts?: LineDrawStyle): DrawingHandle;\n horizontalRay(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n verticalLine(time: Time, opts?: LineDrawStyle): DrawingHandle;\n crossLine(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n trendAngle(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Boxes A (Task 6)\n rectangle(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n rotatedRectangle(anchors: AnchorQuad, opts?: ShapeStyle): DrawingHandle;\n triangle(anchors: AnchorTriple, opts?: ShapeStyle): DrawingHandle;\n polyline(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n // Boxes B (Task 7)\n circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;\n marker(\n anchor: WorldPoint,\n opts?: TextOpts & { readonly text?: string; readonly value?: number },\n ): DrawingHandle;\n // Curves (Task 8)\n arc(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n curve(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n doubleCurve(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n // Freehand (Task 8)\n pen(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n highlighter(anchors: ReadonlyArray<WorldPoint>, opts: HighlighterStyle): DrawingHandle;\n brush(anchors: ReadonlyArray<WorldPoint>, opts: BrushStyle): DrawingHandle;\n // Annotations (Task 9)\n text(anchor: WorldPoint, body: string, opts?: TextOpts): DrawingHandle;\n arrow(a: WorldPoint, b: WorldPoint, opts?: ArrowOpts): DrawingHandle;\n arrowMarker(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkUp(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkDown(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n // Channels (Task 10)\n trendChannel(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n flatTopBottom(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n disjointChannel(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n regressionTrend(a: WorldPoint, b: WorldPoint, opts?: RegressionTrendOpts): DrawingHandle;\n // Fibonacci A (Task 11)\n fibRetracement(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendExtension(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibChannel(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibTimeZone(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibWedge(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Fibonacci B (Task 12)\n fibSpeedFan(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpeedArcs(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpiral(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibCircles(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendTime(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Gann (Task 13)\n gannBox(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquareFixed(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquare(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannFan(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Pitchforks (Task 14)\n pitchfork(\n anchors: AnchorTriple,\n opts?: LineDrawStyle & {\n readonly variant?: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n },\n ): DrawingHandle;\n pitchfan(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n // Harmonic Patterns (Task 15)\n xabcdPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n cypherPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n headAndShoulders(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n abcdPattern(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n trianglePattern(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n threeDrivesPattern(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Elliott Waves (Task 16)\n elliottImpulseWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottCorrectionWave(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n elliottTriangleWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottDoubleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n elliottTripleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Cycles (Task 17)\n cyclicLines(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n timeCycles(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n sineLine(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Containers (Task 18)\n group(childHandleIds: ReadonlyArray<string>): DrawingHandle;\n frame(a: WorldPoint, b: WorldPoint, opts?: FrameOpts): DrawingHandle;\n // Viewport overlays (Phase 5)\n table(opts: TableOpts): DrawingHandle;\n};\n\n/**\n * Compile-time callable hole for the `draw.*` namespace. Every `get`\n * on the proxy returns a function that throws the\n * `\"draw.<method> called outside compiled runtime\"` sentinel — same\n * convention as the `plot` / `hline` / `alert` stubs in\n * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this\n * stub for the real namespace at boot per the\n * `@invinite-org/chartlang-runtime` `primitives.ts` seam.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import { draw } from \"@invinite-org/chartlang-core\";\n * try {\n * draw.horizontalLine(0);\n * } catch {\n * // expected: \"draw.horizontalLine called outside compiled runtime\"\n * }\n */\nexport const draw: DrawNamespace = createDrawStub();\n\nfunction createDrawStub(): DrawNamespace {\n const handler: ProxyHandler<DrawNamespace> = {\n get(_target, property): unknown {\n const name = String(property);\n return throwingMethod(`draw.${name}`);\n },\n };\n return new Proxy({} as DrawNamespace, handler);\n}\n\nfunction throwingMethod(qualified: string): () => never {\n return (): never => {\n throw new Error(`${qualified} called outside compiled runtime`);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"draw.js","sourceRoot":"","sources":["../../src/draw/draw.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA6J/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAkB,cAAc,EAAE,CAAC;AAEpD,SAAS,cAAc;IACnB,MAAM,OAAO,GAAgC;QACzC,GAAG,CAAC,OAAO,EAAE,QAAQ;YACjB,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;KACJ,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,EAAmB,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,SAAiB;IACrC,OAAO,GAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\nimport type { Price, Time } from \"../types.js\";\nimport type {\n ArrowMarkerOpts,\n ArrowOpts,\n BrushStyle,\n FibOpts,\n FillBetweenStyle,\n FrameOpts,\n HighlighterStyle,\n LineDrawStyle,\n PathOpts,\n RegressionTrendOpts,\n ShapeStyle,\n TextOpts,\n} from \"./drawingStyle.js\";\nimport type { DrawingHandle } from \"./handle.js\";\nimport type { TableOpts } from \"./table.js\";\nimport type {\n AnchorHept,\n AnchorQuad,\n AnchorQuint,\n AnchorTriple,\n WorldPoint,\n} from \"./worldPoint.js\";\n\n/**\n * The script-facing `draw.*` namespace. Each method is stateful across\n * calls — the compiler injects a callsite slot id so the runtime can\n * track the per-handle `DrawingState` across bars — and returns a\n * {@link DrawingHandle}. Adapters that omit a kind degrade silently\n * with `unsupported-drawing-kind`; excess emissions\n * drop with `drawing-budget-exceeded` once the per-script bucket is\n * full.\n *\n * Every kind lives as a FLAT method directly on `DrawNamespace` —\n * script authors call `draw.fibRetracement(a, b)` /\n * `draw.gannBox(a, b)` / `draw.elliottImpulseWave(anchors)` /\n * `draw.xabcdPattern(anchors)`, matching the flat camelCase names in\n * `STATEFUL_PRIMITIVES` and Pine + invinite parity. The wire format\n * keeps the kebab-case `DrawingKind`.\n *\n * Phase-3 implementations live in `@invinite-org/chartlang-runtime`;\n * this file ships the script-author type plus a throwing-stub `draw`\n * value (mirrors `plot/plot.ts:plot`). Tasks 5–18 land the runtime\n * impl per category.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import type { DrawNamespace } from \"@invinite-org/chartlang-core\";\n * const _ns: DrawNamespace | null = null;\n * void _ns;\n */\nexport type DrawNamespace = {\n // Lines / Rays (Task 5)\n line(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n horizontalLine(price: Price, opts?: LineDrawStyle): DrawingHandle;\n horizontalRay(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n verticalLine(time: Time, opts?: LineDrawStyle): DrawingHandle;\n crossLine(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n trendAngle(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Boxes A (Task 6)\n rectangle(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n rotatedRectangle(anchors: AnchorQuad, opts?: ShapeStyle): DrawingHandle;\n triangle(anchors: AnchorTriple, opts?: ShapeStyle): DrawingHandle;\n polyline(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n // Boxes B (Task 7)\n circle(centre: WorldPoint, radiusAnchor: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n ellipse(a: WorldPoint, b: WorldPoint, opts?: ShapeStyle): DrawingHandle;\n path(anchors: ReadonlyArray<WorldPoint>, opts?: PathOpts): DrawingHandle;\n /**\n * Fill the ribbon between two edges. Each edge is a list of world\n * anchors; the filled region is the closed polygon `edgeA` forward\n * then `edgeB` reversed. The native equivalent of Pine\n * `linefill.new(line1, line2, color)` / `fill(plot1, plot2)`.\n */\n fillBetween(\n edgeA: ReadonlyArray<WorldPoint>,\n edgeB: ReadonlyArray<WorldPoint>,\n opts?: FillBetweenStyle,\n ): DrawingHandle;\n marker(\n anchor: WorldPoint,\n opts?: TextOpts & { readonly text?: string; readonly value?: number },\n ): DrawingHandle;\n // Curves (Task 8)\n arc(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n curve(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n doubleCurve(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n // Freehand (Task 8)\n pen(anchors: ReadonlyArray<WorldPoint>, opts?: LineDrawStyle): DrawingHandle;\n highlighter(anchors: ReadonlyArray<WorldPoint>, opts: HighlighterStyle): DrawingHandle;\n brush(anchors: ReadonlyArray<WorldPoint>, opts: BrushStyle): DrawingHandle;\n // Annotations (Task 9)\n text(anchor: WorldPoint, body: string, opts?: TextOpts): DrawingHandle;\n arrow(a: WorldPoint, b: WorldPoint, opts?: ArrowOpts): DrawingHandle;\n arrowMarker(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkUp(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n arrowMarkDown(anchor: WorldPoint, opts?: ArrowMarkerOpts): DrawingHandle;\n // Channels (Task 10)\n trendChannel(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n flatTopBottom(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n disjointChannel(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n regressionTrend(a: WorldPoint, b: WorldPoint, opts?: RegressionTrendOpts): DrawingHandle;\n // Fibonacci A (Task 11)\n fibRetracement(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendExtension(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibChannel(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n fibTimeZone(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibWedge(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Fibonacci B (Task 12)\n fibSpeedFan(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpeedArcs(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibSpiral(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibCircles(a: WorldPoint, b: WorldPoint, opts?: FibOpts): DrawingHandle;\n fibTrendTime(anchors: AnchorTriple, opts?: FibOpts): DrawingHandle;\n // Gann (Task 13)\n gannBox(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquareFixed(anchor: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannSquare(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n gannFan(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Pitchforks (Task 14)\n pitchfork(\n anchors: AnchorTriple,\n opts?: LineDrawStyle & {\n readonly variant?: \"standard\" | \"schiff\" | \"modifiedSchiff\" | \"inside\";\n },\n ): DrawingHandle;\n pitchfan(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n // Harmonic Patterns (Task 15)\n xabcdPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n cypherPattern(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n headAndShoulders(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n abcdPattern(anchors: AnchorQuad, opts?: LineDrawStyle): DrawingHandle;\n trianglePattern(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n threeDrivesPattern(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Elliott Waves (Task 16)\n elliottImpulseWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottCorrectionWave(anchors: AnchorTriple, opts?: LineDrawStyle): DrawingHandle;\n elliottTriangleWave(anchors: AnchorQuint, opts?: LineDrawStyle): DrawingHandle;\n elliottDoubleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n elliottTripleCombo(anchors: AnchorHept, opts?: LineDrawStyle): DrawingHandle;\n // Cycles (Task 17)\n cyclicLines(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n timeCycles(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n sineLine(a: WorldPoint, b: WorldPoint, opts?: LineDrawStyle): DrawingHandle;\n // Containers (Task 18)\n group(childHandleIds: ReadonlyArray<string>): DrawingHandle;\n frame(a: WorldPoint, b: WorldPoint, opts?: FrameOpts): DrawingHandle;\n // Viewport overlays (Phase 5)\n table(opts: TableOpts): DrawingHandle;\n};\n\n/**\n * Compile-time callable hole for the `draw.*` namespace. Every `get`\n * on the proxy returns a function that throws the\n * `\"draw.<method> called outside compiled runtime\"` sentinel — same\n * convention as the `plot` / `hline` / `alert` stubs in\n * `plot/plot.ts:plot` / `alert/alert.ts:alert`. The runtime swaps this\n * stub for the real namespace at boot per the\n * `@invinite-org/chartlang-runtime` `primitives.ts` seam.\n *\n * @formula N/A — namespace surface; per-method runtime impl in Tasks 5–18\n * @anchors per-method — see the per-kind state shapes in `drawingState.ts`\n * @since 0.3\n * @stable\n * @example\n * import { draw } from \"@invinite-org/chartlang-core\";\n * try {\n * draw.horizontalLine(0);\n * } catch {\n * // expected: \"draw.horizontalLine called outside compiled runtime\"\n * }\n */\nexport const draw: DrawNamespace = createDrawStub();\n\nfunction createDrawStub(): DrawNamespace {\n const handler: ProxyHandler<DrawNamespace> = {\n get(_target, property): unknown {\n const name = String(property);\n return throwingMethod(`draw.${name}`);\n },\n };\n return new Proxy({} as DrawNamespace, handler);\n}\n\nfunction throwingMethod(qualified: string): () => never {\n return (): never => {\n throw new Error(`${qualified} called outside compiled runtime`);\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The full set of
|
|
2
|
+
* The full set of 63 drawing kinds chartlang supports through `draw.*`.
|
|
3
3
|
* The wire format is kebab-case; the TypeScript script surface is
|
|
4
4
|
* camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for
|
|
5
5
|
* the canonical bijection.
|
|
@@ -14,28 +14,28 @@
|
|
|
14
14
|
* - `cypher-pattern` has no standalone tool — emittable only through
|
|
15
15
|
* `defineDrawing` (Task 20).
|
|
16
16
|
*
|
|
17
|
-
* Order pinned: lines (6) → boxes (
|
|
17
|
+
* Order pinned: lines (6) → boxes (9) → curves (3) → freehand (3) →
|
|
18
18
|
* annotations (5) → channels (4) → fib (10) → gann (4) → pitchforks (2)
|
|
19
19
|
* → patterns (6) → elliott (5) → cycles (3) → containers (2) → viewport
|
|
20
|
-
* overlays (1) =
|
|
20
|
+
* overlays (1) = 63. The order is wire-stable — downstream consumers iterate
|
|
21
21
|
* {@link DRAWING_KINDS} in this order for diagnostic readability.
|
|
22
22
|
*
|
|
23
23
|
* @formula N/A — discriminator constant set
|
|
24
|
-
* @anchors
|
|
24
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
25
25
|
* @since 0.3
|
|
26
26
|
* @stable
|
|
27
27
|
* @example
|
|
28
28
|
* const k: DrawingKind = "fib-retracement";
|
|
29
29
|
* void k;
|
|
30
30
|
*/
|
|
31
|
-
export type DrawingKind = "line" | "horizontal-line" | "horizontal-ray" | "vertical-line" | "cross-line" | "trend-angle" | "rectangle" | "rotated-rectangle" | "triangle" | "polyline" | "circle" | "ellipse" | "path" | "marker" | "arc" | "curve" | "double-curve" | "pen" | "highlighter" | "brush" | "text" | "arrow" | "arrow-marker" | "arrow-mark-up" | "arrow-mark-down" | "trend-channel" | "flat-top-bottom" | "disjoint-channel" | "regression-trend" | "fib-retracement" | "fib-trend-extension" | "fib-channel" | "fib-time-zone" | "fib-wedge" | "fib-speed-fan" | "fib-speed-arcs" | "fib-spiral" | "fib-circles" | "fib-trend-time" | "gann-box" | "gann-square-fixed" | "gann-square" | "gann-fan" | "pitchfork" | "pitchfan" | "xabcd-pattern" | "cypher-pattern" | "head-and-shoulders" | "abcd-pattern" | "triangle-pattern" | "three-drives-pattern" | "elliott-impulse-wave" | "elliott-correction-wave" | "elliott-triangle-wave" | "elliott-double-combo" | "elliott-triple-combo" | "cyclic-lines" | "time-cycles" | "sine-line" | "group" | "frame" | "table";
|
|
31
|
+
export type DrawingKind = "line" | "horizontal-line" | "horizontal-ray" | "vertical-line" | "cross-line" | "trend-angle" | "rectangle" | "rotated-rectangle" | "triangle" | "polyline" | "circle" | "ellipse" | "path" | "fill-between" | "marker" | "arc" | "curve" | "double-curve" | "pen" | "highlighter" | "brush" | "text" | "arrow" | "arrow-marker" | "arrow-mark-up" | "arrow-mark-down" | "trend-channel" | "flat-top-bottom" | "disjoint-channel" | "regression-trend" | "fib-retracement" | "fib-trend-extension" | "fib-channel" | "fib-time-zone" | "fib-wedge" | "fib-speed-fan" | "fib-speed-arcs" | "fib-spiral" | "fib-circles" | "fib-trend-time" | "gann-box" | "gann-square-fixed" | "gann-square" | "gann-fan" | "pitchfork" | "pitchfan" | "xabcd-pattern" | "cypher-pattern" | "head-and-shoulders" | "abcd-pattern" | "triangle-pattern" | "three-drives-pattern" | "elliott-impulse-wave" | "elliott-correction-wave" | "elliott-triangle-wave" | "elliott-double-combo" | "elliott-triple-combo" | "cyclic-lines" | "time-cycles" | "sine-line" | "group" | "frame" | "table";
|
|
32
32
|
/**
|
|
33
33
|
* Iterable form of {@link DrawingKind}. Order matches the type
|
|
34
34
|
* declaration so docs / validators / dispatchers can walk the set in a
|
|
35
35
|
* single canonical order. Frozen.
|
|
36
36
|
*
|
|
37
37
|
* @formula N/A — discriminator constant set
|
|
38
|
-
* @anchors
|
|
38
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
39
39
|
* @since 0.3
|
|
40
40
|
* @stable
|
|
41
41
|
* @example
|
|
@@ -53,7 +53,7 @@ export declare const DRAWING_KINDS: ReadonlyArray<DrawingKind>;
|
|
|
53
53
|
* {@link KIND_KEBABCASE}.
|
|
54
54
|
*
|
|
55
55
|
* @formula N/A — discriminator constant set
|
|
56
|
-
* @anchors
|
|
56
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
57
57
|
* @since 0.3
|
|
58
58
|
* @stable
|
|
59
59
|
* @example
|
|
@@ -68,7 +68,7 @@ export declare const KIND_CAMELCASE: ReadonlyMap<DrawingKind, string>;
|
|
|
68
68
|
* two maps cannot drift.
|
|
69
69
|
*
|
|
70
70
|
* @formula N/A — discriminator constant set
|
|
71
|
-
* @anchors
|
|
71
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
72
72
|
* @since 0.3
|
|
73
73
|
* @stable
|
|
74
74
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawingKind.d.ts","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,WAAW,GAEjB,MAAM,GACN,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,YAAY,GACZ,aAAa,GAEb,WAAW,GACX,mBAAmB,GACnB,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,MAAM,GACN,QAAQ,GAER,KAAK,GACL,OAAO,GACP,cAAc,GAEd,KAAK,GACL,aAAa,GACb,OAAO,GAEP,MAAM,GACN,OAAO,GACP,cAAc,GACd,eAAe,GACf,iBAAiB,GAEjB,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAElB,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,GACb,eAAe,GACf,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAEhB,UAAU,GACV,mBAAmB,GACnB,aAAa,GACb,UAAU,GAEV,WAAW,GACX,UAAU,GAEV,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,cAAc,GACd,kBAAkB,GAClB,sBAAsB,GAEtB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GAEtB,cAAc,GACd,aAAa,GACb,WAAW,GAEX,OAAO,GACP,OAAO,GAEP,OAAO,CAAC;AAEd;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"drawingKind.d.ts","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,WAAW,GAEjB,MAAM,GACN,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,YAAY,GACZ,aAAa,GAEb,WAAW,GACX,mBAAmB,GACnB,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,MAAM,GACN,cAAc,GACd,QAAQ,GAER,KAAK,GACL,OAAO,GACP,cAAc,GAEd,KAAK,GACL,aAAa,GACb,OAAO,GAEP,MAAM,GACN,OAAO,GACP,cAAc,GACd,eAAe,GACf,iBAAiB,GAEjB,eAAe,GACf,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAElB,iBAAiB,GACjB,qBAAqB,GACrB,aAAa,GACb,eAAe,GACf,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,YAAY,GACZ,aAAa,GACb,gBAAgB,GAEhB,UAAU,GACV,mBAAmB,GACnB,aAAa,GACb,UAAU,GAEV,WAAW,GACX,UAAU,GAEV,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,cAAc,GACd,kBAAkB,GAClB,sBAAsB,GAEtB,sBAAsB,GACtB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GAEtB,cAAc,GACd,aAAa,GACb,WAAW,GAEX,OAAO,GACP,OAAO,GAEP,OAAO,CAAC;AAEd;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,WAAW,CAgEL,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,WAAW,EAAE,MAAM,CAgE1D,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE3D,CAAC"}
|
package/dist/draw/drawingKind.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* single canonical order. Frozen.
|
|
7
7
|
*
|
|
8
8
|
* @formula N/A — discriminator constant set
|
|
9
|
-
* @anchors
|
|
9
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
10
10
|
* @since 0.3
|
|
11
11
|
* @stable
|
|
12
12
|
* @example
|
|
@@ -29,6 +29,7 @@ export const DRAWING_KINDS = Object.freeze([
|
|
|
29
29
|
"circle",
|
|
30
30
|
"ellipse",
|
|
31
31
|
"path",
|
|
32
|
+
"fill-between",
|
|
32
33
|
"marker",
|
|
33
34
|
"arc",
|
|
34
35
|
"curve",
|
|
@@ -87,7 +88,7 @@ export const DRAWING_KINDS = Object.freeze([
|
|
|
87
88
|
* {@link KIND_KEBABCASE}.
|
|
88
89
|
*
|
|
89
90
|
* @formula N/A — discriminator constant set
|
|
90
|
-
* @anchors
|
|
91
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
91
92
|
* @since 0.3
|
|
92
93
|
* @stable
|
|
93
94
|
* @example
|
|
@@ -109,6 +110,7 @@ export const KIND_CAMELCASE = new Map([
|
|
|
109
110
|
["circle", "circle"],
|
|
110
111
|
["ellipse", "ellipse"],
|
|
111
112
|
["path", "path"],
|
|
113
|
+
["fill-between", "fillBetween"],
|
|
112
114
|
["marker", "marker"],
|
|
113
115
|
["arc", "arc"],
|
|
114
116
|
["curve", "curve"],
|
|
@@ -165,7 +167,7 @@ export const KIND_CAMELCASE = new Map([
|
|
|
165
167
|
* two maps cannot drift.
|
|
166
168
|
*
|
|
167
169
|
* @formula N/A — discriminator constant set
|
|
168
|
-
* @anchors
|
|
170
|
+
* @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}
|
|
169
171
|
* @since 0.3
|
|
170
172
|
* @stable
|
|
171
173
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawingKind.js","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA8G/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,MAAM,CAAC,MAAM,CAAC;IACnE,MAAM;IACN,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;IAC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AoB,EAAE,kBAAkB,CAAC;IAC1C,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IACvC,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,yBAAyB,EAAE,uBAAuB,CAAC;IACpD,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;IAChD,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,sBAAsB,EAAE,oBAAoB,CAAC;IAC9C,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,WAAW,EAAE,UAAU,CAAC;IACzB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,OAAO,EAAE,OAAO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,GAAG,CACnE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CACjE,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * The full set of 62 drawing kinds chartlang supports through `draw.*`.\n * The wire format is kebab-case; the TypeScript script surface is\n * camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for\n * the canonical bijection.\n *\n * Variant collapses:\n *\n * - `ray` / `extended-line` collapse into `line` with `extendLeft` /\n * `extendRight` flags on the state.\n * - The 4 invinite pitchfork tools (`standard` / `schiff` /\n * `modifiedSchiff` / `inside`) collapse into `pitchfork` with a\n * `variant` discriminator on the state.\n * - `cypher-pattern` has no standalone tool — emittable only through\n * `defineDrawing` (Task 20).\n *\n * Order pinned: lines (6) → boxes (8) → curves (3) → freehand (3) →\n * annotations (5) → channels (4) → fib (10) → gann (4) → pitchforks (2)\n * → patterns (6) → elliott (5) → cycles (3) → containers (2) → viewport\n * overlays (1) = 62. The order is wire-stable — downstream consumers iterate\n * {@link DRAWING_KINDS} in this order for diagnostic readability.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * const k: DrawingKind = \"fib-retracement\";\n * void k;\n */\nexport type DrawingKind =\n // Lines / Rays (6)\n | \"line\"\n | \"horizontal-line\"\n | \"horizontal-ray\"\n | \"vertical-line\"\n | \"cross-line\"\n | \"trend-angle\"\n // Boxes / Shapes (8)\n | \"rectangle\"\n | \"rotated-rectangle\"\n | \"triangle\"\n | \"polyline\"\n | \"circle\"\n | \"ellipse\"\n | \"path\"\n | \"marker\"\n // Curves (3)\n | \"arc\"\n | \"curve\"\n | \"double-curve\"\n // Freehand (3)\n | \"pen\"\n | \"highlighter\"\n | \"brush\"\n // Annotations (5)\n | \"text\"\n | \"arrow\"\n | \"arrow-marker\"\n | \"arrow-mark-up\"\n | \"arrow-mark-down\"\n // Channels (4)\n | \"trend-channel\"\n | \"flat-top-bottom\"\n | \"disjoint-channel\"\n | \"regression-trend\"\n // Fibonacci (10)\n | \"fib-retracement\"\n | \"fib-trend-extension\"\n | \"fib-channel\"\n | \"fib-time-zone\"\n | \"fib-wedge\"\n | \"fib-speed-fan\"\n | \"fib-speed-arcs\"\n | \"fib-spiral\"\n | \"fib-circles\"\n | \"fib-trend-time\"\n // Gann (4)\n | \"gann-box\"\n | \"gann-square-fixed\"\n | \"gann-square\"\n | \"gann-fan\"\n // Pitchforks (2)\n | \"pitchfork\"\n | \"pitchfan\"\n // Harmonic Patterns (6)\n | \"xabcd-pattern\"\n | \"cypher-pattern\"\n | \"head-and-shoulders\"\n | \"abcd-pattern\"\n | \"triangle-pattern\"\n | \"three-drives-pattern\"\n // Elliott Waves (5)\n | \"elliott-impulse-wave\"\n | \"elliott-correction-wave\"\n | \"elliott-triangle-wave\"\n | \"elliott-double-combo\"\n | \"elliott-triple-combo\"\n // Cycles (3)\n | \"cyclic-lines\"\n | \"time-cycles\"\n | \"sine-line\"\n // Containers (2)\n | \"group\"\n | \"frame\"\n // Viewport overlays (1)\n | \"table\";\n\n/**\n * Iterable form of {@link DrawingKind}. Order matches the type\n * declaration so docs / validators / dispatchers can walk the set in a\n * single canonical order. Frozen.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { DRAWING_KINDS } from \"@invinite-org/chartlang-core\";\n * for (const k of DRAWING_KINDS) {\n * void k;\n * }\n */\nexport const DRAWING_KINDS: ReadonlyArray<DrawingKind> = Object.freeze([\n \"line\",\n \"horizontal-line\",\n \"horizontal-ray\",\n \"vertical-line\",\n \"cross-line\",\n \"trend-angle\",\n \"rectangle\",\n \"rotated-rectangle\",\n \"triangle\",\n \"polyline\",\n \"circle\",\n \"ellipse\",\n \"path\",\n \"marker\",\n \"arc\",\n \"curve\",\n \"double-curve\",\n \"pen\",\n \"highlighter\",\n \"brush\",\n \"text\",\n \"arrow\",\n \"arrow-marker\",\n \"arrow-mark-up\",\n \"arrow-mark-down\",\n \"trend-channel\",\n \"flat-top-bottom\",\n \"disjoint-channel\",\n \"regression-trend\",\n \"fib-retracement\",\n \"fib-trend-extension\",\n \"fib-channel\",\n \"fib-time-zone\",\n \"fib-wedge\",\n \"fib-speed-fan\",\n \"fib-speed-arcs\",\n \"fib-spiral\",\n \"fib-circles\",\n \"fib-trend-time\",\n \"gann-box\",\n \"gann-square-fixed\",\n \"gann-square\",\n \"gann-fan\",\n \"pitchfork\",\n \"pitchfan\",\n \"xabcd-pattern\",\n \"cypher-pattern\",\n \"head-and-shoulders\",\n \"abcd-pattern\",\n \"triangle-pattern\",\n \"three-drives-pattern\",\n \"elliott-impulse-wave\",\n \"elliott-correction-wave\",\n \"elliott-triangle-wave\",\n \"elliott-double-combo\",\n \"elliott-triple-combo\",\n \"cyclic-lines\",\n \"time-cycles\",\n \"sine-line\",\n \"group\",\n \"frame\",\n \"table\",\n] as const satisfies ReadonlyArray<DrawingKind>);\n\n/**\n * camelCase TypeScript-surface name for every kind. Used by the editor\n * + gen-docs + the compiler's `STATEFUL_PRIMITIVES` lookup so a script\n * author writes `draw.horizontalLine(...)` while the wire format stays\n * kebab-case (`horizontal-line`). The bijection round-trips through\n * {@link KIND_KEBABCASE}.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_CAMELCASE } from \"@invinite-org/chartlang-core\";\n * const camel = KIND_CAMELCASE.get(\"horizontal-line\"); // \"horizontalLine\"\n * void camel;\n */\nexport const KIND_CAMELCASE: ReadonlyMap<DrawingKind, string> = new Map<DrawingKind, string>([\n [\"line\", \"line\"],\n [\"horizontal-line\", \"horizontalLine\"],\n [\"horizontal-ray\", \"horizontalRay\"],\n [\"vertical-line\", \"verticalLine\"],\n [\"cross-line\", \"crossLine\"],\n [\"trend-angle\", \"trendAngle\"],\n [\"rectangle\", \"rectangle\"],\n [\"rotated-rectangle\", \"rotatedRectangle\"],\n [\"triangle\", \"triangle\"],\n [\"polyline\", \"polyline\"],\n [\"circle\", \"circle\"],\n [\"ellipse\", \"ellipse\"],\n [\"path\", \"path\"],\n [\"marker\", \"marker\"],\n [\"arc\", \"arc\"],\n [\"curve\", \"curve\"],\n [\"double-curve\", \"doubleCurve\"],\n [\"pen\", \"pen\"],\n [\"highlighter\", \"highlighter\"],\n [\"brush\", \"brush\"],\n [\"text\", \"text\"],\n [\"arrow\", \"arrow\"],\n [\"arrow-marker\", \"arrowMarker\"],\n [\"arrow-mark-up\", \"arrowMarkUp\"],\n [\"arrow-mark-down\", \"arrowMarkDown\"],\n [\"trend-channel\", \"trendChannel\"],\n [\"flat-top-bottom\", \"flatTopBottom\"],\n [\"disjoint-channel\", \"disjointChannel\"],\n [\"regression-trend\", \"regressionTrend\"],\n [\"fib-retracement\", \"fibRetracement\"],\n [\"fib-trend-extension\", \"fibTrendExtension\"],\n [\"fib-channel\", \"fibChannel\"],\n [\"fib-time-zone\", \"fibTimeZone\"],\n [\"fib-wedge\", \"fibWedge\"],\n [\"fib-speed-fan\", \"fibSpeedFan\"],\n [\"fib-speed-arcs\", \"fibSpeedArcs\"],\n [\"fib-spiral\", \"fibSpiral\"],\n [\"fib-circles\", \"fibCircles\"],\n [\"fib-trend-time\", \"fibTrendTime\"],\n [\"gann-box\", \"gannBox\"],\n [\"gann-square-fixed\", \"gannSquareFixed\"],\n [\"gann-square\", \"gannSquare\"],\n [\"gann-fan\", \"gannFan\"],\n [\"pitchfork\", \"pitchfork\"],\n [\"pitchfan\", \"pitchfan\"],\n [\"xabcd-pattern\", \"xabcdPattern\"],\n [\"cypher-pattern\", \"cypherPattern\"],\n [\"head-and-shoulders\", \"headAndShoulders\"],\n [\"abcd-pattern\", \"abcdPattern\"],\n [\"triangle-pattern\", \"trianglePattern\"],\n [\"three-drives-pattern\", \"threeDrivesPattern\"],\n [\"elliott-impulse-wave\", \"elliottImpulseWave\"],\n [\"elliott-correction-wave\", \"elliottCorrectionWave\"],\n [\"elliott-triangle-wave\", \"elliottTriangleWave\"],\n [\"elliott-double-combo\", \"elliottDoubleCombo\"],\n [\"elliott-triple-combo\", \"elliottTripleCombo\"],\n [\"cyclic-lines\", \"cyclicLines\"],\n [\"time-cycles\", \"timeCycles\"],\n [\"sine-line\", \"sineLine\"],\n [\"group\", \"group\"],\n [\"frame\", \"frame\"],\n [\"table\", \"table\"],\n]);\n\n/**\n * Inverse of {@link KIND_CAMELCASE} — camelCase TypeScript surface\n * name → kebab-case wire kind. Derived from `KIND_CAMELCASE` so the\n * two maps cannot drift.\n *\n * @formula N/A — discriminator constant set\n * @anchors 62 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_KEBABCASE } from \"@invinite-org/chartlang-core\";\n * const kebab = KIND_KEBABCASE.get(\"horizontalLine\"); // \"horizontal-line\"\n * void kebab;\n */\nexport const KIND_KEBABCASE: ReadonlyMap<string, DrawingKind> = new Map<string, DrawingKind>(\n Array.from(KIND_CAMELCASE, ([kebab, camel]) => [camel, kebab]),\n);\n"]}
|
|
1
|
+
{"version":3,"file":"drawingKind.js","sourceRoot":"","sources":["../../src/draw/drawingKind.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AA+G/D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B,MAAM,CAAC,MAAM,CAAC;IACnE,MAAM;IACN,iBAAiB;IACjB,gBAAgB;IAChB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,UAAU;IACV,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,cAAc;IACd,QAAQ;IACR,KAAK;IACL,OAAO;IACP,cAAc;IACd,KAAK;IACL,aAAa;IACb,OAAO;IACP,MAAM;IACN,OAAO;IACP,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;IACrB,aAAa;IACb,eAAe;IACf,WAAW;IACX,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,UAAU;IACV,mBAAmB;IACnB,aAAa;IACb,UAAU;IACV,WAAW;IACX,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,kBAAkB;IAClB,sBAAsB;IACtB,sBAAsB;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;IACtB,sBAAsB;IACtB,cAAc;IACd,aAAa;IACb,WAAW;IACX,OAAO;IACP,OAAO;IACP,OAAO;CACoC,CAAC,CAAC;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AO,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqC,IAAI,GAAG,CACnE,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CACjE,CAAC","sourcesContent":["// Copyright (c) 2026 Invinite. Licensed under the MIT License.\n// See the LICENSE file in the repo root for full license text.\n\n/**\n * The full set of 63 drawing kinds chartlang supports through `draw.*`.\n * The wire format is kebab-case; the TypeScript script surface is\n * camelCase (`draw.horizontalLine(...)`). See {@link KIND_CAMELCASE} for\n * the canonical bijection.\n *\n * Variant collapses:\n *\n * - `ray` / `extended-line` collapse into `line` with `extendLeft` /\n * `extendRight` flags on the state.\n * - The 4 invinite pitchfork tools (`standard` / `schiff` /\n * `modifiedSchiff` / `inside`) collapse into `pitchfork` with a\n * `variant` discriminator on the state.\n * - `cypher-pattern` has no standalone tool — emittable only through\n * `defineDrawing` (Task 20).\n *\n * Order pinned: lines (6) → boxes (9) → curves (3) → freehand (3) →\n * annotations (5) → channels (4) → fib (10) → gann (4) → pitchforks (2)\n * → patterns (6) → elliott (5) → cycles (3) → containers (2) → viewport\n * overlays (1) = 63. The order is wire-stable — downstream consumers iterate\n * {@link DRAWING_KINDS} in this order for diagnostic readability.\n *\n * @formula N/A — discriminator constant set\n * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * const k: DrawingKind = \"fib-retracement\";\n * void k;\n */\nexport type DrawingKind =\n // Lines / Rays (6)\n | \"line\"\n | \"horizontal-line\"\n | \"horizontal-ray\"\n | \"vertical-line\"\n | \"cross-line\"\n | \"trend-angle\"\n // Boxes / Shapes (9)\n | \"rectangle\"\n | \"rotated-rectangle\"\n | \"triangle\"\n | \"polyline\"\n | \"circle\"\n | \"ellipse\"\n | \"path\"\n | \"fill-between\"\n | \"marker\"\n // Curves (3)\n | \"arc\"\n | \"curve\"\n | \"double-curve\"\n // Freehand (3)\n | \"pen\"\n | \"highlighter\"\n | \"brush\"\n // Annotations (5)\n | \"text\"\n | \"arrow\"\n | \"arrow-marker\"\n | \"arrow-mark-up\"\n | \"arrow-mark-down\"\n // Channels (4)\n | \"trend-channel\"\n | \"flat-top-bottom\"\n | \"disjoint-channel\"\n | \"regression-trend\"\n // Fibonacci (10)\n | \"fib-retracement\"\n | \"fib-trend-extension\"\n | \"fib-channel\"\n | \"fib-time-zone\"\n | \"fib-wedge\"\n | \"fib-speed-fan\"\n | \"fib-speed-arcs\"\n | \"fib-spiral\"\n | \"fib-circles\"\n | \"fib-trend-time\"\n // Gann (4)\n | \"gann-box\"\n | \"gann-square-fixed\"\n | \"gann-square\"\n | \"gann-fan\"\n // Pitchforks (2)\n | \"pitchfork\"\n | \"pitchfan\"\n // Harmonic Patterns (6)\n | \"xabcd-pattern\"\n | \"cypher-pattern\"\n | \"head-and-shoulders\"\n | \"abcd-pattern\"\n | \"triangle-pattern\"\n | \"three-drives-pattern\"\n // Elliott Waves (5)\n | \"elliott-impulse-wave\"\n | \"elliott-correction-wave\"\n | \"elliott-triangle-wave\"\n | \"elliott-double-combo\"\n | \"elliott-triple-combo\"\n // Cycles (3)\n | \"cyclic-lines\"\n | \"time-cycles\"\n | \"sine-line\"\n // Containers (2)\n | \"group\"\n | \"frame\"\n // Viewport overlays (1)\n | \"table\";\n\n/**\n * Iterable form of {@link DrawingKind}. Order matches the type\n * declaration so docs / validators / dispatchers can walk the set in a\n * single canonical order. Frozen.\n *\n * @formula N/A — discriminator constant set\n * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { DRAWING_KINDS } from \"@invinite-org/chartlang-core\";\n * for (const k of DRAWING_KINDS) {\n * void k;\n * }\n */\nexport const DRAWING_KINDS: ReadonlyArray<DrawingKind> = Object.freeze([\n \"line\",\n \"horizontal-line\",\n \"horizontal-ray\",\n \"vertical-line\",\n \"cross-line\",\n \"trend-angle\",\n \"rectangle\",\n \"rotated-rectangle\",\n \"triangle\",\n \"polyline\",\n \"circle\",\n \"ellipse\",\n \"path\",\n \"fill-between\",\n \"marker\",\n \"arc\",\n \"curve\",\n \"double-curve\",\n \"pen\",\n \"highlighter\",\n \"brush\",\n \"text\",\n \"arrow\",\n \"arrow-marker\",\n \"arrow-mark-up\",\n \"arrow-mark-down\",\n \"trend-channel\",\n \"flat-top-bottom\",\n \"disjoint-channel\",\n \"regression-trend\",\n \"fib-retracement\",\n \"fib-trend-extension\",\n \"fib-channel\",\n \"fib-time-zone\",\n \"fib-wedge\",\n \"fib-speed-fan\",\n \"fib-speed-arcs\",\n \"fib-spiral\",\n \"fib-circles\",\n \"fib-trend-time\",\n \"gann-box\",\n \"gann-square-fixed\",\n \"gann-square\",\n \"gann-fan\",\n \"pitchfork\",\n \"pitchfan\",\n \"xabcd-pattern\",\n \"cypher-pattern\",\n \"head-and-shoulders\",\n \"abcd-pattern\",\n \"triangle-pattern\",\n \"three-drives-pattern\",\n \"elliott-impulse-wave\",\n \"elliott-correction-wave\",\n \"elliott-triangle-wave\",\n \"elliott-double-combo\",\n \"elliott-triple-combo\",\n \"cyclic-lines\",\n \"time-cycles\",\n \"sine-line\",\n \"group\",\n \"frame\",\n \"table\",\n] as const satisfies ReadonlyArray<DrawingKind>);\n\n/**\n * camelCase TypeScript-surface name for every kind. Used by the editor\n * + gen-docs + the compiler's `STATEFUL_PRIMITIVES` lookup so a script\n * author writes `draw.horizontalLine(...)` while the wire format stays\n * kebab-case (`horizontal-line`). The bijection round-trips through\n * {@link KIND_KEBABCASE}.\n *\n * @formula N/A — discriminator constant set\n * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_CAMELCASE } from \"@invinite-org/chartlang-core\";\n * const camel = KIND_CAMELCASE.get(\"horizontal-line\"); // \"horizontalLine\"\n * void camel;\n */\nexport const KIND_CAMELCASE: ReadonlyMap<DrawingKind, string> = new Map<DrawingKind, string>([\n [\"line\", \"line\"],\n [\"horizontal-line\", \"horizontalLine\"],\n [\"horizontal-ray\", \"horizontalRay\"],\n [\"vertical-line\", \"verticalLine\"],\n [\"cross-line\", \"crossLine\"],\n [\"trend-angle\", \"trendAngle\"],\n [\"rectangle\", \"rectangle\"],\n [\"rotated-rectangle\", \"rotatedRectangle\"],\n [\"triangle\", \"triangle\"],\n [\"polyline\", \"polyline\"],\n [\"circle\", \"circle\"],\n [\"ellipse\", \"ellipse\"],\n [\"path\", \"path\"],\n [\"fill-between\", \"fillBetween\"],\n [\"marker\", \"marker\"],\n [\"arc\", \"arc\"],\n [\"curve\", \"curve\"],\n [\"double-curve\", \"doubleCurve\"],\n [\"pen\", \"pen\"],\n [\"highlighter\", \"highlighter\"],\n [\"brush\", \"brush\"],\n [\"text\", \"text\"],\n [\"arrow\", \"arrow\"],\n [\"arrow-marker\", \"arrowMarker\"],\n [\"arrow-mark-up\", \"arrowMarkUp\"],\n [\"arrow-mark-down\", \"arrowMarkDown\"],\n [\"trend-channel\", \"trendChannel\"],\n [\"flat-top-bottom\", \"flatTopBottom\"],\n [\"disjoint-channel\", \"disjointChannel\"],\n [\"regression-trend\", \"regressionTrend\"],\n [\"fib-retracement\", \"fibRetracement\"],\n [\"fib-trend-extension\", \"fibTrendExtension\"],\n [\"fib-channel\", \"fibChannel\"],\n [\"fib-time-zone\", \"fibTimeZone\"],\n [\"fib-wedge\", \"fibWedge\"],\n [\"fib-speed-fan\", \"fibSpeedFan\"],\n [\"fib-speed-arcs\", \"fibSpeedArcs\"],\n [\"fib-spiral\", \"fibSpiral\"],\n [\"fib-circles\", \"fibCircles\"],\n [\"fib-trend-time\", \"fibTrendTime\"],\n [\"gann-box\", \"gannBox\"],\n [\"gann-square-fixed\", \"gannSquareFixed\"],\n [\"gann-square\", \"gannSquare\"],\n [\"gann-fan\", \"gannFan\"],\n [\"pitchfork\", \"pitchfork\"],\n [\"pitchfan\", \"pitchfan\"],\n [\"xabcd-pattern\", \"xabcdPattern\"],\n [\"cypher-pattern\", \"cypherPattern\"],\n [\"head-and-shoulders\", \"headAndShoulders\"],\n [\"abcd-pattern\", \"abcdPattern\"],\n [\"triangle-pattern\", \"trianglePattern\"],\n [\"three-drives-pattern\", \"threeDrivesPattern\"],\n [\"elliott-impulse-wave\", \"elliottImpulseWave\"],\n [\"elliott-correction-wave\", \"elliottCorrectionWave\"],\n [\"elliott-triangle-wave\", \"elliottTriangleWave\"],\n [\"elliott-double-combo\", \"elliottDoubleCombo\"],\n [\"elliott-triple-combo\", \"elliottTripleCombo\"],\n [\"cyclic-lines\", \"cyclicLines\"],\n [\"time-cycles\", \"timeCycles\"],\n [\"sine-line\", \"sineLine\"],\n [\"group\", \"group\"],\n [\"frame\", \"frame\"],\n [\"table\", \"table\"],\n]);\n\n/**\n * Inverse of {@link KIND_CAMELCASE} — camelCase TypeScript surface\n * name → kebab-case wire kind. Derived from `KIND_CAMELCASE` so the\n * two maps cannot drift.\n *\n * @formula N/A — discriminator constant set\n * @anchors 63 kebab-case kind names; see {@link DRAWING_KINDS}\n * @since 0.3\n * @stable\n * @example\n * import { KIND_KEBABCASE } from \"@invinite-org/chartlang-core\";\n * const kebab = KIND_KEBABCASE.get(\"horizontalLine\"); // \"horizontal-line\"\n * void kebab;\n */\nexport const KIND_KEBABCASE: ReadonlyMap<string, DrawingKind> = new Map<string, DrawingKind>(\n Array.from(KIND_CAMELCASE, ([kebab, camel]) => [camel, kebab]),\n);\n"]}
|