@tidal-ts/chart 0.11.0 → 0.12.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/dist/series.d.ts +4 -3
- package/dist/series.js +25 -9
- package/package.json +2 -2
package/dist/series.d.ts
CHANGED
|
@@ -567,9 +567,10 @@ export declare const seriesDrawn: (c: Pick<SeriesConfig, "visible" | "group">) =
|
|
|
567
567
|
export declare const LINE_WIDTHS: readonly [0.5, 1, 1.5, 2];
|
|
568
568
|
/** The dash pattern a `'dashed'` category draws with (also the compare texture). */
|
|
569
569
|
export declare const DASH_PATTERN: readonly [number, number];
|
|
570
|
-
/** Whether a series is a
|
|
571
|
-
* style category). A
|
|
572
|
-
* raw column read as **metrics**.
|
|
570
|
+
/** Whether a series is a **study** (an SMA overlay, an oscillator — the
|
|
571
|
+
* "Derived" style category). A derived metric (the realized-vol line) and
|
|
572
|
+
* every raw column read as **metrics**. Asked of the op ({@link isStudyOp}),
|
|
573
|
+
* so a study with nothing to tune is still a study. */
|
|
573
574
|
export declare function isStudySeries(s: SeriesConfig): boolean;
|
|
574
575
|
/** True if a series reads the COMPARISON symbol — a spec whose leaves are
|
|
575
576
|
* `cmp_`-prefixed, or (an unjoined pair's leg) a raw `cmp_` column. */
|
package/dist/series.js
CHANGED
|
@@ -125,7 +125,7 @@ export function configColumns(c) {
|
|
|
125
125
|
// `@tidal-ts/core` (where the windowing + derive seam live) — imported for
|
|
126
126
|
// `SeriesConfig` below and re-exported so UI code has one import site for the
|
|
127
127
|
// series vocabulary.
|
|
128
|
-
import { BAND_OUTPUTS, COMPARE_PREFIX, deriveId, inputNames, opOutputs, opParams, outputMark, studyLevels, usesCompare, withFanOutput, } from '@tidal-ts/core';
|
|
128
|
+
import { BAND_OUTPUTS, BAR_PRICE_COLUMNS, COMPARE_PREFIX, deriveId, inputNames, isPairOp, isStudyOp, opOutputs, opParams, outputMark, studyLevels, usesCompare, withFanOutput, } from '@tidal-ts/core';
|
|
129
129
|
// The app-wide presentation defaults the category resolvers below read.
|
|
130
130
|
import { DEFAULT_CHART_SETTINGS, } from './chartSettings.js';
|
|
131
131
|
/** The textures in display order. */
|
|
@@ -378,14 +378,12 @@ export const seriesDrawn = (c) => c.visible && !c.group?.hidden;
|
|
|
378
378
|
export const LINE_WIDTHS = [0.5, 1, 1.5, 2];
|
|
379
379
|
/** The dash pattern a `'dashed'` category draws with (also the compare texture). */
|
|
380
380
|
export const DASH_PATTERN = [6, 4];
|
|
381
|
-
/** Whether a series is a
|
|
382
|
-
* style category). A
|
|
383
|
-
* raw column read as **metrics**.
|
|
381
|
+
/** Whether a series is a **study** (an SMA overlay, an oscillator — the
|
|
382
|
+
* "Derived" style category). A derived metric (the realized-vol line) and
|
|
383
|
+
* every raw column read as **metrics**. Asked of the op ({@link isStudyOp}),
|
|
384
|
+
* so a study with nothing to tune is still a study. */
|
|
384
385
|
export function isStudySeries(s) {
|
|
385
|
-
|
|
386
|
-
// "is this windowed?", which was the same question only while every tunable
|
|
387
|
-
// op had exactly one param with that name (PR #181 review, MEDIUM).
|
|
388
|
-
return s.derive ? opParams(s.derive.op).length > 0 : false;
|
|
386
|
+
return s.derive ? isStudyOp(s.derive.op) : false;
|
|
389
387
|
}
|
|
390
388
|
/** True if a series reads the COMPARISON symbol — a spec whose leaves are
|
|
391
389
|
* `cmp_`-prefixed, or (an unjoined pair's leg) a raw `cmp_` column. */
|
|
@@ -554,7 +552,11 @@ export function sourcesOf(configs, c) {
|
|
|
554
552
|
const recorded = configs.find((x) => x.id === byId);
|
|
555
553
|
if (!recorded)
|
|
556
554
|
return; // its parent is gone — an orphan, not a re-bind
|
|
557
|
-
|
|
555
|
+
// A DATA node offers every column of its source, not only the one it
|
|
556
|
+
// draws: a Bollinger of a price's HIGH is still built on that price
|
|
557
|
+
// (Peter, 2026-10-12). Only through the recorded parent, so a study is
|
|
558
|
+
// never re-bound to some other node on the same source.
|
|
559
|
+
if (publishes(recorded, name) || offersRaw(recorded, c, i)) {
|
|
558
560
|
out.push(recorded);
|
|
559
561
|
return;
|
|
560
562
|
}
|
|
@@ -566,6 +568,20 @@ export function sourcesOf(configs, c) {
|
|
|
566
568
|
});
|
|
567
569
|
return out;
|
|
568
570
|
}
|
|
571
|
+
/** Whether data node `p` feeds study `c`'s raw input `i`: `p` draws one of a
|
|
572
|
+
* bar's price columns on the study's own source, and the input reads another.
|
|
573
|
+
* Only a BAR offers its siblings — a vol source's `iv21` and `iv63` are two
|
|
574
|
+
* metrics, each its own node, not two columns of one. */
|
|
575
|
+
const offersRaw = (p, c, i) => {
|
|
576
|
+
if (p.derive || p.source == null || p.source !== c.source || !c.derive)
|
|
577
|
+
return false;
|
|
578
|
+
if (isPairOp(c.derive.op))
|
|
579
|
+
return false;
|
|
580
|
+
const input = c.derive.inputs[i];
|
|
581
|
+
return (typeof input === 'string' &&
|
|
582
|
+
BAR_PRICE_COLUMNS.includes(p.column) &&
|
|
583
|
+
BAR_PRICE_COLUMNS.includes(input));
|
|
584
|
+
};
|
|
569
585
|
/** Whether `c` computes the column `name` — its own, or one of its fanned
|
|
570
586
|
* lines' ({@link publishedColumns}). The cheap test first: a fan is rare. */
|
|
571
587
|
const publishes = (c, name) => c.column === name || (!!c.fan && publishedColumns(c).includes(name));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidal-ts/chart",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TimeSeriesChart — a multi-row time-series chart on @pond-ts/charts, plus the series and settings vocabulary and the prepare step. Theme, colours and settings arrive as props.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react": "^18.2.0 || ^19.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@tidal-ts/core": "0.
|
|
41
|
+
"@tidal-ts/core": "0.12.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@pond-ts/charts": "^0.73.0",
|