openalgo-script 0.7.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/README.md +316 -379
- package/dist/adapters/charts/alerts.d.ts +11 -0
- package/dist/adapters/charts/alerts.d.ts.map +1 -1
- package/dist/adapters/charts/alerts.js +16 -1
- package/dist/adapters/charts/alerts.js.map +1 -1
- package/dist/adapters/charts/capabilities.d.ts +48 -0
- package/dist/adapters/charts/capabilities.d.ts.map +1 -0
- package/dist/adapters/charts/capabilities.js +82 -0
- package/dist/adapters/charts/capabilities.js.map +1 -0
- package/dist/adapters/charts/columns.d.ts +19 -2
- package/dist/adapters/charts/columns.d.ts.map +1 -1
- package/dist/adapters/charts/columns.js +15 -3
- package/dist/adapters/charts/columns.js.map +1 -1
- package/dist/adapters/charts/contract.d.ts +35 -3
- package/dist/adapters/charts/contract.d.ts.map +1 -1
- package/dist/adapters/charts/descriptor.d.ts +1 -1
- package/dist/adapters/charts/descriptor.d.ts.map +1 -1
- package/dist/adapters/charts/descriptor.js +17 -5
- package/dist/adapters/charts/descriptor.js.map +1 -1
- package/dist/adapters/charts/fills.d.ts +26 -5
- package/dist/adapters/charts/fills.d.ts.map +1 -1
- package/dist/adapters/charts/fills.js +55 -7
- package/dist/adapters/charts/fills.js.map +1 -1
- package/dist/adapters/charts/index.d.ts +9 -3
- package/dist/adapters/charts/index.d.ts.map +1 -1
- package/dist/adapters/charts/index.js +7 -1
- package/dist/adapters/charts/index.js.map +1 -1
- package/dist/adapters/charts/produced.d.ts +3 -2
- package/dist/adapters/charts/produced.d.ts.map +1 -1
- package/dist/adapters/charts/produced.js +1 -1
- package/dist/adapters/charts/produced.js.map +1 -1
- package/dist/adapters/charts/run.d.ts +23 -0
- package/dist/adapters/charts/run.d.ts.map +1 -1
- package/dist/adapters/charts/run.js +2 -1
- package/dist/adapters/charts/run.js.map +1 -1
- package/dist/adapters/charts/surfaces.d.ts +11 -0
- package/dist/adapters/charts/surfaces.d.ts.map +1 -1
- package/dist/adapters/charts/tables.d.ts +21 -11
- package/dist/adapters/charts/tables.d.ts.map +1 -1
- package/dist/adapters/charts/tables.js +17 -6
- package/dist/adapters/charts/tables.js.map +1 -1
- package/dist/adapters/charts/undrawable.d.ts +2 -1
- package/dist/adapters/charts/undrawable.d.ts.map +1 -1
- package/dist/adapters/charts/undrawable.js +24 -14
- package/dist/adapters/charts/undrawable.js.map +1 -1
- package/dist/core/check/call-sites.js +15 -5
- package/dist/core/check/call-sites.js.map +1 -1
- package/dist/core/version/version.generated.d.ts +1 -1
- package/dist/core/version/version.generated.js +1 -1
- package/package.json +1 -1
- package/spec/errors.json +1 -1
- package/src/adapters/charts/alerts.ts +28 -1
- package/src/adapters/charts/capabilities.ts +103 -0
- package/src/adapters/charts/columns.ts +29 -8
- package/src/adapters/charts/contract.ts +36 -2
- package/src/adapters/charts/descriptor.ts +21 -6
- package/src/adapters/charts/fills.ts +95 -11
- package/src/adapters/charts/index.ts +9 -1
- package/src/adapters/charts/produced.ts +4 -3
- package/src/adapters/charts/run.ts +25 -1
- package/src/adapters/charts/surfaces.ts +12 -0
- package/src/adapters/charts/tables.ts +31 -14
- package/src/adapters/charts/undrawable.ts +24 -14
- package/src/core/check/call-sites.ts +15 -5
- package/src/core/version/version.generated.ts +1 -1
|
@@ -30,6 +30,17 @@
|
|
|
30
30
|
* reads the run's own string channel there, at the one bar it is asked about,
|
|
31
31
|
* and the alert a user receives carries the numbers the script put in it.
|
|
32
32
|
*
|
|
33
|
+
* **The bar it is asked about is the run's, found through the table.** The
|
|
34
|
+
* index the chart hands the hook is a position in the table it holds, and that
|
|
35
|
+
* is not always a position in the run: a chart that transforms its series into
|
|
36
|
+
* elements that are not one per bar can run a study on the host's bars and read
|
|
37
|
+
* the table onto its elements, so element 7 may hold bar 12's values. The
|
|
38
|
+
* condition is a column and is read across with the rest; the message channel
|
|
39
|
+
* is not, so the table also carries each row's bar index (`columns.ts`), which
|
|
40
|
+
* the chart reads across like any other column, and the message is read at the
|
|
41
|
+
* bar that names. On a chart that draws the bars it computed on, which is every
|
|
42
|
+
* chart before that option existed, the column is the index itself.
|
|
43
|
+
*
|
|
33
44
|
* A message the bar published nothing for falls back to the declared title,
|
|
34
45
|
* which is what the chart itself does for an entry that states no message. That
|
|
35
46
|
* is the honest answer for the one case that reaches it: `message` is a required
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/alerts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/alerts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvE,0DAA0D;AAC1D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9C;AAKD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,OAAO,GACf,SAAS,aAAa,EAAE,CAK1B;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CA2BrF"}
|
|
@@ -4,6 +4,8 @@ import { producedFor } from './produced.js';
|
|
|
4
4
|
export function alertKey(index) {
|
|
5
5
|
return `openscript:alert:${index}`;
|
|
6
6
|
}
|
|
7
|
+
/** The key each row's bar in the run travels under, for the message to be read at. */
|
|
8
|
+
const BAR_KEY = 'openscript:bar';
|
|
7
9
|
/**
|
|
8
10
|
* Each declared alert's message channel, as the run left it.
|
|
9
11
|
*
|
|
@@ -37,13 +39,26 @@ export function buildAlerts(program, lookup) {
|
|
|
37
39
|
...(declared.messageChannel === null
|
|
38
40
|
? {}
|
|
39
41
|
: {
|
|
40
|
-
message: (ctx) => messageAt(producedFor(ctx.settings).messages[index], ctx
|
|
42
|
+
message: (ctx) => messageAt(producedFor(ctx.settings).messages[index], barOf(ctx)) ?? title,
|
|
41
43
|
}),
|
|
42
44
|
when: (ctx) => ctx.values[key]?.[ctx.index] === 1,
|
|
43
45
|
});
|
|
44
46
|
}
|
|
47
|
+
// One column for every message, and none for a study with no message to read.
|
|
48
|
+
if (alerts.some((one) => one.message !== undefined))
|
|
49
|
+
columns.push({ key: BAR_KEY, part: 'bar' });
|
|
45
50
|
return { alerts, columns };
|
|
46
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The bar of the run the chart's row came from.
|
|
54
|
+
*
|
|
55
|
+
* A table without the column is one a host built itself rather than one this
|
|
56
|
+
* descriptor returned, and its rows are the run's bars as they stand.
|
|
57
|
+
*/
|
|
58
|
+
function barOf(ctx) {
|
|
59
|
+
const at = ctx.values[BAR_KEY]?.[ctx.index];
|
|
60
|
+
return typeof at === 'number' ? at : ctx.index;
|
|
61
|
+
}
|
|
47
62
|
/** The message one bar published, or nothing where it published none. */
|
|
48
63
|
function messageAt(column, index) {
|
|
49
64
|
const value = column?.[index];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../src/adapters/charts/alerts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alerts.js","sourceRoot":"","sources":["../../../src/adapters/charts/alerts.ts"],"names":[],"mappings":"AA4DA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,0DAA0D;AAC1D,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,oBAAoB,KAAK,EAAE,CAAC;AACrC,CAAC;AAED,sFAAsF;AACtF,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAOjC;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAwB,EACxB,OAAgB;IAEhB,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7C,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC;QACxC,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,WAAW,CAAC,OAAwB,EAAE,MAAmB;IACvE,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,IAAI,QAAQ,KAAK,SAAS;YAAE,SAAS;QACrC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,MAAM,KAAK,GAAG,WAAW,CAAC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E,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;AACjD,CAAC;AAED,yEAAyE;AACzE,SAAS,SAAS,CAAC,MAAiC,EAAE,KAAa;IACjE,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the host's chart can draw, read from the version the host states.
|
|
3
|
+
*
|
|
4
|
+
* The adapter declares the descriptor's shape rather than importing the chart
|
|
5
|
+
* library, for the reason `contract.ts` gives, so it cannot ask the library
|
|
6
|
+
* what it has. Two hooks arrived after the oldest chart the peer range accepts:
|
|
7
|
+
* a band's per-bar colour callback and the list of grids, both in 2.5.4. A
|
|
8
|
+
* chart ignores a hook it does not know, so a descriptor that relied on either
|
|
9
|
+
* would draw, on an older chart, a band in the chart's own default colours or
|
|
10
|
+
* the first grid alone, and say nothing. That is the failure OS6024 exists to
|
|
11
|
+
* end, so where the adapter cannot tell, it refuses (`undrawable.ts`).
|
|
12
|
+
*
|
|
13
|
+
* **The host states the version, and the adapter reads what that version
|
|
14
|
+
* has.** The library exports its own version string, and a host that imports
|
|
15
|
+
* the chart already holds it: `descriptorFor(program, { chartVersion: VERSION })`.
|
|
16
|
+
* A version rather than a switch per hook, because a switch is a fact about the
|
|
17
|
+
* chart that the host has to look up and keep true through every upgrade and
|
|
18
|
+
* downgrade, while the version is the chart it actually installed.
|
|
19
|
+
*
|
|
20
|
+
* **Nothing stated reads as the oldest chart**, which is the descriptor every
|
|
21
|
+
* host got before the option existed: nothing it draws changes, and a program
|
|
22
|
+
* that needs either hook is refused as it was. A string that is not a version
|
|
23
|
+
* reads the same way, and the refusal says the string could not be read rather
|
|
24
|
+
* than guessing at what it meant. A prerelease orders before its release, as
|
|
25
|
+
* version precedence orders it, so `2.5.4-rc.1` reads as a chart without what
|
|
26
|
+
* 2.5.4 added; build metadata after a `+` orders nothing and is ignored.
|
|
27
|
+
*/
|
|
28
|
+
/** What the chart this descriptor is registered with will read. */
|
|
29
|
+
export interface ChartCapabilities {
|
|
30
|
+
/** A band's colour per bar, through the band's own colour callback. */
|
|
31
|
+
readonly bandColours: boolean;
|
|
32
|
+
/** Every declared grid, through the list of grids with an id each. */
|
|
33
|
+
readonly grids: boolean;
|
|
34
|
+
/** What the host stated, for the sentence a refusal carries. */
|
|
35
|
+
readonly stated: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The two hooks this reads a version for. */
|
|
38
|
+
export type Capability = 'bandColours' | 'grids';
|
|
39
|
+
export declare function capabilitiesOf(stated: string | undefined): ChartCapabilities;
|
|
40
|
+
/**
|
|
41
|
+
* The sentence a refusal gives for a hook the chart may not have.
|
|
42
|
+
*
|
|
43
|
+
* `older` is what a chart without the hook does, in the words a reader of the
|
|
44
|
+
* refusal needs; the rest says which version has it and what this host stated,
|
|
45
|
+
* because the fix is the host's and it has to know which of the two to change.
|
|
46
|
+
*/
|
|
47
|
+
export declare function lacking(chart: ChartCapabilities, capability: Capability, older: string): string;
|
|
48
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,8CAA8C;AAC9C,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,OAAO,CAAC;AAgBjD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAO5E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAU/F"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the host's chart can draw, read from the version the host states.
|
|
3
|
+
*
|
|
4
|
+
* The adapter declares the descriptor's shape rather than importing the chart
|
|
5
|
+
* library, for the reason `contract.ts` gives, so it cannot ask the library
|
|
6
|
+
* what it has. Two hooks arrived after the oldest chart the peer range accepts:
|
|
7
|
+
* a band's per-bar colour callback and the list of grids, both in 2.5.4. A
|
|
8
|
+
* chart ignores a hook it does not know, so a descriptor that relied on either
|
|
9
|
+
* would draw, on an older chart, a band in the chart's own default colours or
|
|
10
|
+
* the first grid alone, and say nothing. That is the failure OS6024 exists to
|
|
11
|
+
* end, so where the adapter cannot tell, it refuses (`undrawable.ts`).
|
|
12
|
+
*
|
|
13
|
+
* **The host states the version, and the adapter reads what that version
|
|
14
|
+
* has.** The library exports its own version string, and a host that imports
|
|
15
|
+
* the chart already holds it: `descriptorFor(program, { chartVersion: VERSION })`.
|
|
16
|
+
* A version rather than a switch per hook, because a switch is a fact about the
|
|
17
|
+
* chart that the host has to look up and keep true through every upgrade and
|
|
18
|
+
* downgrade, while the version is the chart it actually installed.
|
|
19
|
+
*
|
|
20
|
+
* **Nothing stated reads as the oldest chart**, which is the descriptor every
|
|
21
|
+
* host got before the option existed: nothing it draws changes, and a program
|
|
22
|
+
* that needs either hook is refused as it was. A string that is not a version
|
|
23
|
+
* reads the same way, and the refusal says the string could not be read rather
|
|
24
|
+
* than guessing at what it meant. A prerelease orders before its release, as
|
|
25
|
+
* version precedence orders it, so `2.5.4-rc.1` reads as a chart without what
|
|
26
|
+
* 2.5.4 added; build metadata after a `+` orders nothing and is ignored.
|
|
27
|
+
*/
|
|
28
|
+
/** The chart version each hook arrived in. */
|
|
29
|
+
const SINCE = {
|
|
30
|
+
bandColours: '2.5.4',
|
|
31
|
+
grids: '2.5.4',
|
|
32
|
+
};
|
|
33
|
+
/** `major.minor.patch`, an optional prerelease, optional build metadata. */
|
|
34
|
+
const VERSION = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
35
|
+
export function capabilitiesOf(stated) {
|
|
36
|
+
const read = stated === undefined ? undefined : readVersion(stated);
|
|
37
|
+
return {
|
|
38
|
+
bandColours: read !== undefined && reaches(read, SINCE.bandColours),
|
|
39
|
+
grids: read !== undefined && reaches(read, SINCE.grids),
|
|
40
|
+
stated,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The sentence a refusal gives for a hook the chart may not have.
|
|
45
|
+
*
|
|
46
|
+
* `older` is what a chart without the hook does, in the words a reader of the
|
|
47
|
+
* refusal needs; the rest says which version has it and what this host stated,
|
|
48
|
+
* because the fix is the host's and it has to know which of the two to change.
|
|
49
|
+
*/
|
|
50
|
+
export function lacking(chart, capability, older) {
|
|
51
|
+
const since = SINCE[capability];
|
|
52
|
+
const stated = chart.stated;
|
|
53
|
+
const which = stated === undefined
|
|
54
|
+
? 'this host stated no chart version'
|
|
55
|
+
: readVersion(stated) === undefined
|
|
56
|
+
? `this host stated ${JSON.stringify(stated)}, which is not a version this adapter can read`
|
|
57
|
+
: `this host stated version ${stated}`;
|
|
58
|
+
return `${older} before chart version ${since}, and ${which}`;
|
|
59
|
+
}
|
|
60
|
+
function readVersion(text) {
|
|
61
|
+
const match = VERSION.exec(text);
|
|
62
|
+
if (match === null)
|
|
63
|
+
return undefined;
|
|
64
|
+
return {
|
|
65
|
+
release: [Number(match[1]), Number(match[2]), Number(match[3])],
|
|
66
|
+
prerelease: match[4] !== undefined,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Whether a stated version is at or past the one a hook arrived in. */
|
|
70
|
+
function reaches(read, since) {
|
|
71
|
+
const needed = readVersion(since);
|
|
72
|
+
if (needed === undefined)
|
|
73
|
+
return false;
|
|
74
|
+
for (let part = 0; part < 3; part += 1) {
|
|
75
|
+
const have = read.release[part] ?? 0;
|
|
76
|
+
const need = needed.release[part] ?? 0;
|
|
77
|
+
if (have !== need)
|
|
78
|
+
return have > need;
|
|
79
|
+
}
|
|
80
|
+
return !read.prerelease;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/adapters/charts/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAeH,8CAA8C;AAC9C,MAAM,KAAK,GAAyC;IAClD,WAAW,EAAE,OAAO;IACpB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,4EAA4E;AAC5E,MAAM,OAAO,GAAG,iFAAiF,CAAC;AAOlG,MAAM,UAAU,cAAc,CAAC,MAA0B;IACvD,MAAM,IAAI,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACpE,OAAO;QACL,WAAW,EAAE,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;QACnE,KAAK,EAAE,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC;QACvD,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,KAAwB,EAAE,UAAsB,EAAE,KAAa;IACrF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,KAAK,C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AC;IACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;AAC1B,CAAC"}
|
|
@@ -9,13 +9,30 @@ import type { Columns } from './run.js';
|
|
|
9
9
|
* keeps `language.md` 6.6's answer intact on the way: absent is not true.
|
|
10
10
|
*/
|
|
11
11
|
export type ColumnPart = 'value' | 'rgb' | 'alpha' | 'flag';
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* One column of the table: a part of a channel, or the bar each row came from.
|
|
14
|
+
*
|
|
15
|
+
* The second kind reads no channel. It holds the index of the bar in the run
|
|
16
|
+
* the calculation was handed, and it exists because a chart may read the table
|
|
17
|
+
* onto bars other than those: a chart that transforms its series and runs a
|
|
18
|
+
* study on the bars the host fed it reads each column at the source bar every
|
|
19
|
+
* drawn element was completed on, and then hands each hook the element's index.
|
|
20
|
+
* A hook that reads a column is right by construction. A hook that reads
|
|
21
|
+
* something the run left elsewhere, indexed by the run's own bars, finds the
|
|
22
|
+
* bar through this column, which the chart reads across like any other.
|
|
23
|
+
*/
|
|
24
|
+
export type ColumnSpec = {
|
|
13
25
|
readonly key: string;
|
|
14
26
|
readonly channel: number;
|
|
15
27
|
readonly part: ColumnPart;
|
|
16
|
-
}
|
|
28
|
+
} | {
|
|
29
|
+
readonly key: string;
|
|
30
|
+
readonly part: 'bar';
|
|
31
|
+
};
|
|
17
32
|
/** The key a level's price column travels under. */
|
|
18
33
|
export declare function levelKey(index: number): string;
|
|
34
|
+
/** The key one side of a band's computed colour travels under. */
|
|
35
|
+
export declare function bandColourKey(band: number, side: 'up' | 'down'): string;
|
|
19
36
|
/** The two keys a per-bar colour travels under. */
|
|
20
37
|
export declare function colourKeys(key: string): {
|
|
21
38
|
readonly rgb: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/columns.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO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M5F;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,UAAU,EAAE,CAMjF;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,WAAW,CAiBb"}
|
|
@@ -3,6 +3,10 @@ import { isColourValue, packChannels, unpackColour } from './colours.js';
|
|
|
3
3
|
export function levelKey(index) {
|
|
4
4
|
return `openscript:level:${index}`;
|
|
5
5
|
}
|
|
6
|
+
/** The key one side of a band's computed colour travels under. */
|
|
7
|
+
export function bandColourKey(band, side) {
|
|
8
|
+
return `openscript:fill:${band}:${side}`;
|
|
9
|
+
}
|
|
6
10
|
/** The two keys a per-bar colour travels under. */
|
|
7
11
|
export function colourKeys(key) {
|
|
8
12
|
return { rgb: `${key}:rgb`, alpha: `${key}:alpha` };
|
|
@@ -35,10 +39,18 @@ export function colourColumns(key, channel) {
|
|
|
35
39
|
export function valuesFrom(specs, columns, from, to) {
|
|
36
40
|
const out = {};
|
|
37
41
|
for (const spec of specs) {
|
|
38
|
-
const column = columns[spec.channel] ?? [];
|
|
39
42
|
const built = new Array(Math.max(0, to - from));
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
if (spec.part === 'bar') {
|
|
44
|
+
// The bar's own index, never its offset into the tail: the chart splices
|
|
45
|
+
// a tail by position, so a row carries the same number either way.
|
|
46
|
+
for (let bar = from; bar < to; bar += 1)
|
|
47
|
+
built[bar - from] = bar;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const column = columns[spec.channel] ?? [];
|
|
51
|
+
for (let bar = from; bar < to; bar += 1) {
|
|
52
|
+
built[bar - from] = partOf(column[bar] ?? null, spec.part);
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
out[spec.key] = built;
|
|
44
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../src/adapters/charts/columns.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../src/adapters/charts/columns.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AA8BzE,oDAAoD;AACpD,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,OAAO,oBAAoB,KAAK,EAAE,CAAC;AACrC,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,IAAmB;IAC7D,OAAO,mBAAmB,IAAI,IAAI,IAAI,EAAE,CAAC;AAC3C,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,QAAQ,EAAE,CAAC;AACtD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,MAAmB,EAAE,KAAa,EAAE,GAAW;IACtE,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC3E,OAAO,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,oEAAoE;AACpE,MAAM,U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C;IACxB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,MAAM,CAAC,KAAY,EAAE,IAAgB;IAC5C,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACtE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* What is declared is the whole output surface: the inputs and the settings
|
|
33
33
|
* dialog a chart generates from them, the plots with their styles and scales,
|
|
34
34
|
* the bands between them, the horizontal levels, the pane's fixed range, the
|
|
35
|
-
* markers, the candle and pane painting, the summary
|
|
35
|
+
* markers, the candle and pane painting, the summary grids, the drawing objects,
|
|
36
36
|
* the watched conditions, and the lifecycle a read of another instrument fetches
|
|
37
37
|
* through.
|
|
38
38
|
*
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* still assignable to the library's wider one, and a value this adapter cannot
|
|
50
50
|
* produce is better left out than declared and never written.
|
|
51
51
|
*/
|
|
52
|
-
import type { ChartAlertSpec, ChartAttachContext, ChartDrawing, ChartGrid, ChartMarker, ChartSurfaceContext } from './surfaces.js';
|
|
52
|
+
import type { ChartAlertSpec, ChartAttachContext, ChartDrawing, ChartGrid, ChartMarker, ChartSurfaceContext, ChartTableSpec } from './surfaces.js';
|
|
53
53
|
/** One bar as the chart holds it. Its time is UTC seconds, not milliseconds. */
|
|
54
54
|
export interface ChartBar {
|
|
55
55
|
readonly time: number;
|
|
@@ -194,6 +194,19 @@ export interface ChartPlot {
|
|
|
194
194
|
colorBy?(ctx: ChartColorContext): string | undefined;
|
|
195
195
|
colorParts?(ctx: ChartColorContext): ChartBarColor | undefined;
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* What a band's per-bar colour callback is handed, for one bar.
|
|
199
|
+
*
|
|
200
|
+
* `a` and `b` are the two columns the band is drawn between, read on that bar,
|
|
201
|
+
* and `null` where either has no value, which is a bar the band is not drawn on.
|
|
202
|
+
*/
|
|
203
|
+
export interface ChartFillContext {
|
|
204
|
+
readonly index: number;
|
|
205
|
+
readonly a: number | null;
|
|
206
|
+
readonly b: number | null;
|
|
207
|
+
readonly values: ChartValues;
|
|
208
|
+
readonly settings: ChartSettings;
|
|
209
|
+
}
|
|
197
210
|
export interface ChartFill {
|
|
198
211
|
readonly between: readonly [string, string];
|
|
199
212
|
readonly colorUp?: string;
|
|
@@ -202,6 +215,15 @@ export interface ChartFill {
|
|
|
202
215
|
readonly colorDownKey?: string;
|
|
203
216
|
readonly opacity?: number;
|
|
204
217
|
readonly overlay?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* The band's colour on one bar, for a band whose colour the script computes.
|
|
220
|
+
*
|
|
221
|
+
* Present only on such a band, and only where the host states a chart that
|
|
222
|
+
* has the callback (`capabilities.ts`). Nothing where that bar's side is not
|
|
223
|
+
* computed per bar, which leaves the chart drawing the band's own colour for
|
|
224
|
+
* that side.
|
|
225
|
+
*/
|
|
226
|
+
colorBy?(ctx: ChartFillContext): string | undefined;
|
|
205
227
|
}
|
|
206
228
|
export interface ChartLevel {
|
|
207
229
|
readonly price: number;
|
|
@@ -262,8 +284,18 @@ export interface ChartDescriptor {
|
|
|
262
284
|
background?(ctx: ChartSurfaceContext): readonly (string | null)[];
|
|
263
285
|
/** Every marker the last calculation produced, oldest bar first. */
|
|
264
286
|
markers?(ctx: ChartSurfaceContext): readonly ChartMarker[];
|
|
265
|
-
/** The declared grid as the last executed bar left it, or nothing. */
|
|
287
|
+
/** The first declared grid as the last executed bar left it, or nothing. */
|
|
266
288
|
table?(ctx: ChartSurfaceContext): ChartGrid | null;
|
|
289
|
+
/**
|
|
290
|
+
* Every declared grid as the last executed bar left it, each under its
|
|
291
|
+
* declaration's key.
|
|
292
|
+
*
|
|
293
|
+
* A chart that has this hook reads it in place of `table`, and one that does
|
|
294
|
+
* not reads `table` and draws the first grid. So it is present only where the
|
|
295
|
+
* host states a chart that has it (`capabilities.ts`), and a second grid is
|
|
296
|
+
* refused on a chart that does not.
|
|
297
|
+
*/
|
|
298
|
+
tables?(ctx: ChartSurfaceContext): readonly ChartTableSpec[];
|
|
267
299
|
/** Every drawing object the script currently holds, oldest first. */
|
|
268
300
|
draws?(ctx: ChartSurfaceContext): readonly ChartDrawing[];
|
|
269
301
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,mBAAmB,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,cAAc,EACf,MAAM,eAAe,CAAC;AAEvB,gFAAgF;AAChF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ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CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACjE,6EAA6E;IAC7E,UAAU,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAClE,oEAAoE;IACpE,OAAO,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,WAAW,EAAE,CAAC;IAC3D,4EAA4E;IAC5E,KAAK,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI,CAAC;IACnD;;;;;;;;OAQG;IACH,MAAM,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,cAAc,EAAE,CAAC;IAC7D,qEAAqE;IACrE,KAAK,CAAC,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,YAAY,EAAE,CAAC;IAC1D;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,GAAG,EAAE,kBAAkB,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CACvD"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* second thing to keep in step with the specification.
|
|
15
15
|
*
|
|
16
16
|
* **The hooks that follow a calculation read it and do not repeat it.** Markers,
|
|
17
|
-
* the
|
|
17
|
+
* the grids, the drawing objects and each alert's message channel are taken once,
|
|
18
18
|
* while the engine is in hand, and left in the run record `produced.ts` keeps.
|
|
19
19
|
* The chart calls each hook after every calculation, so asking twice gives one
|
|
20
20
|
* answer and a study with a grid costs the same over a hundred thousand bars as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIhE,OAAO,KAAK,EAGV,eAAe,EAIhB,MAAM,eAAe,CAAC;AAWvB,OAAO,KAAK,EAAE,mBAAmB,EAAa,MAAM,UAAU,CAAC;AAe/D,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAkIjB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { alertMessages, buildAlerts } from './alerts.js';
|
|
2
|
+
import { capabilitiesOf } from './capabilities.js';
|
|
2
3
|
import { valuesFrom } from './columns.js';
|
|
3
4
|
import { buildDrawings } from './drawings.js';
|
|
4
5
|
import { buildFills } from './fills.js';
|
|
@@ -11,7 +12,7 @@ import { producedFor, remember } from './produced.js';
|
|
|
11
12
|
import { stationIn } from './requests.js';
|
|
12
13
|
import { fullRun, release, tailRun } from './run.js';
|
|
13
14
|
import { inputRows, lookupFor } from './settings.js';
|
|
14
|
-
import {
|
|
15
|
+
import { buildTables, firstGrid } from './tables.js';
|
|
15
16
|
/** The grey an unnamed marker is drawn in, where the host names no default. */
|
|
16
17
|
const MARKER_COLOUR = 'rgba(128, 128, 128, 1)';
|
|
17
18
|
export function descriptorFor(program, options = {}) {
|
|
@@ -22,10 +23,13 @@ export function descriptorFor(program, options = {}) {
|
|
|
22
23
|
// afterwards carry a settings key instead of a value, and the two that cannot
|
|
23
24
|
// are read again per call: a level's style and the pane's range.
|
|
24
25
|
const declared = lookupFor(program, options.settings ?? {});
|
|
26
|
+
// Which of the descriptor's newer hooks the host's chart reads. A hook it may
|
|
27
|
+
// not read is left off, and what needs one is refused before a bar runs.
|
|
28
|
+
const chart = capabilitiesOf(options.chartVersion);
|
|
25
29
|
const overlay = boolField(program.meta.overlay, declared) === true;
|
|
26
30
|
const plots = buildPlots(program, declared, !overlay);
|
|
27
31
|
const levels = buildLevels(program);
|
|
28
|
-
const fills = buildFills(program, declared);
|
|
32
|
+
const fills = buildFills(program, declared, chart);
|
|
29
33
|
const paint = buildPaint(program);
|
|
30
34
|
const alerts = buildAlerts(program, declared);
|
|
31
35
|
const columns = [
|
|
@@ -33,6 +37,7 @@ export function descriptorFor(program, options = {}) {
|
|
|
33
37
|
...levels.columns,
|
|
34
38
|
...paint.columns,
|
|
35
39
|
...alerts.columns,
|
|
40
|
+
...fills.columns,
|
|
36
41
|
];
|
|
37
42
|
const markerColour = options.markerColor ?? MARKER_COLOUR;
|
|
38
43
|
/**
|
|
@@ -46,7 +51,7 @@ export function descriptorFor(program, options = {}) {
|
|
|
46
51
|
const lookup = lookupFor(program, settings);
|
|
47
52
|
remember(settings, {
|
|
48
53
|
markers: buildMarkers(program, lookup, bars, ran.columns, markerColour),
|
|
49
|
-
|
|
54
|
+
tables: buildTables(program, lookup, ran.tables),
|
|
50
55
|
drawings: buildDrawings(ran.drawings),
|
|
51
56
|
messages: alertMessages(program, ran.columns),
|
|
52
57
|
});
|
|
@@ -62,7 +67,7 @@ export function descriptorFor(program, options = {}) {
|
|
|
62
67
|
placement: overlay ? 'onchart' : 'pane',
|
|
63
68
|
inputs: inputRows(program),
|
|
64
69
|
plots: plots.plots,
|
|
65
|
-
...(fills.length === 0 ? {} : { fills }),
|
|
70
|
+
...(fills.fills.length === 0 ? {} : { fills: fills.fills }),
|
|
66
71
|
...(alerts.alerts.length === 0 ? {} : { alerts: alerts.alerts }),
|
|
67
72
|
calc(bars, settings, store, ctx) {
|
|
68
73
|
const ran = fullRun(program, bars, settings, store, ctx, options);
|
|
@@ -87,7 +92,14 @@ export function descriptorFor(program, options = {}) {
|
|
|
87
92
|
}),
|
|
88
93
|
...(program.outputs.tables.length === 0
|
|
89
94
|
? {}
|
|
90
|
-
: {
|
|
95
|
+
: {
|
|
96
|
+
table: (ctx) => firstGrid(producedFor(ctx.settings).tables),
|
|
97
|
+
}),
|
|
98
|
+
...(program.outputs.tables.length === 0 || !chart.grids
|
|
99
|
+
? {}
|
|
100
|
+
: {
|
|
101
|
+
tables: (ctx) => producedFor(ctx.settings).tables,
|
|
102
|
+
}),
|
|
91
103
|
...(program.requires.includes('objects')
|
|
92
104
|
? {
|
|
93
105
|
draws: (ctx) => producedFor(ctx.settings).drawings,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../../../src/adapters/charts/descriptor.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../../../src/adapters/charts/descriptor.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,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
2
|
* Declared bands into the chart's shaded bands.
|
|
3
3
|
*
|
|
4
4
|
* A band is two plot keys and two colours, which is the chart's own spec, so the
|
|
5
|
-
* pair of keys crosses unchanged.
|
|
5
|
+
* pair of keys crosses unchanged. Three details do not.
|
|
6
6
|
*
|
|
7
7
|
* **Opacity is a dimmer, not a second alpha.** A colour carries its own alpha
|
|
8
8
|
* everywhere in the language, and the band's `opacity` multiplies whatever the
|
|
9
|
-
* colours already are. That is exactly what the chart does with the field,
|
|
10
|
-
*
|
|
9
|
+
* colours already are. That is exactly what the chart does with the field, to a
|
|
10
|
+
* colour computed per bar as much as to a constant one, so a script that never
|
|
11
|
+
* touches it gets the colour it wrote.
|
|
11
12
|
*
|
|
12
13
|
* **A band with no colour of its own follows the first plot.** `stdlib.md` 14.2
|
|
13
14
|
* says such a band is that plot's colour faded to twelve percent, and the plot's
|
|
14
15
|
* colour may be one the host picked from its palette rather than one the script
|
|
15
16
|
* wrote, so the band is pointed at the plot's settings key rather than at a value
|
|
16
17
|
* read now. The twelve percent is then the dimmer, multiplied by whatever the
|
|
17
|
-
* script asked for.
|
|
18
|
+
* script asked for. A band whose colour is computed per bar has a colour of its
|
|
19
|
+
* own, so neither applies to it.
|
|
20
|
+
*
|
|
21
|
+
* **A colour computed per bar travels as columns and is read back per bar.**
|
|
22
|
+
* It arrives on a channel, rides the values table as the two columns
|
|
23
|
+
* `columns.ts` describes, and the band's colour callback reads them on each bar
|
|
24
|
+
* for the side the band is on there. The side is decided the way the chart
|
|
25
|
+
* decides it, the first plot at or above the second, so the colour answered is
|
|
26
|
+
* the colour of the run the chart is drawing that bar in. An absent colour is a
|
|
27
|
+
* transparent one rather than no answer, because no answer hands the bar to
|
|
28
|
+
* the band's colour for that side, and `docs/visuals/fills.md` teaches an absent
|
|
29
|
+
* colour as how a band switches itself off. The callback exists only on a chart
|
|
30
|
+
* that reads it (`capabilities.ts`); on any other, `undrawable.ts` has refused
|
|
31
|
+
* the program before this is drawn.
|
|
18
32
|
*/
|
|
19
33
|
import type { CompiledProgram } from '../../core/emit/index.js';
|
|
34
|
+
import type { ChartCapabilities } from './capabilities.js';
|
|
35
|
+
import type { ColumnSpec } from './columns.js';
|
|
20
36
|
import type { ChartFill } from './contract.js';
|
|
21
37
|
import type { InputLookup } from './fields.js';
|
|
22
|
-
export
|
|
38
|
+
export interface FillsBuild {
|
|
39
|
+
readonly fills: readonly ChartFill[];
|
|
40
|
+
/** The colour columns the bands' callbacks read, for the values table. */
|
|
41
|
+
readonly columns: readonly ColumnSpec[];
|
|
42
|
+
}
|
|
43
|
+
export declare function buildFills(program: CompiledProgram, lookup: InputLookup, chart: ChartCapabilities): FillsBuild;
|
|
23
44
|
//# sourceMappingURL=fills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fills.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/fills.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fills.d.ts","sourceRoot":"","sources":["../../../src/adapters/charts/fills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,EAAQ,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa/C,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CACzC;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,iBAAiB,GACvB,UAAU,CASZ"}
|